]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Include/Library/ArmGicLib.h
ArmPkg/ArmGic: Move out the EndOfInterrupt from the interrupt acknowledgement
[mirror_edk2.git] / ArmPkg / Include / Library / ArmGicLib.h
CommitLineData
55a0d64b 1/** @file\r
2*\r
1cb13673 3* Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
55a0d64b 4*\r
1cb13673
OM
5* This program and the accompanying materials\r
6* are licensed and made available under the terms and conditions of the BSD License\r
7* which accompanies this distribution. The full text of the license may be found at\r
8* http://opensource.org/licenses/bsd-license.php\r
9*\r
10* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
55a0d64b 12*\r
13**/\r
14\r
017baa1c
OM
15#ifndef __ARMGIC_H\r
16#define __ARMGIC_H\r
55a0d64b 17\r
18//\r
19// GIC definitions\r
20//\r
21\r
22//\r
23// GIC Distributor\r
24//\r
25#define ARM_GIC_ICDDCR 0x000 // Distributor Control Register\r
26#define ARM_GIC_ICDICTR 0x004 // Interrupt Controller Type Register\r
27#define ARM_GIC_ICDIIDR 0x008 // Implementer Identification Register\r
28\r
29// Each reg base below repeats for VE_NUM_ARM_GIC_REG_PER_INT_BITS (see GIC spec)\r
30#define ARM_GIC_ICDISR 0x080 // Interrupt Security Registers\r
31#define ARM_GIC_ICDISER 0x100 // Interrupt Set-Enable Registers\r
32#define ARM_GIC_ICDICER 0x180 // Interrupt Clear-Enable Registers\r
33#define ARM_GIC_ICDSPR 0x200 // Interrupt Set-Pending Registers\r
34#define ARM_GIC_ICDICPR 0x280 // Interrupt Clear-Pending Registers\r
35#define ARM_GIC_ICDABR 0x300 // Active Bit Registers\r
36\r
37// Each reg base below repeats for VE_NUM_ARM_GIC_REG_PER_INT_BYTES\r
38#define ARM_GIC_ICDIPR 0x400 // Interrupt Priority Registers\r
39\r
40// Each reg base below repeats for VE_NUM_ARM_GIC_INTERRUPTS\r
41#define ARM_GIC_ICDIPTR 0x800 // Interrupt Processor Target Registers\r
42#define ARM_GIC_ICDICFR 0xC00 // Interrupt Configuration Registers\r
43\r
44#define ARM_GIC_ICDPPISR 0xD00 // PPI Status register\r
45\r
46// just one of these\r
47#define ARM_GIC_ICDSGIR 0xF00 // Software Generated Interrupt Register\r
48\r
49//\r
50// GIC Cpu interface\r
51//\r
52#define ARM_GIC_ICCICR 0x00 // CPU Interface Control Register\r
53#define ARM_GIC_ICCPMR 0x04 // Interrupt Priority Mask Register\r
54#define ARM_GIC_ICCBPR 0x08 // Binary Point Register\r
55#define ARM_GIC_ICCIAR 0x0C // Interrupt Acknowledge Register\r
56#define ARM_GIC_ICCEIOR 0x10 // End Of Interrupt Register\r
57#define ARM_GIC_ICCRPR 0x14 // Running Priority Register\r
58#define ARM_GIC_ICCPIR 0x18 // Highest Pending Interrupt Register\r
59#define ARM_GIC_ICCABPR 0x1C // Aliased Binary Point Register\r
60#define ARM_GIC_ICCIDR 0xFC // Identification Register\r
61\r
62#define ARM_GIC_ICDSGIR_FILTER_TARGETLIST 0x0\r
63#define ARM_GIC_ICDSGIR_FILTER_EVERYONEELSE 0x1\r
64#define ARM_GIC_ICDSGIR_FILTER_ITSELF 0x2\r
65\r
66// Bit-masks to configure the CPU Interface Control register\r
67#define ARM_GIC_ICCICR_ENABLE_SECURE 0x01\r
68#define ARM_GIC_ICCICR_ENABLE_NS 0x02\r
69#define ARM_GIC_ICCICR_ACK_CTL 0x04\r
70#define ARM_GIC_ICCICR_SIGNAL_SECURE_TO_FIQ 0x08\r
71#define ARM_GIC_ICCICR_USE_SBPR 0x10\r
72\r
1cb13673
OM
73// Bit Mask for GICC_IIDR\r
74#define ARM_GIC_ICCIDR_GET_PRODUCT_ID(IccIdr) (((IccIdr) >> 20) & 0xFFF)\r
75#define ARM_GIC_ICCIDR_GET_ARCH_VERSION(IccIdr) (((IccIdr) >> 16) & 0xF)\r
76#define ARM_GIC_ICCIDR_GET_REVISION(IccIdr) (((IccIdr) >> 12) & 0xF)\r
77#define ARM_GIC_ICCIDR_GET_IMPLEMENTER(IccIdr) ((IccIdr) & 0xFFF)\r
55a0d64b 78\r
2ca815a4
OM
79// Bit Mask for\r
80#define ARM_GIC_ICCIAR_ACKINTID 0x3FF\r
81\r
55a0d64b 82//\r
92534106 83// GIC Secure interfaces\r
55a0d64b 84//\r
85VOID\r
86EFIAPI\r
87ArmGicSetupNonSecure (\r
5e773144 88 IN UINTN MpId,\r
55a0d64b 89 IN INTN GicDistributorBase,\r
90 IN INTN GicInterruptInterfaceBase\r
91 );\r
92\r
92534106 93VOID\r
94EFIAPI\r
95ArmGicSetSecureInterrupts (\r
96 IN UINTN GicDistributorBase,\r
97 IN UINTN* GicSecureInterruptMask,\r
98 IN UINTN GicSecureInterruptMaskSize\r
99 );\r
100\r
55a0d64b 101VOID\r
102EFIAPI\r
103ArmGicEnableInterruptInterface (\r
104 IN INTN GicInterruptInterfaceBase\r
105 );\r
106\r
9736c297 107VOID\r
108EFIAPI\r
109ArmGicDisableInterruptInterface (\r
110 IN INTN GicInterruptInterfaceBase\r
111 );\r
112\r
55a0d64b 113VOID\r
114EFIAPI\r
115ArmGicEnableDistributor (\r
116 IN INTN GicDistributorBase\r
117 );\r
118\r
e9f7c58f 119UINTN\r
120EFIAPI\r
121ArmGicGetMaxNumInterrupts (\r
122 IN INTN GicDistributorBase\r
123 );\r
124\r
55a0d64b 125VOID\r
126EFIAPI\r
127ArmGicSendSgiTo (\r
128 IN INTN GicDistributorBase,\r
129 IN INTN TargetListFilter,\r
4c19ece3 130 IN INTN CPUTargetList,\r
131 IN INTN SgiId\r
55a0d64b 132 );\r
133\r
2ca815a4 134UINTN\r
55a0d64b 135EFIAPI\r
315649cd 136ArmGicAcknowledgeInterrupt (\r
2ca815a4 137 IN UINTN GicInterruptInterfaceBase\r
55a0d64b 138 );\r
139\r
d80401a1
OM
140VOID\r
141EFIAPI\r
142ArmGicEndOfInterrupt (\r
143 IN UINTN GicInterruptInterfaceBase,\r
144 IN UINTN Source\r
145 );\r
146\r
55a0d64b 147UINTN\r
148EFIAPI\r
149ArmGicSetPriorityMask (\r
150 IN INTN GicInterruptInterfaceBase,\r
151 IN INTN PriorityMask\r
152 );\r
153\r
154#endif\r