ramips: adapted cevt-r4k irq patches

Fixes: #13251
This commit is contained in:
coolsnowwolf 2024-09-16 23:02:40 +08:00
parent b522d5bdb9
commit ccb92beeda
2 changed files with 40 additions and 6 deletions

View File

@ -73,11 +73,28 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
unsigned int cpu = smp_processor_id();
struct clock_event_device *cd;
unsigned int irq, min_delta;
@@ -326,11 +353,16 @@ int r4k_clockevent_init(void)
@@ -303,6 +330,15 @@ int r4k_clockevent_init(void)
if (!c0_compare_int_usable())
return -ENXIO;
+#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+ /*
+ * With vectored interrupts things are getting platform specific.
+ * get_c0_compare_int is a hook to allow a platform to return the
+ * interrupt number of its liking.
+ */
+ irq = get_c0_compare_int();
+#endif
+
cd = &per_cpu(mips_clockevent_device, cpu);
cd->name = "MIPS";
@@ -314,11 +350,17 @@ int r4k_clockevent_init(void)
cd->rating = 300;
cd->irq = irq;
cd->cpumask = cpumask_of(cpu);
+#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+ cd->irq = irq;
+ cd->set_state_shutdown = mips_state_shutdown;
+ cd->set_state_oneshot = mips_state_oneshot;
+#endif
@ -90,7 +107,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (cp0_timer_irq_installed)
return 0;
@@ -339,6 +371,7 @@ int r4k_clockevent_init(void)
@@ -334,6 +376,7 @@ int r4k_clockevent_init(void)
if (request_irq(irq, c0_compare_interrupt, flags, "timer",
c0_compare_interrupt))
pr_err("Failed to request irq %d (timer)\n", irq);

View File

@ -73,11 +73,28 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
unsigned int cpu = smp_processor_id();
struct clock_event_device *cd;
unsigned int irq, min_delta;
@@ -322,11 +349,16 @@ int r4k_clockevent_init(void)
@@ -303,6 +330,15 @@ int r4k_clockevent_init(void)
if (!c0_compare_int_usable())
return -ENXIO;
+#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+ /*
+ * With vectored interrupts things are getting platform specific.
+ * get_c0_compare_int is a hook to allow a platform to return the
+ * interrupt number of its liking.
+ */
+ irq = get_c0_compare_int();
+#endif
+
cd = &per_cpu(mips_clockevent_device, cpu);
cd->name = "MIPS";
@@ -314,11 +350,17 @@ int r4k_clockevent_init(void)
cd->rating = 300;
cd->irq = irq;
cd->cpumask = cpumask_of(cpu);
+#ifdef CONFIG_CEVT_SYSTICK_QUIRK
+ cd->irq = irq;
+ cd->set_state_shutdown = mips_state_shutdown;
+ cd->set_state_oneshot = mips_state_oneshot;
+#endif
@ -90,7 +107,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (cp0_timer_irq_installed)
return 0;
@@ -335,6 +367,7 @@ int r4k_clockevent_init(void)
@@ -334,6 +376,7 @@ int r4k_clockevent_init(void)
if (request_irq(irq, c0_compare_interrupt, flags, "timer",
c0_compare_interrupt))
pr_err("Failed to request irq %d (timer)\n", irq);