blob: cfbf907ebfa552f22c0dc24089007265114ebf71 [file] [log] [blame]
Ralf Baechle39b8d522008-04-28 17:14:26 +01001/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000, 07 MIPS Technologies, Inc.
7 *
8 * GIC Register Definitions
9 *
10 */
11#ifndef _ASM_GICREGS_H
12#define _ASM_GICREGS_H
13
Paul Burton6d9727a2014-01-15 10:31:48 +000014#include <linux/bitmap.h>
15#include <linux/threads.h>
16
Jeffrey Deansc9750482014-07-17 09:20:54 +010017#include <irq.h>
18
Ralf Baechle39b8d522008-04-28 17:14:26 +010019#undef GICISBYTELITTLEENDIAN
Ralf Baechle39b8d522008-04-28 17:14:26 +010020
21/* Constants */
22#define GIC_POL_POS 1
23#define GIC_POL_NEG 0
24#define GIC_TRIG_EDGE 1
25#define GIC_TRIG_LEVEL 0
Andrew Bresticker95150ae2014-09-18 14:47:21 -070026#define GIC_TRIG_DUAL_ENABLE 1
27#define GIC_TRIG_DUAL_DISABLE 0
Ralf Baechle39b8d522008-04-28 17:14:26 +010028
Ralf Baechle39b8d522008-04-28 17:14:26 +010029#define MSK(n) ((1 << (n)) - 1)
30#define REG32(addr) (*(volatile unsigned int *) (addr))
Thomas Bogendoerfer938b2b12008-05-29 22:05:07 +020031#define REG(base, offs) REG32((unsigned long)(base) + offs##_##OFS)
32#define REGP(base, phys) REG32((unsigned long)(base) + (phys))
Ralf Baechle39b8d522008-04-28 17:14:26 +010033
34/* Accessors */
35#define GIC_REG(segment, offset) \
36 REG32(_gic_base + segment##_##SECTION_OFS + offset##_##OFS)
37#define GIC_REG_ADDR(segment, offset) \
38 REG32(_gic_base + segment##_##SECTION_OFS + offset)
39
40#define GIC_ABS_REG(segment, offset) \
Steven J. Hill2299c492012-08-31 16:13:07 -050041 (_gic_base + segment##_##SECTION_OFS + offset##_##OFS)
Ralf Baechle39b8d522008-04-28 17:14:26 +010042#define GIC_REG_ABS_ADDR(segment, offset) \
Steven J. Hill2299c492012-08-31 16:13:07 -050043 (_gic_base + segment##_##SECTION_OFS + offset)
Ralf Baechle39b8d522008-04-28 17:14:26 +010044
45#ifdef GICISBYTELITTLEENDIAN
Steven J. Hill2299c492012-08-31 16:13:07 -050046#define GICREAD(reg, data) ((data) = (reg), (data) = le32_to_cpu(data))
47#define GICWRITE(reg, data) ((reg) = cpu_to_le32(data))
Ralf Baechle39b8d522008-04-28 17:14:26 +010048#else
Steven J. Hill2299c492012-08-31 16:13:07 -050049#define GICREAD(reg, data) ((data) = (reg))
50#define GICWRITE(reg, data) ((reg) = (data))
Ralf Baechle39b8d522008-04-28 17:14:26 +010051#endif
Jeffrey Deansc55b2852014-07-17 09:20:59 +010052#define GICBIS(reg, mask, bits) \
53 do { u32 data; \
Ralf Baechlef28ff3d2014-08-08 15:09:40 +020054 GICREAD(reg, data); \
Jeffrey Deansc55b2852014-07-17 09:20:59 +010055 data &= ~(mask); \
56 data |= ((bits) & (mask)); \
57 GICWRITE((reg), data); \
58 } while (0)
Ralf Baechle39b8d522008-04-28 17:14:26 +010059
60
61/* GIC Address Space */
62#define SHARED_SECTION_OFS 0x0000
63#define SHARED_SECTION_SIZE 0x8000
64#define VPE_LOCAL_SECTION_OFS 0x8000
65#define VPE_LOCAL_SECTION_SIZE 0x4000
66#define VPE_OTHER_SECTION_OFS 0xc000
67#define VPE_OTHER_SECTION_SIZE 0x4000
68#define USM_VISIBLE_SECTION_OFS 0x10000
69#define USM_VISIBLE_SECTION_SIZE 0x10000
70
71/* Register Map for Shared Section */
Ralf Baechle39b8d522008-04-28 17:14:26 +010072
Ralf Baechle70342282013-01-22 12:59:30 +010073#define GIC_SH_CONFIG_OFS 0x0000
Ralf Baechle39b8d522008-04-28 17:14:26 +010074
75/* Shared Global Counter */
76#define GIC_SH_COUNTER_31_00_OFS 0x0010
77#define GIC_SH_COUNTER_63_32_OFS 0x0014
Chris Dearman7098f742009-07-10 01:54:09 -070078#define GIC_SH_REVISIONID_OFS 0x0020
Ralf Baechle39b8d522008-04-28 17:14:26 +010079
80/* Interrupt Polarity */
81#define GIC_SH_POL_31_0_OFS 0x0100
82#define GIC_SH_POL_63_32_OFS 0x0104
83#define GIC_SH_POL_95_64_OFS 0x0108
84#define GIC_SH_POL_127_96_OFS 0x010c
85#define GIC_SH_POL_159_128_OFS 0x0110
86#define GIC_SH_POL_191_160_OFS 0x0114
87#define GIC_SH_POL_223_192_OFS 0x0118
88#define GIC_SH_POL_255_224_OFS 0x011c
89
90/* Edge/Level Triggering */
91#define GIC_SH_TRIG_31_0_OFS 0x0180
92#define GIC_SH_TRIG_63_32_OFS 0x0184
93#define GIC_SH_TRIG_95_64_OFS 0x0188
94#define GIC_SH_TRIG_127_96_OFS 0x018c
95#define GIC_SH_TRIG_159_128_OFS 0x0190
96#define GIC_SH_TRIG_191_160_OFS 0x0194
97#define GIC_SH_TRIG_223_192_OFS 0x0198
98#define GIC_SH_TRIG_255_224_OFS 0x019c
99
100/* Dual Edge Triggering */
101#define GIC_SH_DUAL_31_0_OFS 0x0200
102#define GIC_SH_DUAL_63_32_OFS 0x0204
103#define GIC_SH_DUAL_95_64_OFS 0x0208
104#define GIC_SH_DUAL_127_96_OFS 0x020c
105#define GIC_SH_DUAL_159_128_OFS 0x0210
106#define GIC_SH_DUAL_191_160_OFS 0x0214
107#define GIC_SH_DUAL_223_192_OFS 0x0218
108#define GIC_SH_DUAL_255_224_OFS 0x021c
109
110/* Set/Clear corresponding bit in Edge Detect Register */
111#define GIC_SH_WEDGE_OFS 0x0280
112
113/* Reset Mask - Disables Interrupt */
114#define GIC_SH_RMASK_31_0_OFS 0x0300
115#define GIC_SH_RMASK_63_32_OFS 0x0304
116#define GIC_SH_RMASK_95_64_OFS 0x0308
117#define GIC_SH_RMASK_127_96_OFS 0x030c
118#define GIC_SH_RMASK_159_128_OFS 0x0310
119#define GIC_SH_RMASK_191_160_OFS 0x0314
120#define GIC_SH_RMASK_223_192_OFS 0x0318
121#define GIC_SH_RMASK_255_224_OFS 0x031c
122
123/* Set Mask (WO) - Enables Interrupt */
124#define GIC_SH_SMASK_31_0_OFS 0x0380
125#define GIC_SH_SMASK_63_32_OFS 0x0384
126#define GIC_SH_SMASK_95_64_OFS 0x0388
127#define GIC_SH_SMASK_127_96_OFS 0x038c
128#define GIC_SH_SMASK_159_128_OFS 0x0390
129#define GIC_SH_SMASK_191_160_OFS 0x0394
130#define GIC_SH_SMASK_223_192_OFS 0x0398
131#define GIC_SH_SMASK_255_224_OFS 0x039c
132
133/* Global Interrupt Mask Register (RO) - Bit Set == Interrupt enabled */
134#define GIC_SH_MASK_31_0_OFS 0x0400
135#define GIC_SH_MASK_63_32_OFS 0x0404
136#define GIC_SH_MASK_95_64_OFS 0x0408
137#define GIC_SH_MASK_127_96_OFS 0x040c
138#define GIC_SH_MASK_159_128_OFS 0x0410
139#define GIC_SH_MASK_191_160_OFS 0x0414
140#define GIC_SH_MASK_223_192_OFS 0x0418
141#define GIC_SH_MASK_255_224_OFS 0x041c
142
143/* Pending Global Interrupts (RO) */
144#define GIC_SH_PEND_31_0_OFS 0x0480
145#define GIC_SH_PEND_63_32_OFS 0x0484
146#define GIC_SH_PEND_95_64_OFS 0x0488
147#define GIC_SH_PEND_127_96_OFS 0x048c
148#define GIC_SH_PEND_159_128_OFS 0x0490
149#define GIC_SH_PEND_191_160_OFS 0x0494
150#define GIC_SH_PEND_223_192_OFS 0x0498
151#define GIC_SH_PEND_255_224_OFS 0x049c
152
Ralf Baechle70342282013-01-22 12:59:30 +0100153#define GIC_SH_INTR_MAP_TO_PIN_BASE_OFS 0x0500
Ralf Baechle39b8d522008-04-28 17:14:26 +0100154
155/* Maps Interrupt X to a Pin */
156#define GIC_SH_MAP_TO_PIN(intr) \
157 (GIC_SH_INTR_MAP_TO_PIN_BASE_OFS + (4 * intr))
158
Ralf Baechle70342282013-01-22 12:59:30 +0100159#define GIC_SH_INTR_MAP_TO_VPE_BASE_OFS 0x2000
Ralf Baechle39b8d522008-04-28 17:14:26 +0100160
161/* Maps Interrupt X to a VPE */
162#define GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe) \
163 (GIC_SH_INTR_MAP_TO_VPE_BASE_OFS + (32 * (intr)) + (((vpe) / 32) * 4))
164#define GIC_SH_MAP_TO_VPE_REG_BIT(vpe) (1 << ((vpe) % 32))
165
Chris Dearman7098f742009-07-10 01:54:09 -0700166/* Convert an interrupt number to a byte offset/bit for multi-word registers */
167#define GIC_INTR_OFS(intr) (((intr) / 32)*4)
168#define GIC_INTR_BIT(intr) ((intr) % 32)
169
Ralf Baechle39b8d522008-04-28 17:14:26 +0100170/* Polarity : Reset Value is always 0 */
171#define GIC_SH_SET_POLARITY_OFS 0x0100
172#define GIC_SET_POLARITY(intr, pol) \
Chris Dearman7098f742009-07-10 01:54:09 -0700173 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_POLARITY_OFS + \
Jeffrey Deansc55b2852014-07-17 09:20:59 +0100174 GIC_INTR_OFS(intr)), (1 << GIC_INTR_BIT(intr)), \
175 (pol) << GIC_INTR_BIT(intr))
Ralf Baechle39b8d522008-04-28 17:14:26 +0100176
177/* Triggering : Reset Value is always 0 */
178#define GIC_SH_SET_TRIGGER_OFS 0x0180
179#define GIC_SET_TRIGGER(intr, trig) \
Chris Dearman7098f742009-07-10 01:54:09 -0700180 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_TRIGGER_OFS + \
Jeffrey Deansc55b2852014-07-17 09:20:59 +0100181 GIC_INTR_OFS(intr)), (1 << GIC_INTR_BIT(intr)), \
182 (trig) << GIC_INTR_BIT(intr))
Ralf Baechle39b8d522008-04-28 17:14:26 +0100183
Andrew Bresticker95150ae2014-09-18 14:47:21 -0700184/* Dual edge triggering : Reset Value is always 0 */
185#define GIC_SH_SET_DUAL_OFS 0x0200
186#define GIC_SET_DUAL(intr, dual) \
187 GICBIS(GIC_REG_ADDR(SHARED, GIC_SH_SET_DUAL_OFS + \
188 GIC_INTR_OFS(intr)), (1 << GIC_INTR_BIT(intr)), \
189 (dual) << GIC_INTR_BIT(intr))
190
Ralf Baechle39b8d522008-04-28 17:14:26 +0100191/* Mask manipulation */
192#define GIC_SH_SMASK_OFS 0x0380
Chris Dearman7098f742009-07-10 01:54:09 -0700193#define GIC_SET_INTR_MASK(intr) \
194 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_SMASK_OFS + \
195 GIC_INTR_OFS(intr)), 1 << GIC_INTR_BIT(intr))
Ralf Baechle39b8d522008-04-28 17:14:26 +0100196#define GIC_SH_RMASK_OFS 0x0300
Chris Dearman7098f742009-07-10 01:54:09 -0700197#define GIC_CLR_INTR_MASK(intr) \
198 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + \
199 GIC_INTR_OFS(intr)), 1 << GIC_INTR_BIT(intr))
Ralf Baechle39b8d522008-04-28 17:14:26 +0100200
201/* Register Map for Local Section */
202#define GIC_VPE_CTL_OFS 0x0000
203#define GIC_VPE_PEND_OFS 0x0004
204#define GIC_VPE_MASK_OFS 0x0008
205#define GIC_VPE_RMASK_OFS 0x000c
206#define GIC_VPE_SMASK_OFS 0x0010
207#define GIC_VPE_WD_MAP_OFS 0x0040
208#define GIC_VPE_COMPARE_MAP_OFS 0x0044
209#define GIC_VPE_TIMER_MAP_OFS 0x0048
210#define GIC_VPE_PERFCTR_MAP_OFS 0x0050
211#define GIC_VPE_SWINT0_MAP_OFS 0x0054
212#define GIC_VPE_SWINT1_MAP_OFS 0x0058
213#define GIC_VPE_OTHER_ADDR_OFS 0x0080
214#define GIC_VPE_WD_CONFIG0_OFS 0x0090
215#define GIC_VPE_WD_COUNT0_OFS 0x0094
216#define GIC_VPE_WD_INITIAL0_OFS 0x0098
217#define GIC_VPE_COMPARE_LO_OFS 0x00a0
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -0500218#define GIC_VPE_COMPARE_HI_OFS 0x00a4
Ralf Baechle39b8d522008-04-28 17:14:26 +0100219
220#define GIC_VPE_EIC_SHADOW_SET_BASE 0x0100
221#define GIC_VPE_EIC_SS(intr) \
Steven J. Hillf0b77f22012-07-06 23:56:00 +0200222 (GIC_VPE_EIC_SHADOW_SET_BASE + (4 * intr))
Ralf Baechle39b8d522008-04-28 17:14:26 +0100223
224#define GIC_VPE_EIC_VEC_BASE 0x0800
225#define GIC_VPE_EIC_VEC(intr) \
226 (GIC_VPE_EIC_VEC_BASE + (4 * intr))
227
228#define GIC_VPE_TENABLE_NMI_OFS 0x1000
229#define GIC_VPE_TENABLE_YQ_OFS 0x1004
230#define GIC_VPE_TENABLE_INT_31_0_OFS 0x1080
231#define GIC_VPE_TENABLE_INT_63_32_OFS 0x1084
232
233/* User Mode Visible Section Register Map */
234#define GIC_UMV_SH_COUNTER_31_00_OFS 0x0000
235#define GIC_UMV_SH_COUNTER_63_32_OFS 0x0004
236
Ralf Baechle39b8d522008-04-28 17:14:26 +0100237/* Masks */
238#define GIC_SH_CONFIG_COUNTSTOP_SHF 28
239#define GIC_SH_CONFIG_COUNTSTOP_MSK (MSK(1) << GIC_SH_CONFIG_COUNTSTOP_SHF)
240
241#define GIC_SH_CONFIG_COUNTBITS_SHF 24
242#define GIC_SH_CONFIG_COUNTBITS_MSK (MSK(4) << GIC_SH_CONFIG_COUNTBITS_SHF)
243
244#define GIC_SH_CONFIG_NUMINTRS_SHF 16
245#define GIC_SH_CONFIG_NUMINTRS_MSK (MSK(8) << GIC_SH_CONFIG_NUMINTRS_SHF)
246
247#define GIC_SH_CONFIG_NUMVPES_SHF 0
248#define GIC_SH_CONFIG_NUMVPES_MSK (MSK(8) << GIC_SH_CONFIG_NUMVPES_SHF)
249
250#define GIC_SH_WEDGE_SET(intr) (intr | (0x1 << 31))
251#define GIC_SH_WEDGE_CLR(intr) (intr & ~(0x1 << 31))
252
253#define GIC_MAP_TO_PIN_SHF 31
254#define GIC_MAP_TO_PIN_MSK (MSK(1) << GIC_MAP_TO_PIN_SHF)
255#define GIC_MAP_TO_NMI_SHF 30
256#define GIC_MAP_TO_NMI_MSK (MSK(1) << GIC_MAP_TO_NMI_SHF)
257#define GIC_MAP_TO_YQ_SHF 29
258#define GIC_MAP_TO_YQ_MSK (MSK(1) << GIC_MAP_TO_YQ_SHF)
259#define GIC_MAP_SHF 0
260#define GIC_MAP_MSK (MSK(6) << GIC_MAP_SHF)
261
262/* GIC_VPE_CTL Masks */
263#define GIC_VPE_CTL_PERFCNT_RTBL_SHF 2
264#define GIC_VPE_CTL_PERFCNT_RTBL_MSK (MSK(1) << GIC_VPE_CTL_PERFCNT_RTBL_SHF)
265#define GIC_VPE_CTL_TIMER_RTBL_SHF 1
266#define GIC_VPE_CTL_TIMER_RTBL_MSK (MSK(1) << GIC_VPE_CTL_TIMER_RTBL_SHF)
267#define GIC_VPE_CTL_EIC_MODE_SHF 0
268#define GIC_VPE_CTL_EIC_MODE_MSK (MSK(1) << GIC_VPE_CTL_EIC_MODE_SHF)
269
270/* GIC_VPE_PEND Masks */
271#define GIC_VPE_PEND_WD_SHF 0
272#define GIC_VPE_PEND_WD_MSK (MSK(1) << GIC_VPE_PEND_WD_SHF)
273#define GIC_VPE_PEND_CMP_SHF 1
274#define GIC_VPE_PEND_CMP_MSK (MSK(1) << GIC_VPE_PEND_CMP_SHF)
275#define GIC_VPE_PEND_TIMER_SHF 2
276#define GIC_VPE_PEND_TIMER_MSK (MSK(1) << GIC_VPE_PEND_TIMER_SHF)
277#define GIC_VPE_PEND_PERFCOUNT_SHF 3
278#define GIC_VPE_PEND_PERFCOUNT_MSK (MSK(1) << GIC_VPE_PEND_PERFCOUNT_SHF)
279#define GIC_VPE_PEND_SWINT0_SHF 4
280#define GIC_VPE_PEND_SWINT0_MSK (MSK(1) << GIC_VPE_PEND_SWINT0_SHF)
281#define GIC_VPE_PEND_SWINT1_SHF 5
282#define GIC_VPE_PEND_SWINT1_MSK (MSK(1) << GIC_VPE_PEND_SWINT1_SHF)
283
284/* GIC_VPE_RMASK Masks */
285#define GIC_VPE_RMASK_WD_SHF 0
286#define GIC_VPE_RMASK_WD_MSK (MSK(1) << GIC_VPE_RMASK_WD_SHF)
287#define GIC_VPE_RMASK_CMP_SHF 1
288#define GIC_VPE_RMASK_CMP_MSK (MSK(1) << GIC_VPE_RMASK_CMP_SHF)
289#define GIC_VPE_RMASK_TIMER_SHF 2
290#define GIC_VPE_RMASK_TIMER_MSK (MSK(1) << GIC_VPE_RMASK_TIMER_SHF)
291#define GIC_VPE_RMASK_PERFCNT_SHF 3
292#define GIC_VPE_RMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_RMASK_PERFCNT_SHF)
293#define GIC_VPE_RMASK_SWINT0_SHF 4
294#define GIC_VPE_RMASK_SWINT0_MSK (MSK(1) << GIC_VPE_RMASK_SWINT0_SHF)
295#define GIC_VPE_RMASK_SWINT1_SHF 5
296#define GIC_VPE_RMASK_SWINT1_MSK (MSK(1) << GIC_VPE_RMASK_SWINT1_SHF)
297
298/* GIC_VPE_SMASK Masks */
299#define GIC_VPE_SMASK_WD_SHF 0
300#define GIC_VPE_SMASK_WD_MSK (MSK(1) << GIC_VPE_SMASK_WD_SHF)
301#define GIC_VPE_SMASK_CMP_SHF 1
302#define GIC_VPE_SMASK_CMP_MSK (MSK(1) << GIC_VPE_SMASK_CMP_SHF)
303#define GIC_VPE_SMASK_TIMER_SHF 2
304#define GIC_VPE_SMASK_TIMER_MSK (MSK(1) << GIC_VPE_SMASK_TIMER_SHF)
305#define GIC_VPE_SMASK_PERFCNT_SHF 3
306#define GIC_VPE_SMASK_PERFCNT_MSK (MSK(1) << GIC_VPE_SMASK_PERFCNT_SHF)
307#define GIC_VPE_SMASK_SWINT0_SHF 4
308#define GIC_VPE_SMASK_SWINT0_MSK (MSK(1) << GIC_VPE_SMASK_SWINT0_SHF)
309#define GIC_VPE_SMASK_SWINT1_SHF 5
310#define GIC_VPE_SMASK_SWINT1_MSK (MSK(1) << GIC_VPE_SMASK_SWINT1_SHF)
311
312/*
313 * Set the Mapping of Interrupt X to a VPE.
314 */
315#define GIC_SH_MAP_TO_VPE_SMASK(intr, vpe) \
316 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_VPE_REG_OFF(intr, vpe)), \
317 GIC_SH_MAP_TO_VPE_REG_BIT(vpe))
318
Steven J. Hill0b271f52012-08-31 16:05:37 -0500319/* GIC nomenclature for Core Interrupt Pins. */
320#define GIC_CPU_INT0 0 /* Core Interrupt 2 */
Ralf Baechle70342282013-01-22 12:59:30 +0100321#define GIC_CPU_INT1 1 /* . */
322#define GIC_CPU_INT2 2 /* . */
323#define GIC_CPU_INT3 3 /* . */
324#define GIC_CPU_INT4 4 /* . */
Tony Wu42a11172013-06-21 10:09:23 +0000325#define GIC_CPU_INT5 5 /* Core Interrupt 7 */
Steven J. Hill0b271f52012-08-31 16:05:37 -0500326
Andrew Bresticker18743d22014-09-18 14:47:24 -0700327/* Add 2 to convert GIC CPU pin to core interrupt */
328#define GIC_CPU_PIN_OFFSET 2
329
Steven J. Hill0b271f52012-08-31 16:05:37 -0500330/* Local GIC interrupts. */
331#define GIC_INT_TMR (GIC_CPU_INT5)
332#define GIC_INT_PERFCTR (GIC_CPU_INT5)
333
334/* Add 2 to convert non-EIC hardware interrupt to EIC vector number. */
335#define GIC_CPU_TO_VEC_OFFSET (2)
336
337/* Mapped interrupt to pin X, then GIC will generate the vector (X+1). */
338#define GIC_PIN_TO_VEC_OFFSET (1)
339
Steven J. Hilldfa762e2013-04-10 16:28:36 -0500340#include <linux/clocksource.h>
341#include <linux/irq.h>
342
Steven J. Hillff867142013-04-10 16:27:04 -0500343extern unsigned int gic_present;
Steven J. Hill28ea2152013-04-10 16:27:50 -0500344extern unsigned int gic_frequency;
Steven J. Hill0b271f52012-08-31 16:05:37 -0500345extern unsigned long _gic_base;
Steven J. Hill0b271f52012-08-31 16:05:37 -0500346extern unsigned int gic_irq_flags[];
Andrew Bresticker18743d22014-09-18 14:47:24 -0700347extern unsigned int gic_cpu_pin;
Steven J. Hill0b271f52012-08-31 16:05:37 -0500348
Ralf Baechle39b8d522008-04-28 17:14:26 +0100349extern void gic_init(unsigned long gic_base_addr,
Andrew Bresticker18743d22014-09-18 14:47:24 -0700350 unsigned long gic_addrspace_size, unsigned int cpu_vec,
351 unsigned int irqbase);
Steven J. Hill0b271f52012-08-31 16:05:37 -0500352extern void gic_clocksource_init(unsigned int);
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -0500353extern unsigned int gic_compare_int (void);
Steven J. Hilldfa762e2013-04-10 16:28:36 -0500354extern cycle_t gic_read_count(void);
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -0500355extern cycle_t gic_read_compare(void);
356extern void gic_write_compare(cycle_t cnt);
Paul Burton414408d02014-03-05 11:35:53 +0000357extern void gic_write_cpu_compare(cycle_t cnt, int cpu);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100358extern void gic_send_ipi(unsigned int intr);
Tim Anderson03650702009-06-17 16:22:53 -0700359extern unsigned int plat_ipi_call_int_xlate(unsigned int);
360extern unsigned int plat_ipi_resched_int_xlate(unsigned int);
Steven J. Hillf0b77f22012-07-06 23:56:00 +0200361extern void gic_bind_eic_interrupt(int irq, int set);
362extern unsigned int gic_get_timer_pending(void);
Jeffrey Deans31521a72014-07-17 09:20:57 +0100363extern void gic_get_int_mask(unsigned long *dst, const unsigned long *src);
Steven J. Hill2675fa72013-04-10 16:29:13 -0500364extern unsigned int gic_get_int(void);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100365#endif /* _ASM_GICREGS_H */