diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-03-24 06:19:32 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-31 12:17:12 -0400 |
commit | 45b29578040e42c88d27ab46510fa822ce14767e (patch) | |
tree | 8c05e47ca6a15ac7f8b352134b80820f17e63ed0 | |
parent | 0c2cb004b262987f7ab84d0c40b7bff74ed5d17b (diff) |
MIPS: Malta: GIC IPIs may be used without MT
It's perfectly valid to use SMP on a non-MT CPU and use the GIC for
IPIs. Set them up conditional upon CONFIG_MIPS_GIC_IPI rather than
CONFIG_MIPS_MT_SMP.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Paul Burton <paul.burton@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/6654/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/mti-malta/malta-int.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index 93103f81bf57..c6cbfebcac9b 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c | |||
@@ -286,10 +286,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
286 | 286 | ||
287 | #ifdef CONFIG_MIPS_MT_SMP | 287 | #ifdef CONFIG_MIPS_MT_SMP |
288 | 288 | ||
289 | |||
290 | #define GIC_MIPS_CPU_IPI_RESCHED_IRQ 3 | ||
291 | #define GIC_MIPS_CPU_IPI_CALL_IRQ 4 | ||
292 | |||
293 | #define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */ | 289 | #define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */ |
294 | #define C_RESCHED C_SW0 | 290 | #define C_RESCHED C_SW0 |
295 | #define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */ | 291 | #define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */ |
@@ -306,6 +302,13 @@ static void ipi_call_dispatch(void) | |||
306 | do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ); | 302 | do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ); |
307 | } | 303 | } |
308 | 304 | ||
305 | #endif /* CONFIG_MIPS_MT_SMP */ | ||
306 | |||
307 | #ifdef CONFIG_MIPS_GIC_IPI | ||
308 | |||
309 | #define GIC_MIPS_CPU_IPI_RESCHED_IRQ 3 | ||
310 | #define GIC_MIPS_CPU_IPI_CALL_IRQ 4 | ||
311 | |||
309 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) | 312 | static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) |
310 | { | 313 | { |
311 | #ifdef MIPS_VPE_APSP_API | 314 | #ifdef MIPS_VPE_APSP_API |
@@ -336,7 +339,7 @@ static struct irqaction irq_call = { | |||
336 | .flags = IRQF_PERCPU, | 339 | .flags = IRQF_PERCPU, |
337 | .name = "IPI_call" | 340 | .name = "IPI_call" |
338 | }; | 341 | }; |
339 | #endif /* CONFIG_MIPS_MT_SMP */ | 342 | #endif /* CONFIG_MIPS_GIC_IPI */ |
340 | 343 | ||
341 | static int gic_resched_int_base; | 344 | static int gic_resched_int_base; |
342 | static int gic_call_int_base; | 345 | static int gic_call_int_base; |
@@ -416,7 +419,7 @@ static struct gic_intr_map gic_intr_map[GIC_NUM_INTRS] = { | |||
416 | }; | 419 | }; |
417 | #undef X | 420 | #undef X |
418 | 421 | ||
419 | #if defined(CONFIG_MIPS_MT_SMP) | 422 | #ifdef CONFIG_MIPS_GIC_IPI |
420 | static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin) | 423 | static void __init fill_ipi_map1(int baseintr, int cpu, int cpupin) |
421 | { | 424 | { |
422 | int intr = baseintr + cpu; | 425 | int intr = baseintr + cpu; |
@@ -532,7 +535,7 @@ void __init arch_init_irq(void) | |||
532 | if (gic_present) { | 535 | if (gic_present) { |
533 | /* FIXME */ | 536 | /* FIXME */ |
534 | int i; | 537 | int i; |
535 | #if defined(CONFIG_MIPS_MT_SMP) | 538 | #if defined(CONFIG_MIPS_GIC_IPI) |
536 | gic_call_int_base = GIC_NUM_INTRS - | 539 | gic_call_int_base = GIC_NUM_INTRS - |
537 | (NR_CPUS - nr_cpu_ids) * 2 - nr_cpu_ids; | 540 | (NR_CPUS - nr_cpu_ids) * 2 - nr_cpu_ids; |
538 | gic_resched_int_base = gic_call_int_base - nr_cpu_ids; | 541 | gic_resched_int_base = gic_call_int_base - nr_cpu_ids; |
@@ -547,7 +550,7 @@ void __init arch_init_irq(void) | |||
547 | (i | (0x1 << MSC01_SC_CFG_GICENA_SHF)); | 550 | (i | (0x1 << MSC01_SC_CFG_GICENA_SHF)); |
548 | pr_debug("GIC Enabled\n"); | 551 | pr_debug("GIC Enabled\n"); |
549 | } | 552 | } |
550 | #if defined(CONFIG_MIPS_MT_SMP) | 553 | #if defined(CONFIG_MIPS_GIC_IPI) |
551 | /* set up ipi interrupts */ | 554 | /* set up ipi interrupts */ |
552 | if (cpu_has_vint) { | 555 | if (cpu_has_vint) { |
553 | set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch); | 556 | set_vi_handler(MIPSCPU_INT_IPI0, malta_ipi_irqdispatch); |