aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-10-29 14:23:43 +0000
committerRalf Baechle <ralf@linux-mips.org>2007-10-29 19:35:36 +0000
commit38760d40ca61b18b2809e9c28df8b3ff9af8a02b (patch)
treedd65b99f1ae919498808506121a2b75217997713 /arch/mips/kernel
parent1238d5d868a56dcbc743d3ffc9bd3c920258b4cb (diff)
[MIPS] time: Replace plat_timer_setup with modern APIs.
plat_timer_setup is no longer getting called. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/cevt-r4k.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index a59f67ff301..bab935a3d74 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -224,7 +224,7 @@ void __cpuinit mips_clockevent_init(void)
uint64_t mips_freq = mips_hpt_frequency;
unsigned int cpu = smp_processor_id();
struct clock_event_device *cd;
- unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
+ unsigned int irq;
if (!cpu_has_counter || !mips_hpt_frequency)
return;
@@ -243,6 +243,15 @@ void __cpuinit mips_clockevent_init(void)
if (!c0_compare_int_usable())
return;
+ /*
+ * 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 it's liking.
+ */
+ irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
+ if (get_c0_compare_int)
+ irq = get_c0_compare_int();
+
cd = &per_cpu(mips_clockevent_device, cpu);
cd->name = "MIPS";
@@ -267,13 +276,15 @@ void __cpuinit mips_clockevent_init(void)
clockevents_register_device(cd);
- if (!cp0_timer_irq_installed) {
+ if (!cp0_timer_irq_installed)
+ return;
+
+ cp0_timer_irq_installed = 1;
+
#ifdef CONFIG_MIPS_MT_SMTC
#define CPUCTR_IMASKBIT (0x100 << cp0_compare_irq)
- setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);
+ setup_irq_smtc(irq, &c0_compare_irqaction, CPUCTR_IMASKBIT);
#else
- setup_irq(irq, &c0_compare_irqaction);
-#endif /* CONFIG_MIPS_MT_SMTC */
- cp0_timer_irq_installed = 1;
- }
+ setup_irq(irq, &c0_compare_irqaction);
+#endif
}