Skip to content

Commit 7bf8b16

Browse files
mpredfearnamalon
authored andcommitted
MIPS: Generic: Support GIC in EIC mode
The GIC supports running in External Interrupt Controller (EIC) mode, and will signal this via cpu_has_veic if enabled in hardware. Currently the generic kernel will panic if cpu_has_veic is set - but the GIC can legitimately set this flag if either configured to boot in EIC mode, or if the GIC driver enables this mode. Make the kernel not panic in this case, and instead just check if the GIC is present. If so, use it's CPU local interrupt routing functions. If an EIC is present, but it is not the GIC, then the kernel does not know how to get the VIRQ for the CPU local interrupts and should panic. Support for alternative EICs being present is needed here for the generic kernel to support them. Suggested-by: Paul Burton <paul.burton@mips.com> Signed-off-by: Matt Redfearn <matt.redfearn@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18191/ Signed-off-by: James Hogan <jhogan@kernel.org>
1 parent 0ef1559 commit 7bf8b16

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arch/mips/generic/irq.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ int get_c0_fdc_int(void)
2222
{
2323
int mips_cpu_fdc_irq;
2424

25-
if (cpu_has_veic)
26-
panic("Unimplemented!");
27-
else if (mips_gic_present())
25+
if (mips_gic_present())
2826
mips_cpu_fdc_irq = gic_get_c0_fdc_int();
27+
else if (cpu_has_veic)
28+
panic("Unimplemented!");
2929
else if (cp0_fdc_irq >= 0)
3030
mips_cpu_fdc_irq = MIPS_CPU_IRQ_BASE + cp0_fdc_irq;
3131
else
@@ -38,10 +38,10 @@ int get_c0_perfcount_int(void)
3838
{
3939
int mips_cpu_perf_irq;
4040

41-
if (cpu_has_veic)
42-
panic("Unimplemented!");
43-
else if (mips_gic_present())
41+
if (mips_gic_present())
4442
mips_cpu_perf_irq = gic_get_c0_perfcount_int();
43+
else if (cpu_has_veic)
44+
panic("Unimplemented!");
4545
else if (cp0_perfcount_irq >= 0)
4646
mips_cpu_perf_irq = MIPS_CPU_IRQ_BASE + cp0_perfcount_irq;
4747
else
@@ -54,10 +54,10 @@ unsigned int get_c0_compare_int(void)
5454
{
5555
int mips_cpu_timer_irq;
5656

57-
if (cpu_has_veic)
58-
panic("Unimplemented!");
59-
else if (mips_gic_present())
57+
if (mips_gic_present())
6058
mips_cpu_timer_irq = gic_get_c0_compare_int();
59+
else if (cpu_has_veic)
60+
panic("Unimplemented!");
6161
else
6262
mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
6363

0 commit comments

Comments
 (0)