Commit 9306c8de authored by Tim Anderson's avatar Tim Anderson Committed by Ralf Baechle

MIPS: CMP: Extend the GIC IPI interrupts beyond 32

This patch extends the GIC interrupt handling beyond the current 32 bit
range as well as extending the number of interrupts based on the number
of CPUs.
Signed-off-by: default avatarTim Anderson <tanderson@mvista.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent b53d4d1f
...@@ -20,7 +20,11 @@ ...@@ -20,7 +20,11 @@
#define GIC_TRIG_EDGE 1 #define GIC_TRIG_EDGE 1
#define GIC_TRIG_LEVEL 0 #define GIC_TRIG_LEVEL 0
#if CONFIG_SMP
#define GIC_NUM_INTRS (24 + NR_CPUS * 2)
#else
#define GIC_NUM_INTRS 32 #define GIC_NUM_INTRS 32
#endif
#define MSK(n) ((1 << (n)) - 1) #define MSK(n) ((1 << (n)) - 1)
#define REG32(addr) (*(volatile unsigned int *) (addr)) #define REG32(addr) (*(volatile unsigned int *) (addr))
......
...@@ -107,9 +107,7 @@ static unsigned int gic_irq_startup(unsigned int irq) ...@@ -107,9 +107,7 @@ static unsigned int gic_irq_startup(unsigned int irq)
{ {
pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
irq -= _irqbase; irq -= _irqbase;
/* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ GIC_SET_INTR_MASK(irq, 1);
GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
1 << (irq % 32));
return 0; return 0;
} }
...@@ -120,8 +118,7 @@ static void gic_irq_ack(unsigned int irq) ...@@ -120,8 +118,7 @@ static void gic_irq_ack(unsigned int irq)
#endif #endif
pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
irq -= _irqbase; irq -= _irqbase;
GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))), GIC_CLR_INTR_MASK(irq, 1);
1 << (irq % 32));
if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) { if (_intrmap[irq].trigtype == GIC_TRIG_EDGE) {
if (!gic_wedgeb2bok) if (!gic_wedgeb2bok)
...@@ -138,18 +135,14 @@ static void gic_mask_irq(unsigned int irq) ...@@ -138,18 +135,14 @@ static void gic_mask_irq(unsigned int irq)
{ {
pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
irq -= _irqbase; irq -= _irqbase;
/* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ GIC_CLR_INTR_MASK(irq, 1);
GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_RMASK_31_0_OFS + (irq / 32))),
1 << (irq % 32));
} }
static void gic_unmask_irq(unsigned int irq) static void gic_unmask_irq(unsigned int irq)
{ {
pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq); pr_debug("CPU%d: %s: irq%d\n", smp_processor_id(), __func__, irq);
irq -= _irqbase; irq -= _irqbase;
/* FIXME: this is wrong for !GICISWORDLITTLEENDIAN */ GIC_SET_INTR_MASK(irq, 1);
GICWRITE(GIC_REG_ADDR(SHARED, (GIC_SH_SMASK_31_0_OFS + (irq / 32))),
1 << (irq % 32));
} }
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment