blob: 71e4faf33091a114ba666054bc020adaed4a08d5 [file] [log] [blame]
Marc Zyngier021f6532014-06-30 16:01:31 +01001/*
2 * Copyright (C) 2013, 2014 ARM Limited, All Rights Reserved.
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
4 *
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18#ifndef __LINUX_IRQCHIP_ARM_GIC_V3_H
19#define __LINUX_IRQCHIP_ARM_GIC_V3_H
20
Catalin Marinas72c58392014-07-24 14:14:42 +010021#include <asm/sysreg.h>
22
Marc Zyngier021f6532014-06-30 16:01:31 +010023/*
24 * Distributor registers. We assume we're running non-secure, with ARE
25 * being set. Secure-only and non-ARE registers are not described.
26 */
27#define GICD_CTLR 0x0000
28#define GICD_TYPER 0x0004
29#define GICD_IIDR 0x0008
30#define GICD_STATUSR 0x0010
31#define GICD_SETSPI_NSR 0x0040
32#define GICD_CLRSPI_NSR 0x0048
33#define GICD_SETSPI_SR 0x0050
34#define GICD_CLRSPI_SR 0x0058
35#define GICD_SEIR 0x0068
Andre Przywaraa0675c22014-06-07 00:54:51 +020036#define GICD_IGROUPR 0x0080
Marc Zyngier021f6532014-06-30 16:01:31 +010037#define GICD_ISENABLER 0x0100
38#define GICD_ICENABLER 0x0180
39#define GICD_ISPENDR 0x0200
40#define GICD_ICPENDR 0x0280
41#define GICD_ISACTIVER 0x0300
42#define GICD_ICACTIVER 0x0380
43#define GICD_IPRIORITYR 0x0400
44#define GICD_ICFGR 0x0C00
Andre Przywaraa0675c22014-06-07 00:54:51 +020045#define GICD_IGRPMODR 0x0D00
46#define GICD_NSACR 0x0E00
Marc Zyngier021f6532014-06-30 16:01:31 +010047#define GICD_IROUTER 0x6000
Andre Przywaraa0675c22014-06-07 00:54:51 +020048#define GICD_IDREGS 0xFFD0
Marc Zyngier021f6532014-06-30 16:01:31 +010049#define GICD_PIDR2 0xFFE8
50
Andre Przywaraa0675c22014-06-07 00:54:51 +020051/*
52 * Those registers are actually from GICv2, but the spec demands that they
53 * are implemented as RES0 if ARE is 1 (which we do in KVM's emulated GICv3).
54 */
55#define GICD_ITARGETSR 0x0800
56#define GICD_SGIR 0x0F00
57#define GICD_CPENDSGIR 0x0F10
58#define GICD_SPENDSGIR 0x0F20
59
Marc Zyngier021f6532014-06-30 16:01:31 +010060#define GICD_CTLR_RWP (1U << 31)
Andre Przywaraa0675c22014-06-07 00:54:51 +020061#define GICD_CTLR_DS (1U << 6)
Marc Zyngier021f6532014-06-30 16:01:31 +010062#define GICD_CTLR_ARE_NS (1U << 4)
63#define GICD_CTLR_ENABLE_G1A (1U << 1)
64#define GICD_CTLR_ENABLE_G1 (1U << 0)
65
Andre Przywaraa0675c22014-06-07 00:54:51 +020066/*
67 * In systems with a single security state (what we emulate in KVM)
68 * the meaning of the interrupt group enable bits is slightly different
69 */
70#define GICD_CTLR_ENABLE_SS_G1 (1U << 1)
71#define GICD_CTLR_ENABLE_SS_G0 (1U << 0)
72
73#define GICD_TYPER_LPIS (1U << 17)
74#define GICD_TYPER_MBIS (1U << 16)
75
Marc Zyngierf5c14342014-11-24 14:35:10 +000076#define GICD_TYPER_ID_BITS(typer) ((((typer) >> 19) & 0x1f) + 1)
77#define GICD_TYPER_IRQS(typer) ((((typer) & 0x1f) + 1) * 32)
78#define GICD_TYPER_LPIS (1U << 17)
79
Marc Zyngier021f6532014-06-30 16:01:31 +010080#define GICD_IROUTER_SPI_MODE_ONE (0U << 31)
81#define GICD_IROUTER_SPI_MODE_ANY (1U << 31)
82
83#define GIC_PIDR2_ARCH_MASK 0xf0
84#define GIC_PIDR2_ARCH_GICv3 0x30
85#define GIC_PIDR2_ARCH_GICv4 0x40
86
Andre Przywaraa0675c22014-06-07 00:54:51 +020087#define GIC_V3_DIST_SIZE 0x10000
88
Marc Zyngier021f6532014-06-30 16:01:31 +010089/*
90 * Re-Distributor registers, offsets from RD_base
91 */
92#define GICR_CTLR GICD_CTLR
93#define GICR_IIDR 0x0004
94#define GICR_TYPER 0x0008
95#define GICR_STATUSR GICD_STATUSR
96#define GICR_WAKER 0x0014
97#define GICR_SETLPIR 0x0040
98#define GICR_CLRLPIR 0x0048
99#define GICR_SEIR GICD_SEIR
100#define GICR_PROPBASER 0x0070
101#define GICR_PENDBASER 0x0078
102#define GICR_INVLPIR 0x00A0
103#define GICR_INVALLR 0x00B0
104#define GICR_SYNCR 0x00C0
105#define GICR_MOVLPIR 0x0100
106#define GICR_MOVALLR 0x0110
Marc Zyngier0b6a3da2015-08-26 17:00:42 +0100107#define GICR_ISACTIVER GICD_ISACTIVER
108#define GICR_ICACTIVER GICD_ICACTIVER
Andre Przywaraa0675c22014-06-07 00:54:51 +0200109#define GICR_IDREGS GICD_IDREGS
Marc Zyngier021f6532014-06-30 16:01:31 +0100110#define GICR_PIDR2 GICD_PIDR2
111
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000112#define GICR_CTLR_ENABLE_LPIS (1UL << 0)
113
114#define GICR_TYPER_CPU_NUMBER(r) (((r) >> 8) & 0xffff)
115
Marc Zyngier021f6532014-06-30 16:01:31 +0100116#define GICR_WAKER_ProcessorSleep (1U << 1)
117#define GICR_WAKER_ChildrenAsleep (1U << 2)
118
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000119#define GICR_PROPBASER_NonShareable (0U << 10)
120#define GICR_PROPBASER_InnerShareable (1U << 10)
121#define GICR_PROPBASER_OuterShareable (2U << 10)
122#define GICR_PROPBASER_SHAREABILITY_MASK (3UL << 10)
123#define GICR_PROPBASER_nCnB (0U << 7)
124#define GICR_PROPBASER_nC (1U << 7)
125#define GICR_PROPBASER_RaWt (2U << 7)
126#define GICR_PROPBASER_RaWb (3U << 7)
127#define GICR_PROPBASER_WaWt (4U << 7)
128#define GICR_PROPBASER_WaWb (5U << 7)
129#define GICR_PROPBASER_RaWaWt (6U << 7)
130#define GICR_PROPBASER_RaWaWb (7U << 7)
Marc Zyngier241a3862015-03-27 14:15:05 +0000131#define GICR_PROPBASER_CACHEABILITY_MASK (7U << 7)
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000132#define GICR_PROPBASER_IDBITS_MASK (0x1f)
133
Marc Zyngier4ad3e362015-03-27 14:15:04 +0000134#define GICR_PENDBASER_NonShareable (0U << 10)
135#define GICR_PENDBASER_InnerShareable (1U << 10)
136#define GICR_PENDBASER_OuterShareable (2U << 10)
137#define GICR_PENDBASER_SHAREABILITY_MASK (3UL << 10)
138#define GICR_PENDBASER_nCnB (0U << 7)
139#define GICR_PENDBASER_nC (1U << 7)
140#define GICR_PENDBASER_RaWt (2U << 7)
141#define GICR_PENDBASER_RaWb (3U << 7)
142#define GICR_PENDBASER_WaWt (4U << 7)
143#define GICR_PENDBASER_WaWb (5U << 7)
144#define GICR_PENDBASER_RaWaWt (6U << 7)
145#define GICR_PENDBASER_RaWaWb (7U << 7)
Marc Zyngier241a3862015-03-27 14:15:05 +0000146#define GICR_PENDBASER_CACHEABILITY_MASK (7U << 7)
Marc Zyngier4ad3e362015-03-27 14:15:04 +0000147
Marc Zyngier021f6532014-06-30 16:01:31 +0100148/*
149 * Re-Distributor registers, offsets from SGI_base
150 */
Andre Przywaraa0675c22014-06-07 00:54:51 +0200151#define GICR_IGROUPR0 GICD_IGROUPR
Marc Zyngier021f6532014-06-30 16:01:31 +0100152#define GICR_ISENABLER0 GICD_ISENABLER
153#define GICR_ICENABLER0 GICD_ICENABLER
154#define GICR_ISPENDR0 GICD_ISPENDR
155#define GICR_ICPENDR0 GICD_ICPENDR
156#define GICR_ISACTIVER0 GICD_ISACTIVER
157#define GICR_ICACTIVER0 GICD_ICACTIVER
158#define GICR_IPRIORITYR0 GICD_IPRIORITYR
159#define GICR_ICFGR0 GICD_ICFGR
Andre Przywaraa0675c22014-06-07 00:54:51 +0200160#define GICR_IGRPMODR0 GICD_IGRPMODR
161#define GICR_NSACR GICD_NSACR
Marc Zyngier021f6532014-06-30 16:01:31 +0100162
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000163#define GICR_TYPER_PLPIS (1U << 0)
Marc Zyngier021f6532014-06-30 16:01:31 +0100164#define GICR_TYPER_VLPIS (1U << 1)
165#define GICR_TYPER_LAST (1U << 4)
166
Andre Przywaraa0675c22014-06-07 00:54:51 +0200167#define GIC_V3_REDIST_SIZE 0x20000
168
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000169#define LPI_PROP_GROUP1 (1 << 1)
170#define LPI_PROP_ENABLED (1 << 0)
171
172/*
173 * ITS registers, offsets from ITS_base
174 */
175#define GITS_CTLR 0x0000
176#define GITS_IIDR 0x0004
177#define GITS_TYPER 0x0008
178#define GITS_CBASER 0x0080
179#define GITS_CWRITER 0x0088
180#define GITS_CREADR 0x0090
181#define GITS_BASER 0x0100
182#define GITS_PIDR2 GICR_PIDR2
183
184#define GITS_TRANSLATER 0x10040
185
Yun Wu7cb99112015-03-06 16:37:49 +0000186#define GITS_CTLR_ENABLE (1U << 0)
187#define GITS_CTLR_QUIESCENT (1U << 31)
188
Marc Zyngierf54b97e2015-03-06 16:37:41 +0000189#define GITS_TYPER_DEVBITS_SHIFT 13
190#define GITS_TYPER_DEVBITS(r) ((((r) >> GITS_TYPER_DEVBITS_SHIFT) & 0x1f) + 1)
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000191#define GITS_TYPER_PTA (1UL << 19)
192
193#define GITS_CBASER_VALID (1UL << 63)
194#define GITS_CBASER_nCnB (0UL << 59)
195#define GITS_CBASER_nC (1UL << 59)
196#define GITS_CBASER_RaWt (2UL << 59)
197#define GITS_CBASER_RaWb (3UL << 59)
198#define GITS_CBASER_WaWt (4UL << 59)
199#define GITS_CBASER_WaWb (5UL << 59)
200#define GITS_CBASER_RaWaWt (6UL << 59)
201#define GITS_CBASER_RaWaWb (7UL << 59)
Marc Zyngier241a3862015-03-27 14:15:05 +0000202#define GITS_CBASER_CACHEABILITY_MASK (7UL << 59)
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000203#define GITS_CBASER_NonShareable (0UL << 10)
204#define GITS_CBASER_InnerShareable (1UL << 10)
205#define GITS_CBASER_OuterShareable (2UL << 10)
206#define GITS_CBASER_SHAREABILITY_MASK (3UL << 10)
207
208#define GITS_BASER_NR_REGS 8
209
210#define GITS_BASER_VALID (1UL << 63)
211#define GITS_BASER_nCnB (0UL << 59)
212#define GITS_BASER_nC (1UL << 59)
213#define GITS_BASER_RaWt (2UL << 59)
214#define GITS_BASER_RaWb (3UL << 59)
215#define GITS_BASER_WaWt (4UL << 59)
216#define GITS_BASER_WaWb (5UL << 59)
217#define GITS_BASER_RaWaWt (6UL << 59)
218#define GITS_BASER_RaWaWb (7UL << 59)
Marc Zyngier241a3862015-03-27 14:15:05 +0000219#define GITS_BASER_CACHEABILITY_MASK (7UL << 59)
Marc Zyngiercc2d3212014-11-24 14:35:11 +0000220#define GITS_BASER_TYPE_SHIFT (56)
221#define GITS_BASER_TYPE(r) (((r) >> GITS_BASER_TYPE_SHIFT) & 7)
222#define GITS_BASER_ENTRY_SIZE_SHIFT (48)
223#define GITS_BASER_ENTRY_SIZE(r) ((((r) >> GITS_BASER_ENTRY_SIZE_SHIFT) & 0xff) + 1)
224#define GITS_BASER_NonShareable (0UL << 10)
225#define GITS_BASER_InnerShareable (1UL << 10)
226#define GITS_BASER_OuterShareable (2UL << 10)
227#define GITS_BASER_SHAREABILITY_SHIFT (10)
228#define GITS_BASER_SHAREABILITY_MASK (3UL << GITS_BASER_SHAREABILITY_SHIFT)
229#define GITS_BASER_PAGE_SIZE_SHIFT (8)
230#define GITS_BASER_PAGE_SIZE_4K (0UL << GITS_BASER_PAGE_SIZE_SHIFT)
231#define GITS_BASER_PAGE_SIZE_16K (1UL << GITS_BASER_PAGE_SIZE_SHIFT)
232#define GITS_BASER_PAGE_SIZE_64K (2UL << GITS_BASER_PAGE_SIZE_SHIFT)
233#define GITS_BASER_PAGE_SIZE_MASK (3UL << GITS_BASER_PAGE_SIZE_SHIFT)
234
235#define GITS_BASER_TYPE_NONE 0
236#define GITS_BASER_TYPE_DEVICE 1
237#define GITS_BASER_TYPE_VCPU 2
238#define GITS_BASER_TYPE_CPU 3
239#define GITS_BASER_TYPE_COLLECTION 4
240#define GITS_BASER_TYPE_RESERVED5 5
241#define GITS_BASER_TYPE_RESERVED6 6
242#define GITS_BASER_TYPE_RESERVED7 7
243
244/*
245 * ITS commands
246 */
247#define GITS_CMD_MAPD 0x08
248#define GITS_CMD_MAPC 0x09
249#define GITS_CMD_MAPVI 0x0a
250#define GITS_CMD_MOVI 0x01
251#define GITS_CMD_DISCARD 0x0f
252#define GITS_CMD_INV 0x0c
253#define GITS_CMD_MOVALL 0x0e
254#define GITS_CMD_INVALL 0x0d
255#define GITS_CMD_INT 0x03
256#define GITS_CMD_CLEAR 0x04
257#define GITS_CMD_SYNC 0x05
258
Marc Zyngier021f6532014-06-30 16:01:31 +0100259/*
260 * CPU interface registers
261 */
262#define ICC_CTLR_EL1_EOImode_drop_dir (0U << 1)
263#define ICC_CTLR_EL1_EOImode_drop (1U << 1)
264#define ICC_SRE_EL1_SRE (1U << 0)
265
266/*
267 * Hypervisor interface registers (SRE only)
268 */
269#define ICH_LR_VIRTUAL_ID_MASK ((1UL << 32) - 1)
270
271#define ICH_LR_EOI (1UL << 41)
272#define ICH_LR_GROUP (1UL << 60)
273#define ICH_LR_STATE (3UL << 62)
274#define ICH_LR_PENDING_BIT (1UL << 62)
275#define ICH_LR_ACTIVE_BIT (1UL << 63)
276
277#define ICH_MISR_EOI (1 << 0)
278#define ICH_MISR_U (1 << 1)
279
280#define ICH_HCR_EN (1 << 0)
281#define ICH_HCR_UIE (1 << 1)
282
283#define ICH_VMCR_CTLR_SHIFT 0
284#define ICH_VMCR_CTLR_MASK (0x21f << ICH_VMCR_CTLR_SHIFT)
285#define ICH_VMCR_BPR1_SHIFT 18
286#define ICH_VMCR_BPR1_MASK (7 << ICH_VMCR_BPR1_SHIFT)
287#define ICH_VMCR_BPR0_SHIFT 21
288#define ICH_VMCR_BPR0_MASK (7 << ICH_VMCR_BPR0_SHIFT)
289#define ICH_VMCR_PMR_SHIFT 24
290#define ICH_VMCR_PMR_MASK (0xffUL << ICH_VMCR_PMR_SHIFT)
291
Catalin Marinas72c58392014-07-24 14:14:42 +0100292#define ICC_EOIR1_EL1 sys_reg(3, 0, 12, 12, 1)
Marc Zyngier0b6a3da2015-08-26 17:00:42 +0100293#define ICC_DIR_EL1 sys_reg(3, 0, 12, 11, 1)
Catalin Marinas72c58392014-07-24 14:14:42 +0100294#define ICC_IAR1_EL1 sys_reg(3, 0, 12, 12, 0)
295#define ICC_SGI1R_EL1 sys_reg(3, 0, 12, 11, 5)
296#define ICC_PMR_EL1 sys_reg(3, 0, 4, 6, 0)
297#define ICC_CTLR_EL1 sys_reg(3, 0, 12, 12, 4)
298#define ICC_SRE_EL1 sys_reg(3, 0, 12, 12, 5)
299#define ICC_GRPEN1_EL1 sys_reg(3, 0, 12, 12, 7)
Marc Zyngier021f6532014-06-30 16:01:31 +0100300
301#define ICC_IAR1_EL1_SPURIOUS 0x3ff
302
Catalin Marinas72c58392014-07-24 14:14:42 +0100303#define ICC_SRE_EL2 sys_reg(3, 4, 12, 9, 5)
Marc Zyngier021f6532014-06-30 16:01:31 +0100304
305#define ICC_SRE_EL2_SRE (1 << 0)
306#define ICC_SRE_EL2_ENABLE (1 << 3)
307
Andre Przywara7e580272014-11-12 13:46:06 +0000308#define ICC_SGI1R_TARGET_LIST_SHIFT 0
309#define ICC_SGI1R_TARGET_LIST_MASK (0xffff << ICC_SGI1R_TARGET_LIST_SHIFT)
310#define ICC_SGI1R_AFFINITY_1_SHIFT 16
311#define ICC_SGI1R_AFFINITY_1_MASK (0xff << ICC_SGI1R_AFFINITY_1_SHIFT)
312#define ICC_SGI1R_SGI_ID_SHIFT 24
313#define ICC_SGI1R_SGI_ID_MASK (0xff << ICC_SGI1R_SGI_ID_SHIFT)
314#define ICC_SGI1R_AFFINITY_2_SHIFT 32
315#define ICC_SGI1R_AFFINITY_2_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT)
316#define ICC_SGI1R_IRQ_ROUTING_MODE_BIT 40
317#define ICC_SGI1R_AFFINITY_3_SHIFT 48
318#define ICC_SGI1R_AFFINITY_3_MASK (0xffULL << ICC_SGI1R_AFFINITY_1_SHIFT)
319
Marc Zyngier021f6532014-06-30 16:01:31 +0100320/*
321 * System register definitions
322 */
Catalin Marinas72c58392014-07-24 14:14:42 +0100323#define ICH_VSEIR_EL2 sys_reg(3, 4, 12, 9, 4)
324#define ICH_HCR_EL2 sys_reg(3, 4, 12, 11, 0)
325#define ICH_VTR_EL2 sys_reg(3, 4, 12, 11, 1)
326#define ICH_MISR_EL2 sys_reg(3, 4, 12, 11, 2)
327#define ICH_EISR_EL2 sys_reg(3, 4, 12, 11, 3)
328#define ICH_ELSR_EL2 sys_reg(3, 4, 12, 11, 5)
329#define ICH_VMCR_EL2 sys_reg(3, 4, 12, 11, 7)
Marc Zyngier021f6532014-06-30 16:01:31 +0100330
Catalin Marinas72c58392014-07-24 14:14:42 +0100331#define __LR0_EL2(x) sys_reg(3, 4, 12, 12, x)
332#define __LR8_EL2(x) sys_reg(3, 4, 12, 13, x)
Marc Zyngier021f6532014-06-30 16:01:31 +0100333
334#define ICH_LR0_EL2 __LR0_EL2(0)
335#define ICH_LR1_EL2 __LR0_EL2(1)
336#define ICH_LR2_EL2 __LR0_EL2(2)
337#define ICH_LR3_EL2 __LR0_EL2(3)
338#define ICH_LR4_EL2 __LR0_EL2(4)
339#define ICH_LR5_EL2 __LR0_EL2(5)
340#define ICH_LR6_EL2 __LR0_EL2(6)
341#define ICH_LR7_EL2 __LR0_EL2(7)
342#define ICH_LR8_EL2 __LR8_EL2(0)
343#define ICH_LR9_EL2 __LR8_EL2(1)
344#define ICH_LR10_EL2 __LR8_EL2(2)
345#define ICH_LR11_EL2 __LR8_EL2(3)
346#define ICH_LR12_EL2 __LR8_EL2(4)
347#define ICH_LR13_EL2 __LR8_EL2(5)
348#define ICH_LR14_EL2 __LR8_EL2(6)
349#define ICH_LR15_EL2 __LR8_EL2(7)
350
Catalin Marinas72c58392014-07-24 14:14:42 +0100351#define __AP0Rx_EL2(x) sys_reg(3, 4, 12, 8, x)
Marc Zyngier021f6532014-06-30 16:01:31 +0100352#define ICH_AP0R0_EL2 __AP0Rx_EL2(0)
353#define ICH_AP0R1_EL2 __AP0Rx_EL2(1)
354#define ICH_AP0R2_EL2 __AP0Rx_EL2(2)
355#define ICH_AP0R3_EL2 __AP0Rx_EL2(3)
356
Catalin Marinas72c58392014-07-24 14:14:42 +0100357#define __AP1Rx_EL2(x) sys_reg(3, 4, 12, 9, x)
Marc Zyngier021f6532014-06-30 16:01:31 +0100358#define ICH_AP1R0_EL2 __AP1Rx_EL2(0)
359#define ICH_AP1R1_EL2 __AP1Rx_EL2(1)
360#define ICH_AP1R2_EL2 __AP1Rx_EL2(2)
361#define ICH_AP1R3_EL2 __AP1Rx_EL2(3)
362
363#ifndef __ASSEMBLY__
364
365#include <linux/stringify.h>
Marc Zyngierf1304202015-07-28 14:46:18 +0100366#include <asm/msi.h>
Marc Zyngier021f6532014-06-30 16:01:31 +0100367
Marc Zyngierb48ac832014-11-24 14:35:16 +0000368/*
369 * We need a value to serve as a irq-type for LPIs. Choose one that will
370 * hopefully pique the interest of the reviewer.
371 */
372#define GIC_IRQ_TYPE_LPI 0xa110c8ed
373
Marc Zyngierf5c14342014-11-24 14:35:10 +0000374struct rdists {
375 struct {
376 void __iomem *rd_base;
377 struct page *pend_page;
378 phys_addr_t phys_base;
379 } __percpu *rdist;
380 struct page *prop_page;
381 int id_bits;
382 u64 flags;
383};
384
Marc Zyngier021f6532014-06-30 16:01:31 +0100385static inline void gic_write_eoir(u64 irq)
386{
Catalin Marinas72c58392014-07-24 14:14:42 +0100387 asm volatile("msr_s " __stringify(ICC_EOIR1_EL1) ", %0" : : "r" (irq));
Marc Zyngier021f6532014-06-30 16:01:31 +0100388 isb();
389}
390
Marc Zyngier0b6a3da2015-08-26 17:00:42 +0100391static inline void gic_write_dir(u64 irq)
392{
393 asm volatile("msr_s " __stringify(ICC_DIR_EL1) ", %0" : : "r" (irq));
394 isb();
395}
396
Marc Zyngierda33f312014-11-24 14:35:18 +0000397struct irq_domain;
398int its_cpu_init(void);
399int its_init(struct device_node *node, struct rdists *rdists,
400 struct irq_domain *domain);
401
Marc Zyngier021f6532014-06-30 16:01:31 +0100402#endif
403
404#endif