khypervisor  v1
include/gic_regs.h
Go to the documentation of this file.
00001 #ifndef __GIC_REGS_H__
00002 #define __GIC_REGS_H__
00003 
00004 /* Offsets from GIC Base Address */
00005 #define GIC_OFFSET_GICD     0x1000
00006 #define GIC_OFFSET_GICC     0x2000
00007 #define GIC_OFFSET_GICH     0x4000
00008 #define GIC_OFFSET_GICV     0x5000
00009 #define GIC_OFFSET_GICVI    0x6000
00010 
00011 /* Distributor */
00012 #define GICD_CTLR   0x000
00013 #define GICD_TYPER  (0x004/4)
00014 #define GICD_IIDR   (0x008/4)
00015 #define GICD_IGROUPR    (0x080/4)
00016 #define GICD_ISENABLER  (0x100/4)
00017 #define GICD_ICENABLER  (0x180/4)
00018 #define GICD_ISPENDR    (0x200/4)
00019 #define GICD_ICPENDR    (0x280/4)
00020 #define GICD_IPRIORITYR (0x400/4)
00021 #define GICD_ITARGETSR  (0x800/4) 
00022 #define GICD_ICFGR  (0xC00/4)
00023 
00024 /* CPU Interface */
00025 #define GICC_CTLR   (0x0000/4)
00026 #define GICC_PMR    (0x0004/4)
00027 #define GICC_BPR    (0x0008/4)
00028 #define GICC_IAR    (0x000C/4)
00029 #define GICC_EOIR   (0x0010/4)
00030 #define GICC_DIR    (0x1000/4)
00031 
00032 /* Virtual Interface Control */
00033 #define GICH_HCR    (0x00/4)
00034 #define GICH_VTR    (0x04/4)
00035 #define GICH_VMCR   (0x08/4)
00036 #define GICH_MISR   (0x10/4)
00037 #define GICH_EISR0  (0x20/4)
00038 #define GICH_EISR1  (0x24/4)
00039 #define GICH_ELSR0  (0x30/4)
00040 #define GICH_ELSR1  (0x34/4)
00041 #define GICH_APR    (0xF0/4)
00042 #define GICH_LR     (0x100/4)    /* LR0 ~ LRn, n:GICH_VTR.ListRegs */
00043 
00044 
00045 /* Distributor Register Fields */
00046 #define GICD_CTLR_ENABLE    0x1
00047 #define GICD_TYPE_LINES_MASK    0x01f
00048 #define GICD_TYPE_CPUS_MASK 0x0e0
00049 #define GICD_TYPE_CPUS_SHIFT    5
00050 
00051 /* CPU Interface Register Fields */
00052 #define GICC_CTL_ENABLE     0x1
00053 #define GICC_CTL_EOI        (0x1 << 9)
00054 #define GICC_IAR_INTID_MASK 0x03ff
00055 
00056 /* Virtual Interface Control */
00057 #define GICH_HCR_EN             0x1
00058 #define GICH_HCR_NPIE           (0x1 << 3)
00059 #define GICH_HCR_LRENPIE        (0x1 << 2)
00060 #define GICH_HCR_UIE            (0x1 << 1)
00061 #define GICH_VTR_PRIBITS_SHIFT  29
00062 #define GICH_VTR_PRIBITS_MASK   (0x7 << GICH_VTR_PRIVITS_SHIFT)
00063 #define GICH_VTR_PREBITS_SHIFT  26
00064 #define GICH_VTR_PREBITS_MASK   (0x7 << GICH_VTR_PREVITS_SHIFT)
00065 #define GICH_VTR_LISTREGS_MASK  0x3f
00066 
00067 
00068 #define GICH_LR_VIRTUALID_SHIFT     0
00069 #define GICH_LR_VIRTUALID_MASK      (0x3ff << GICH_LR_VIRTUALID_SHIFT)
00070 #define GICH_LR_PHYSICALID_SHIFT    10
00071 #define GICH_LR_PHYSICALID_MASK     (0x3ff << GICH_LR_PHYSICALID_SHIFT)
00072 #define GICH_LR_CPUID_SHIFT         10
00073 #define GICH_LR_CPUID_MASK          (0x7 << GICH_LR_CPUID_SHIFT)
00074 #define GICH_LR_EOI_SHIFT           19
00075 #define GICH_LR_EOI_MASK            (0x1 << GICH_LR_EOI_SHIFT)
00076 #define GICH_LR_EOI                 (0x1 << GICH_LR_EOI_SHIFT)
00077 #define GICH_LR_PRIORITY_SHIFT      23
00078 #define GICH_LR_PRIORITY_MASK       (0x1f << GICH_LR_PRIORITY_SHIFT)
00079 #define GICH_LR_STATE_SHIFT     28
00080 #define GICH_LR_STATE_MASK      (0x3 << GICH_LR_STATE_SHIFT)
00081 #define GICH_LR_STATE_INACTIVE          ( 0x0 << GICH_LR_STATE_SHIFT )
00082 #define GICH_LR_STATE_PENDING           ( 0x1 << GICH_LR_STATE_SHIFT )
00083 #define GICH_LR_STATE_ACTIVE            ( 0x2 << GICH_LR_STATE_SHIFT )
00084 #define GICH_LR_STATE_PENDING_ACTIVE    ( 0x3 << GICH_LR_STATE_SHIFT )
00085 #define GICH_LR_GRP1_SHIFT      30
00086 #define GICH_LR_GRP1_MASK       (0x1 << GICH_LR_GRP1_SHIFT)
00087 #define GICH_LR_GRP1            (0x1 << GICH_LR_GRP1_SHIFT)
00088 #define GICH_LR_HW_SHIFT      31
00089 #define GICH_LR_HW_MASK       (0x1 << GICH_LR_HW_SHIFT)
00090 #define GICH_LR_HW            (0x1 << GICH_LR_HW_SHIFT)
00091 
00092 #define GICH_MISR_EOI           (1)
00093 #define GICH_MISR_U_SHIFT       (1)
00094 #define GICH_MISR_U             (1 << GICH_MISR_U_SHIFT)
00095 #define GICH_MISR_NP_SHIFT      (3)
00096 #define GICH_MISR_NP            (1 << GICH_MISR_NP_SHIFT)
00097 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines