aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k/platform/coldfire/timers.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2011-12-24 14:36:27 +1000
committerGreg Ungerer <gerg@uclinux.org>2012-03-05 09:43:10 +1000
commit440f6ffc061a84e81386a093c07af8a429c18702 (patch)
treea5c202d9b43364b57acbef2e9e745c78c8d1b79e /arch/m68k/platform/coldfire/timers.c
parentm68knommu: clean up init code in ColdFire 532x startup (diff)
downloadlinux-dev-440f6ffc061a84e81386a093c07af8a429c18702.tar.xz
linux-dev-440f6ffc061a84e81386a093c07af8a429c18702.zip
m68knommu: move old ColdFire timers init from CPU init to timers code
The original ColdFire timer interrupt setup is used by most of the users of the original ColdFire timer code. But the code is currently duplicated in each of the ColdFire CPU specific init files. Move it to the timers code that it is really part of. It is strait forward to make it conditional on also having the original interrupt engine that it needs. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/platform/coldfire/timers.c')
-rw-r--r--arch/m68k/platform/coldfire/timers.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/m68k/platform/coldfire/timers.c b/arch/m68k/platform/coldfire/timers.c
index d0b4e9798fde..ed96ce50d79f 100644
--- a/arch/m68k/platform/coldfire/timers.c
+++ b/arch/m68k/platform/coldfire/timers.c
@@ -51,6 +51,25 @@ static irq_handler_t timer_interrupt;
/***************************************************************************/
+static void init_timer_irq(void)
+{
+#ifdef MCFSIM_ICR_AUTOVEC
+ /* Timer1 is always used as system timer */
+ writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
+ MCF_MBAR + MCFSIM_TIMER1ICR);
+ mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
+
+#ifdef CONFIG_HIGHPROFILE
+ /* Timer2 is to be used as a high speed profile timer */
+ writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
+ MCF_MBAR + MCFSIM_TIMER2ICR);
+ mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
+#endif
+#endif /* MCFSIM_ICR_AUTOVEC */
+}
+
+/***************************************************************************/
+
static irqreturn_t mcftmr_tick(int irq, void *dummy)
{
/* Reset the ColdFire timer */
@@ -113,6 +132,7 @@ void hw_timer_init(irq_handler_t handler)
clocksource_register_hz(&mcftmr_clk, FREQ);
timer_interrupt = handler;
+ init_timer_irq();
setup_irq(MCF_IRQ_TIMER, &mcftmr_timer_irq);
#ifdef CONFIG_HIGHPROFILE