diff options
-rw-r--r-- | arch/arm/common/gic.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index ada6359160eb..772f95f1aecd 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
@@ -251,15 +251,16 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
251 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 251 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
252 | 252 | ||
253 | /* | 253 | /* |
254 | * Set priority on all interrupts. | 254 | * Set priority on all global interrupts. |
255 | */ | 255 | */ |
256 | for (i = 0; i < max_irq; i += 4) | 256 | for (i = 32; i < max_irq; i += 4) |
257 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); | 257 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); |
258 | 258 | ||
259 | /* | 259 | /* |
260 | * Disable all interrupts. | 260 | * Disable all interrupts. Leave the PPI and SGIs alone |
261 | * as these enables are banked registers. | ||
261 | */ | 262 | */ |
262 | for (i = 0; i < max_irq; i += 32) | 263 | for (i = 32; i < max_irq; i += 32) |
263 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); | 264 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); |
264 | 265 | ||
265 | /* | 266 | /* |
@@ -277,11 +278,30 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
277 | 278 | ||
278 | void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) | 279 | void __cpuinit gic_cpu_init(unsigned int gic_nr, void __iomem *base) |
279 | { | 280 | { |
281 | void __iomem *dist_base; | ||
282 | int i; | ||
283 | |||
280 | if (gic_nr >= MAX_GIC_NR) | 284 | if (gic_nr >= MAX_GIC_NR) |
281 | BUG(); | 285 | BUG(); |
282 | 286 | ||
287 | dist_base = gic_data[gic_nr].dist_base; | ||
288 | BUG_ON(!dist_base); | ||
289 | |||
283 | gic_data[gic_nr].cpu_base = base; | 290 | gic_data[gic_nr].cpu_base = base; |
284 | 291 | ||
292 | /* | ||
293 | * Deal with the banked PPI and SGI interrupts - disable all | ||
294 | * PPI interrupts, ensure all SGI interrupts are enabled. | ||
295 | */ | ||
296 | writel(0xffff0000, dist_base + GIC_DIST_ENABLE_CLEAR); | ||
297 | writel(0x0000ffff, dist_base + GIC_DIST_ENABLE_SET); | ||
298 | |||
299 | /* | ||
300 | * Set priority on PPI and SGI interrupts | ||
301 | */ | ||
302 | for (i = 0; i < 32; i += 4) | ||
303 | writel(0xa0a0a0a0, dist_base + GIC_DIST_PRI + i * 4 / 4); | ||
304 | |||
285 | writel(0xf0, base + GIC_CPU_PRIMASK); | 305 | writel(0xf0, base + GIC_CPU_PRIMASK); |
286 | writel(1, base + GIC_CPU_CTRL); | 306 | writel(1, base + GIC_CPU_CTRL); |
287 | } | 307 | } |