Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IRQCHIP: mips-gic: Add function for retrieving FDC IRQ

Add a function to the MIPS GIC driver for retrieving the Fast Debug
Channel (FDC) interrupt number, similar to the existing ones for the
timer and perf counter interrupts. This will be used by platform
implementations of get_c0_fdc_int() if a GIC is present.

A workaround exists for interAptiv and proAptiv which claim to be able
to route the FDC interrupt but don't seem to be able to in practice (at
least on Malta).

[ralf@linux-mips.org: Fix conflict.]

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Bresticker <abrestic@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9142/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
6429e2b6 b720fd8b

+24
+23
drivers/irqchip/irq-mips-gic.c
··· 227 227 GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_PERFCTR)); 228 228 } 229 229 230 + int gic_get_c0_fdc_int(void) 231 + { 232 + if (!gic_local_irq_is_routable(GIC_LOCAL_INT_FDC)) { 233 + /* Is the FDC IRQ even present? */ 234 + if (cp0_fdc_irq < 0) 235 + return -1; 236 + return MIPS_CPU_IRQ_BASE + cp0_fdc_irq; 237 + } 238 + 239 + /* 240 + * Some cores claim the FDC is routable but it doesn't actually seem to 241 + * be connected. 242 + */ 243 + switch (current_cpu_type()) { 244 + case CPU_INTERAPTIV: 245 + case CPU_PROAPTIV: 246 + return -1; 247 + } 248 + 249 + return irq_create_mapping(gic_irq_domain, 250 + GIC_LOCAL_TO_HWIRQ(GIC_LOCAL_INT_FDC)); 251 + } 252 + 230 253 static void gic_handle_shared_int(void) 231 254 { 232 255 unsigned int i, intr, virq;
+1
include/linux/irqchip/mips-gic.h
··· 251 251 extern unsigned int plat_ipi_resched_int_xlate(unsigned int); 252 252 extern int gic_get_c0_compare_int(void); 253 253 extern int gic_get_c0_perfcount_int(void); 254 + extern int gic_get_c0_fdc_int(void); 254 255 #endif /* __LINUX_IRQCHIP_MIPS_GIC_H */