aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform/5249/config.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2009-05-19 00:52:40 -0400
committerGreg Ungerer <gerg@uclinux.org>2009-09-15 19:43:51 -0400
commit04b75b10dceadf937e3707ecc3dfccf6a076fd29 (patch)
tree87965d12b8f7eb622efd1d36bebd2a7b8a26452e /arch/m68knommu/platform/5249/config.c
parentf9311f26434cea3e926f56ca2aa3e5740e962c72 (diff)
m68knommu: simplify ColdFire "timers" clock initialization
The ColdFire "timers" clock setup can be simplified. There is really no need for the flexible per-platform setup code. The clock interrupt can be hard defined per CPU platform (in CPU include files). This makes the actual timer code simpler. Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu/platform/5249/config.c')
-rw-r--r--arch/m68knommu/platform/5249/config.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
index 7261a3d28ad..51202b1096c 100644
--- a/arch/m68knommu/platform/5249/config.c
+++ b/arch/m68knommu/platform/5249/config.c
@@ -65,24 +65,19 @@ static void __init m5249_uarts_init(void)
65 m5249_uart_init_line(line, m5249_uart_platform[line].irq); 65 m5249_uart_init_line(line, m5249_uart_platform[line].irq);
66} 66}
67 67
68
69/***************************************************************************/ 68/***************************************************************************/
70 69
71void mcf_settimericr(unsigned int timer, unsigned int level) 70static void __init m5249_timers_init(void)
72{ 71{
73 volatile unsigned char *icrp; 72 /* Timer1 is always used as system timer */
74 unsigned int icr, imr; 73 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
75 74 MCF_MBAR + MCFSIM_TIMER1ICR);
76 if (timer <= 2) { 75
77 switch (timer) { 76#ifdef CONFIG_HIGHPROFILE
78 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFINTC_TIMER2; break; 77 /* Timer2 is to be used as a high speed profile timer */
79 default: icr = MCFSIM_TIMER1ICR; imr = MCFINTC_TIMER1; break; 78 writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
80 } 79 MCF_MBAR + MCFSIM_TIMER2ICR);
81 80#endif
82 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
83 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
84 mcf_clrimr(imr);
85 }
86} 81}
87 82
88/***************************************************************************/ 83/***************************************************************************/
@@ -101,6 +96,7 @@ void m5249_cpu_reset(void)
101void __init config_BSP(char *commandp, int size) 96void __init config_BSP(char *commandp, int size)
102{ 97{
103 mach_reset = m5249_cpu_reset; 98 mach_reset = m5249_cpu_reset;
99 m5249_timers_init();
104} 100}
105 101
106/***************************************************************************/ 102/***************************************************************************/