blob: 76658660ea4f2ecbd823be1840ca89bc7b1620ae [file] [log] [blame]
Steven J. Hill2299c492012-08-31 16:13:07 -05001/*
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) 2008 Ralf Baechle (ralf@linux-mips.org)
7 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
8 */
Ralf Baechle39b8d522008-04-28 17:14:26 +01009#include <linux/bitmap.h>
10#include <linux/init.h>
Ralf Baechle631330f2009-06-19 14:05:26 +010011#include <linux/smp.h>
David Howellsca4d3e672010-10-07 14:08:54 +010012#include <linux/irq.h>
Steven J. Hilldfa762e2013-04-10 16:28:36 -050013#include <linux/clocksource.h>
Ralf Baechle39b8d522008-04-28 17:14:26 +010014
15#include <asm/io.h>
16#include <asm/gic.h>
Steven J. Hill98b67c32012-08-31 16:18:49 -050017#include <asm/setup.h>
18#include <asm/traps.h>
Ralf Baechle39b8d522008-04-28 17:14:26 +010019#include <linux/hardirq.h>
20#include <asm-generic/bitops/find.h>
21
Steven J. Hill28ea2152013-04-10 16:27:50 -050022unsigned int gic_frequency;
Steven J. Hillff867142013-04-10 16:27:04 -050023unsigned int gic_present;
Steven J. Hill0b271f52012-08-31 16:05:37 -050024unsigned long _gic_base;
25unsigned int gic_irq_base;
26unsigned int gic_irq_flags[GIC_NUM_INTRS];
Ralf Baechle39b8d522008-04-28 17:14:26 +010027
Steven J. Hill98b67c32012-08-31 16:18:49 -050028/* The index into this array is the vector # of the interrupt. */
29struct gic_shared_intr_map gic_shared_intr_map[GIC_NUM_INTRS];
30
Jeffrey Deans822350b2014-07-17 09:20:53 +010031struct gic_pcpu_mask {
32 DECLARE_BITMAP(pcpu_mask, GIC_NUM_INTRS);
33};
34
35struct gic_pending_regs {
36 DECLARE_BITMAP(pending, GIC_NUM_INTRS);
37};
38
39struct gic_intrmask_regs {
40 DECLARE_BITMAP(intrmask, GIC_NUM_INTRS);
41};
42
Steven J. Hill0b271f52012-08-31 16:05:37 -050043static struct gic_pcpu_mask pcpu_masks[NR_CPUS];
Ralf Baechle39b8d522008-04-28 17:14:26 +010044static struct gic_pending_regs pending_regs[NR_CPUS];
45static struct gic_intrmask_regs intrmask_regs[NR_CPUS];
46
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -050047#if defined(CONFIG_CSRC_GIC) || defined(CONFIG_CEVT_GIC)
Steven J. Hilldfa762e2013-04-10 16:28:36 -050048cycle_t gic_read_count(void)
49{
50 unsigned int hi, hi2, lo;
51
52 do {
53 GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_63_32), hi);
54 GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_31_00), lo);
55 GICREAD(GIC_REG(SHARED, GIC_SH_COUNTER_63_32), hi2);
56 } while (hi2 != hi);
57
58 return (((cycle_t) hi) << 32) + lo;
59}
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -050060
61void gic_write_compare(cycle_t cnt)
62{
63 GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI),
64 (int)(cnt >> 32));
65 GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO),
66 (int)(cnt & 0xffffffff));
67}
68
Paul Burton414408d02014-03-05 11:35:53 +000069void gic_write_cpu_compare(cycle_t cnt, int cpu)
70{
71 unsigned long flags;
72
73 local_irq_save(flags);
74
75 GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), cpu);
76 GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_HI),
77 (int)(cnt >> 32));
78 GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_COMPARE_LO),
79 (int)(cnt & 0xffffffff));
80
81 local_irq_restore(flags);
82}
83
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -050084cycle_t gic_read_compare(void)
85{
86 unsigned int hi, lo;
87
88 GICREAD(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_HI), hi);
89 GICREAD(GIC_REG(VPE_LOCAL, GIC_VPE_COMPARE_LO), lo);
90
91 return (((cycle_t) hi) << 32) + lo;
92}
Steven J. Hilldfa762e2013-04-10 16:28:36 -050093#endif
94
Steven J. Hill98b67c32012-08-31 16:18:49 -050095unsigned int gic_get_timer_pending(void)
96{
97 unsigned int vpe_pending;
98
99 GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), 0);
100 GICREAD(GIC_REG(VPE_OTHER, GIC_VPE_PEND), vpe_pending);
Ralf Baechle635c99072014-10-21 14:12:49 +0200101 return vpe_pending & GIC_VPE_PEND_TIMER_MSK;
Steven J. Hill98b67c32012-08-31 16:18:49 -0500102}
103
104void gic_bind_eic_interrupt(int irq, int set)
105{
106 /* Convert irq vector # to hw int # */
107 irq -= GIC_PIN_TO_VEC_OFFSET;
108
109 /* Set irq to use shadow set */
110 GICWRITE(GIC_REG_ADDR(VPE_LOCAL, GIC_VPE_EIC_SS(irq)), set);
111}
112
Ralf Baechle39b8d522008-04-28 17:14:26 +0100113void gic_send_ipi(unsigned int intr)
114{
Ralf Baechle39b8d522008-04-28 17:14:26 +0100115 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), 0x80000000 | intr);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100116}
117
Steven J. Hill98b67c32012-08-31 16:18:49 -0500118static void gic_eic_irq_dispatch(void)
119{
120 unsigned int cause = read_c0_cause();
121 int irq;
122
123 irq = (cause & ST0_IM) >> STATUSB_IP2;
124 if (irq == 0)
125 irq = -1;
126
127 if (irq >= 0)
128 do_IRQ(gic_irq_base + irq);
129 else
130 spurious_interrupt();
131}
132
Chris Dearman7098f742009-07-10 01:54:09 -0700133static void __init vpe_local_setup(unsigned int numvpes)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100134{
Steven J. Hill98b67c32012-08-31 16:18:49 -0500135 unsigned long timer_intr = GIC_INT_TMR;
136 unsigned long perf_intr = GIC_INT_PERFCTR;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100137 unsigned int vpe_ctl;
Steven J. Hill2299c492012-08-31 16:13:07 -0500138 int i;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100139
Steven J. Hill98b67c32012-08-31 16:18:49 -0500140 if (cpu_has_veic) {
141 /*
142 * GIC timer interrupt -> CPU HW Int X (vector X+2) ->
143 * map to pin X+2-1 (since GIC adds 1)
144 */
145 timer_intr += (GIC_CPU_TO_VEC_OFFSET - GIC_PIN_TO_VEC_OFFSET);
146 /*
147 * GIC perfcnt interrupt -> CPU HW Int X (vector X+2) ->
148 * map to pin X+2-1 (since GIC adds 1)
149 */
150 perf_intr += (GIC_CPU_TO_VEC_OFFSET - GIC_PIN_TO_VEC_OFFSET);
151 }
152
Ralf Baechle39b8d522008-04-28 17:14:26 +0100153 /*
154 * Setup the default performance counter timer interrupts
155 * for all VPEs
156 */
157 for (i = 0; i < numvpes; i++) {
158 GICWRITE(GIC_REG(VPE_LOCAL, GIC_VPE_OTHER_ADDR), i);
159
160 /* Are Interrupts locally routable? */
161 GICREAD(GIC_REG(VPE_OTHER, GIC_VPE_CTL), vpe_ctl);
162 if (vpe_ctl & GIC_VPE_CTL_TIMER_RTBL_MSK)
163 GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_TIMER_MAP),
Steven J. Hill98b67c32012-08-31 16:18:49 -0500164 GIC_MAP_TO_PIN_MSK | timer_intr);
165 if (cpu_has_veic) {
166 set_vi_handler(timer_intr + GIC_PIN_TO_VEC_OFFSET,
167 gic_eic_irq_dispatch);
168 gic_shared_intr_map[timer_intr + GIC_PIN_TO_VEC_OFFSET].local_intr_mask |= GIC_VPE_RMASK_TIMER_MSK;
169 }
Ralf Baechle39b8d522008-04-28 17:14:26 +0100170
171 if (vpe_ctl & GIC_VPE_CTL_PERFCNT_RTBL_MSK)
172 GICWRITE(GIC_REG(VPE_OTHER, GIC_VPE_PERFCTR_MAP),
Steven J. Hill98b67c32012-08-31 16:18:49 -0500173 GIC_MAP_TO_PIN_MSK | perf_intr);
174 if (cpu_has_veic) {
175 set_vi_handler(perf_intr + GIC_PIN_TO_VEC_OFFSET, gic_eic_irq_dispatch);
176 gic_shared_intr_map[perf_intr + GIC_PIN_TO_VEC_OFFSET].local_intr_mask |= GIC_VPE_RMASK_PERFCNT_MSK;
177 }
Ralf Baechle39b8d522008-04-28 17:14:26 +0100178 }
179}
180
Raghu Gandham0ab2b7d2013-04-10 16:30:12 -0500181unsigned int gic_compare_int(void)
182{
183 unsigned int pending;
184
185 GICREAD(GIC_REG(VPE_LOCAL, GIC_VPE_PEND), pending);
186 if (pending & GIC_VPE_PEND_CMP_MSK)
187 return 1;
188 else
189 return 0;
190}
191
Jeffrey Deans31521a72014-07-17 09:20:57 +0100192void gic_get_int_mask(unsigned long *dst, const unsigned long *src)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100193{
194 unsigned int i;
195 unsigned long *pending, *intrmask, *pcpu_mask;
196 unsigned long *pending_abs, *intrmask_abs;
197
198 /* Get per-cpu bitmaps */
199 pending = pending_regs[smp_processor_id()].pending;
200 intrmask = intrmask_regs[smp_processor_id()].intrmask;
201 pcpu_mask = pcpu_masks[smp_processor_id()].pcpu_mask;
202
203 pending_abs = (unsigned long *) GIC_REG_ABS_ADDR(SHARED,
204 GIC_SH_PEND_31_0_OFS);
205 intrmask_abs = (unsigned long *) GIC_REG_ABS_ADDR(SHARED,
206 GIC_SH_MASK_31_0_OFS);
207
208 for (i = 0; i < BITS_TO_LONGS(GIC_NUM_INTRS); i++) {
209 GICREAD(*pending_abs, pending[i]);
210 GICREAD(*intrmask_abs, intrmask[i]);
211 pending_abs++;
212 intrmask_abs++;
213 }
214
215 bitmap_and(pending, pending, intrmask, GIC_NUM_INTRS);
216 bitmap_and(pending, pending, pcpu_mask, GIC_NUM_INTRS);
Jeffrey Deans31521a72014-07-17 09:20:57 +0100217 bitmap_and(dst, src, pending, GIC_NUM_INTRS);
218}
Ralf Baechle39b8d522008-04-28 17:14:26 +0100219
Jeffrey Deans31521a72014-07-17 09:20:57 +0100220unsigned int gic_get_int(void)
221{
222 DECLARE_BITMAP(interrupts, GIC_NUM_INTRS);
223
224 bitmap_fill(interrupts, GIC_NUM_INTRS);
225 gic_get_int_mask(interrupts, interrupts);
226
227 return find_first_bit(interrupts, GIC_NUM_INTRS);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100228}
229
Thomas Gleixner161d0492011-03-23 21:08:58 +0000230static void gic_mask_irq(struct irq_data *d)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100231{
Steven J. Hill2299c492012-08-31 16:13:07 -0500232 GIC_CLR_INTR_MASK(d->irq - gic_irq_base);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100233}
234
Thomas Gleixner161d0492011-03-23 21:08:58 +0000235static void gic_unmask_irq(struct irq_data *d)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100236{
Steven J. Hill2299c492012-08-31 16:13:07 -0500237 GIC_SET_INTR_MASK(d->irq - gic_irq_base);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100238}
239
Andrew Bresticker5561c9e2014-09-18 14:47:20 -0700240static void gic_ack_irq(struct irq_data *d)
241{
242 /* Clear edge detector */
243 if (gic_irq_flags[d->irq - gic_irq_base] & GIC_TRIG_EDGE)
244 GICWRITE(GIC_REG(SHARED, GIC_SH_WEDGE), d->irq - gic_irq_base);
245}
246
Ralf Baechle39b8d522008-04-28 17:14:26 +0100247#ifdef CONFIG_SMP
Ralf Baechle39b8d522008-04-28 17:14:26 +0100248static DEFINE_SPINLOCK(gic_lock);
249
Thomas Gleixner161d0492011-03-23 21:08:58 +0000250static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
251 bool force)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100252{
Steven J. Hill2299c492012-08-31 16:13:07 -0500253 unsigned int irq = (d->irq - gic_irq_base);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100254 cpumask_t tmp = CPU_MASK_NONE;
255 unsigned long flags;
256 int i;
257
Rusty Russell0de26522008-12-13 21:20:26 +1030258 cpumask_and(&tmp, cpumask, cpu_online_mask);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100259 if (cpus_empty(tmp))
Yinghai Lud5dedd42009-04-27 17:59:21 -0700260 return -1;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100261
262 /* Assumption : cpumask refers to a single CPU */
263 spin_lock_irqsave(&gic_lock, flags);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100264
Tony Wuc214c032013-06-21 10:13:08 +0000265 /* Re-route this IRQ */
266 GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));
Ralf Baechle39b8d522008-04-28 17:14:26 +0100267
Tony Wuc214c032013-06-21 10:13:08 +0000268 /* Update the pcpu_masks */
269 for (i = 0; i < NR_CPUS; i++)
270 clear_bit(irq, pcpu_masks[i].pcpu_mask);
271 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
272
Thomas Gleixner161d0492011-03-23 21:08:58 +0000273 cpumask_copy(d->affinity, cpumask);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100274 spin_unlock_irqrestore(&gic_lock, flags);
275
Thomas Gleixner161d0492011-03-23 21:08:58 +0000276 return IRQ_SET_MASK_OK_NOCOPY;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100277}
278#endif
279
280static struct irq_chip gic_irq_controller = {
Thomas Gleixner161d0492011-03-23 21:08:58 +0000281 .name = "MIPS GIC",
Andrew Bresticker5561c9e2014-09-18 14:47:20 -0700282 .irq_ack = gic_ack_irq,
Thomas Gleixner161d0492011-03-23 21:08:58 +0000283 .irq_mask = gic_mask_irq,
Thomas Gleixner161d0492011-03-23 21:08:58 +0000284 .irq_unmask = gic_unmask_irq,
Ralf Baechle39b8d522008-04-28 17:14:26 +0100285#ifdef CONFIG_SMP
Thomas Gleixner161d0492011-03-23 21:08:58 +0000286 .irq_set_affinity = gic_set_affinity,
Ralf Baechle39b8d522008-04-28 17:14:26 +0100287#endif
288};
289
Chris Dearman7098f742009-07-10 01:54:09 -0700290static void __init gic_setup_intr(unsigned int intr, unsigned int cpu,
291 unsigned int pin, unsigned int polarity, unsigned int trigtype,
292 unsigned int flags)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100293{
Steven J. Hill98b67c32012-08-31 16:18:49 -0500294 struct gic_shared_intr_map *map_ptr;
295
Ralf Baechle39b8d522008-04-28 17:14:26 +0100296 /* Setup Intr to Pin mapping */
297 if (pin & GIC_MAP_TO_NMI_MSK) {
Jeffrey Deans6096e112014-07-17 09:20:56 +0100298 int i;
299
Ralf Baechle39b8d522008-04-28 17:14:26 +0100300 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_PIN(intr)), pin);
301 /* FIXME: hack to route NMI to all cpu's */
Jeffrey Deans6096e112014-07-17 09:20:56 +0100302 for (i = 0; i < NR_CPUS; i += 32) {
Ralf Baechle39b8d522008-04-28 17:14:26 +0100303 GICWRITE(GIC_REG_ADDR(SHARED,
Jeffrey Deans6096e112014-07-17 09:20:56 +0100304 GIC_SH_MAP_TO_VPE_REG_OFF(intr, i)),
Ralf Baechle39b8d522008-04-28 17:14:26 +0100305 0xffffffff);
306 }
307 } else {
308 GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_MAP_TO_PIN(intr)),
309 GIC_MAP_TO_PIN_MSK | pin);
310 /* Setup Intr to CPU mapping */
311 GIC_SH_MAP_TO_VPE_SMASK(intr, cpu);
Steven J. Hill98b67c32012-08-31 16:18:49 -0500312 if (cpu_has_veic) {
313 set_vi_handler(pin + GIC_PIN_TO_VEC_OFFSET,
314 gic_eic_irq_dispatch);
315 map_ptr = &gic_shared_intr_map[pin + GIC_PIN_TO_VEC_OFFSET];
316 if (map_ptr->num_shared_intr >= GIC_MAX_SHARED_INTR)
317 BUG();
318 map_ptr->intr_list[map_ptr->num_shared_intr++] = intr;
319 }
Ralf Baechle39b8d522008-04-28 17:14:26 +0100320 }
321
322 /* Setup Intr Polarity */
323 GIC_SET_POLARITY(intr, polarity);
324
325 /* Setup Intr Trigger Type */
326 GIC_SET_TRIGGER(intr, trigtype);
327
328 /* Init Intr Masks */
Chris Dearman7098f742009-07-10 01:54:09 -0700329 GIC_CLR_INTR_MASK(intr);
Jeffrey Deansb0a88ae2014-07-17 09:20:55 +0100330
Chris Dearman7098f742009-07-10 01:54:09 -0700331 /* Initialise per-cpu Interrupt software masks */
Jeffrey Deansb0a88ae2014-07-17 09:20:55 +0100332 set_bit(intr, pcpu_masks[cpu].pcpu_mask);
333
Steven J. Hill98b67c32012-08-31 16:18:49 -0500334 if ((flags & GIC_FLAG_TRANSPARENT) && (cpu_has_veic == 0))
Chris Dearman7098f742009-07-10 01:54:09 -0700335 GIC_SET_INTR_MASK(intr);
336 if (trigtype == GIC_TRIG_EDGE)
Steven J. Hill0b271f52012-08-31 16:05:37 -0500337 gic_irq_flags[intr] |= GIC_TRIG_EDGE;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100338}
339
Chris Dearman7098f742009-07-10 01:54:09 -0700340static void __init gic_basic_init(int numintrs, int numvpes,
341 struct gic_intr_map *intrmap, int mapsize)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100342{
343 unsigned int i, cpu;
Steven J. Hill98b67c32012-08-31 16:18:49 -0500344 unsigned int pin_offset = 0;
345
346 board_bind_eic_interrupt = &gic_bind_eic_interrupt;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100347
348 /* Setup defaults */
Chris Dearman7098f742009-07-10 01:54:09 -0700349 for (i = 0; i < numintrs; i++) {
Ralf Baechle39b8d522008-04-28 17:14:26 +0100350 GIC_SET_POLARITY(i, GIC_POL_POS);
351 GIC_SET_TRIGGER(i, GIC_TRIG_LEVEL);
Chris Dearman7098f742009-07-10 01:54:09 -0700352 GIC_CLR_INTR_MASK(i);
Steven J. Hill98b67c32012-08-31 16:18:49 -0500353 if (i < GIC_NUM_INTRS) {
Chris Dearman7098f742009-07-10 01:54:09 -0700354 gic_irq_flags[i] = 0;
Steven J. Hill98b67c32012-08-31 16:18:49 -0500355 gic_shared_intr_map[i].num_shared_intr = 0;
356 gic_shared_intr_map[i].local_intr_mask = 0;
357 }
Ralf Baechle39b8d522008-04-28 17:14:26 +0100358 }
359
Steven J. Hill98b67c32012-08-31 16:18:49 -0500360 /*
361 * In EIC mode, the HW_INT# is offset by (2-1). Need to subtract
362 * one because the GIC will add one (since 0=no intr).
363 */
364 if (cpu_has_veic)
365 pin_offset = (GIC_CPU_TO_VEC_OFFSET - GIC_PIN_TO_VEC_OFFSET);
366
Ralf Baechle39b8d522008-04-28 17:14:26 +0100367 /* Setup specifics */
Chris Dearman7098f742009-07-10 01:54:09 -0700368 for (i = 0; i < mapsize; i++) {
369 cpu = intrmap[i].cpunum;
Ralf Baechle863cb9b2010-09-17 17:07:48 +0100370 if (cpu == GIC_UNUSED)
Ralf Baechle39b8d522008-04-28 17:14:26 +0100371 continue;
Chris Dearman7098f742009-07-10 01:54:09 -0700372 gic_setup_intr(i,
373 intrmap[i].cpunum,
Steven J. Hill98b67c32012-08-31 16:18:49 -0500374 intrmap[i].pin + pin_offset,
Chris Dearman7098f742009-07-10 01:54:09 -0700375 intrmap[i].polarity,
376 intrmap[i].trigtype,
377 intrmap[i].flags);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100378 }
379
380 vpe_local_setup(numvpes);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100381}
382
383void __init gic_init(unsigned long gic_base_addr,
384 unsigned long gic_addrspace_size,
385 struct gic_intr_map *intr_map, unsigned int intr_map_size,
386 unsigned int irqbase)
387{
388 unsigned int gicconfig;
Chris Dearman7098f742009-07-10 01:54:09 -0700389 int numvpes, numintrs;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100390
391 _gic_base = (unsigned long) ioremap_nocache(gic_base_addr,
392 gic_addrspace_size);
Steven J. Hill0b271f52012-08-31 16:05:37 -0500393 gic_irq_base = irqbase;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100394
395 GICREAD(GIC_REG(SHARED, GIC_SH_CONFIG), gicconfig);
396 numintrs = (gicconfig & GIC_SH_CONFIG_NUMINTRS_MSK) >>
397 GIC_SH_CONFIG_NUMINTRS_SHF;
398 numintrs = ((numintrs + 1) * 8);
399
400 numvpes = (gicconfig & GIC_SH_CONFIG_NUMVPES_MSK) >>
401 GIC_SH_CONFIG_NUMVPES_SHF;
Steven J. Hill3234f442012-08-31 16:23:49 -0500402 numvpes = numvpes + 1;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100403
Chris Dearman7098f742009-07-10 01:54:09 -0700404 gic_basic_init(numintrs, numvpes, intr_map, intr_map_size);
Steven J. Hill0b271f52012-08-31 16:05:37 -0500405
406 gic_platform_init(numintrs, &gic_irq_controller);
Ralf Baechle39b8d522008-04-28 17:14:26 +0100407}