diff options
author | Nicolas Pitre <nico@cam.org> | 2005-11-08 17:43:06 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-08 17:43:06 -0500 |
commit | 5285eb57c9a20d8df2569c770ff6048c3202cc91 (patch) | |
tree | 51fa28b1941def4d0ec92f7cd4046ffa2c0bc63d /arch/arm/mach-pxa | |
parent | d07ad967e3c1cb955c4f9ee6a4eba4e6e1edb1e8 (diff) |
[ARM] 3135/1: harden SA11x0 and PXA2xx timer init code
Patch from Nicolas Pitre
Make it completely deterministic and leave nothing to chance
(even if it had at worst 0.001% probability of failing).
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/time.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index 7dad3f1465e0..b9b2057349eb 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c | |||
@@ -132,11 +132,13 @@ static void __init pxa_timer_init(void) | |||
132 | tv.tv_sec = pxa_get_rtc_time(); | 132 | tv.tv_sec = pxa_get_rtc_time(); |
133 | do_settimeofday(&tv); | 133 | do_settimeofday(&tv); |
134 | 134 | ||
135 | OSMR0 = 0; /* set initial match at 0 */ | 135 | OIER = 0; /* disable any timer interrupts */ |
136 | OSCR = LATCH*2; /* push OSCR out of the way */ | ||
137 | OSMR0 = LATCH; /* set initial match */ | ||
136 | OSSR = 0xf; /* clear status on all timers */ | 138 | OSSR = 0xf; /* clear status on all timers */ |
137 | setup_irq(IRQ_OST0, &pxa_timer_irq); | 139 | setup_irq(IRQ_OST0, &pxa_timer_irq); |
138 | OIER |= OIER_E0; /* enable match on timer 0 to cause interrupts */ | 140 | OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */ |
139 | OSCR = 0; /* initialize free-running timer, force first match */ | 141 | OSCR = 0; /* initialize free-running timer */ |
140 | } | 142 | } |
141 | 143 | ||
142 | #ifdef CONFIG_NO_IDLE_HZ | 144 | #ifdef CONFIG_NO_IDLE_HZ |