15#define ARM_GIC_ICDDCR 0x000
16#define ARM_GIC_ICDICTR 0x004
17#define ARM_GIC_ICDIIDR 0x008
20#define ARM_GIC_ICDISR 0x080
21#define ARM_GIC_ICDISER 0x100
22#define ARM_GIC_ICDICER 0x180
23#define ARM_GIC_ICDSPR 0x200
24#define ARM_GIC_ICDICPR 0x280
25#define ARM_GIC_ICDABR 0x300
28#define ARM_GIC_ICDIPR 0x400
31#define ARM_GIC_ICDIPTR 0x800
32#define ARM_GIC_ICDICFR 0xC00
34#define ARM_GIC_ICDPPISR 0xD00
37#define ARM_GIC_ICDSGIR 0xF00
40#define ARM_GICD_IROUTER 0x6100
43#define ARM_GIC_ICDDCR_ARE (1 << 4)
44#define ARM_GIC_ICDDCR_DS (1 << 6)
47#define ARM_GIC_ICDICFR_WIDTH 32
48#define ARM_GIC_ICDICFR_BYTES (ARM_GIC_ICDICFR_WIDTH / 8)
49#define ARM_GIC_ICDICFR_F_WIDTH 2
50#define ARM_GIC_ICDICFR_F_STRIDE 16
51#define ARM_GIC_ICDICFR_F_CONFIG1_BIT 1
52#define ARM_GIC_ICDICFR_LEVEL_TRIGGERED 0x0
53#define ARM_GIC_ICDICFR_EDGE_TRIGGERED 0x1
56#define ARM_GICR_CTLR_FRAME_SIZE SIZE_64KB
57#define ARM_GICR_SGI_PPI_FRAME_SIZE SIZE_64KB
58#define ARM_GICR_SGI_VLPI_FRAME_SIZE SIZE_64KB
59#define ARM_GICR_SGI_RESERVED_FRAME_SIZE SIZE_64KB
62#define ARM_GICR_TYPER 0x0008
65#define ARM_GICR_TYPER_PLPIS (1 << 0)
66#define ARM_GICR_TYPER_VLPIS (1 << 1)
67#define ARM_GICR_TYPER_DIRECTLPI (1 << 3)
68#define ARM_GICR_TYPER_LAST (1 << 4)
69#define ARM_GICR_TYPER_DPGS (1 << 5)
71#define ARM_GICR_TYPER_PROCNO (0xFFFF << 8)
72#define ARM_GICR_TYPER_COMMONLPIAFF (0x3 << 24)
73#define ARM_GICR_TYPER_AFFINITY (0xFFFFFFFFULL << 32)
75#define ARM_GICR_TYPER_GET_AFFINITY(TypeReg) (((TypeReg) & \
76 ARM_GICR_TYPER_AFFINITY) >> 32)
79#define ARM_GICR_ISENABLER 0x0100
80#define ARM_GICR_ICENABLER 0x0180
83#define ARM_GIC_ICCICR 0x00
84#define ARM_GIC_ICCPMR 0x04
85#define ARM_GIC_ICCBPR 0x08
86#define ARM_GIC_ICCIAR 0x0C
87#define ARM_GIC_ICCEIOR 0x10
88#define ARM_GIC_ICCRPR 0x14
89#define ARM_GIC_ICCPIR 0x18
90#define ARM_GIC_ICCABPR 0x1C
91#define ARM_GIC_ICCIIDR 0xFC
93#define ARM_GIC_ICDSGIR_FILTER_TARGETLIST 0x0
94#define ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE 0x1
95#define ARM_GIC_ICDSGIR_FILTER_ITSELF 0x2
98#define ARM_GIC_ICCICR_ENABLE_SECURE 0x01
99#define ARM_GIC_ICCICR_ENABLE_NS 0x02
100#define ARM_GIC_ICCICR_ACK_CTL 0x04
101#define ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ 0x08
102#define ARM_GIC_ICCICR_USE_SBPR 0x10
105#define ARM_GIC_ICCIIDR_GET_PRODUCT_ID(IccIidr) (((IccIidr) >> 20) & 0xFFF)
106#define ARM_GIC_ICCIIDR_GET_ARCH_VERSION(IccIidr) (((IccIidr) >> 16) & 0xF)
107#define ARM_GIC_ICCIIDR_GET_REVISION(IccIidr) (((IccIidr) >> 12) & 0xF)
108#define ARM_GIC_ICCIIDR_GET_IMPLEMENTER(IccIidr) ((IccIidr) & 0xFFF)
111#define ARM_GIC_ICCIAR_ACKINTID 0x3FF
116 IN UINTN GicInterruptInterfaceBase
122ArmGicSetupNonSecure (
125 IN UINTN GicInterruptInterfaceBase
130ArmGicSetSecureInterrupts (
132 IN UINTN *GicSecureInterruptMask,
133 IN UINTN GicSecureInterruptMaskSize
138ArmGicEnableInterruptInterface (
139 IN UINTN GicInterruptInterfaceBase
144ArmGicDisableInterruptInterface (
145 IN UINTN GicInterruptInterfaceBase
150ArmGicEnableDistributor (
156ArmGicDisableDistributor (
162ArmGicGetMaxNumInterrupts (
170 IN UINT8 TargetListFilter,
171 IN UINT8 CPUTargetList,
191ArmGicAcknowledgeInterrupt (
192 IN UINTN GicInterruptInterfaceBase,
198ArmGicEndOfInterrupt (
199 IN UINTN GicInterruptInterfaceBase,
205ArmGicSetPriorityMask (
206 IN UINTN GicInterruptInterfaceBase,
212ArmGicSetInterruptPriority (
221ArmGicEnableInterrupt (
229ArmGicDisableInterrupt (
237ArmGicIsInterruptEnabled (
247#define ARM_GIC_IS_SPECIAL_INTERRUPTS(Interrupt) \
248 (((Interrupt) >= 1020) && ((Interrupt) <= 1023))
252ArmGicV2SetupNonSecure (
255 IN UINTN GicInterruptInterfaceBase
260ArmGicV2EnableInterruptInterface (
261 IN UINTN GicInterruptInterfaceBase
266ArmGicV2DisableInterruptInterface (
267 IN UINTN GicInterruptInterfaceBase
272ArmGicV2AcknowledgeInterrupt (
273 IN UINTN GicInterruptInterfaceBase
278ArmGicV2EndOfInterrupt (
279 IN UINTN GicInterruptInterfaceBase,
285#define ICC_SRE_EL2_SRE (1 << 0)
287#define ARM_GICD_IROUTER_IRM BIT31
291ArmGicV3GetControlSystemRegisterEnable (
297ArmGicV3SetControlSystemRegisterEnable (
298 IN UINT32 ControlSystemRegisterEnable
303ArmGicV3EnableInterruptInterface (
309ArmGicV3DisableInterruptInterface (
315ArmGicV3AcknowledgeInterrupt (
321ArmGicV3EndOfInterrupt (
326ArmGicV3SetBinaryPointer (
331ArmGicV3SetPriorityMask (
UINT32 EFIAPI ArmGicGetInterfaceIdentification(IN UINTN GicInterruptInterfaceBase)