Commit bb9ea778 authored by Linus Walleij's avatar Linus Walleij Committed by Russell King

ARM: 7081/1: mach-integrator: fix the clocksource

I was intrigued by the fact that the clock stood still on
the Integrator, but it wasn't strange at all, because the
timer was set up all wrong and probably has been for a
while. With this patch the clock starts ticking again:
make the timer periodic (reload), |= on the divisor bit
and load the timer before starting it.

Cc: stable@kernel.org
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 1df726ef
...@@ -337,15 +337,15 @@ static unsigned long timer_reload; ...@@ -337,15 +337,15 @@ static unsigned long timer_reload;
static void integrator_clocksource_init(u32 khz) static void integrator_clocksource_init(u32 khz)
{ {
void __iomem *base = (void __iomem *)TIMER2_VA_BASE; void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
u32 ctrl = TIMER_CTRL_ENABLE; u32 ctrl = TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC;
if (khz >= 1500) { if (khz >= 1500) {
khz /= 16; khz /= 16;
ctrl = TIMER_CTRL_DIV16; ctrl |= TIMER_CTRL_DIV16;
} }
writel(ctrl, base + TIMER_CTRL);
writel(0xffff, base + TIMER_LOAD); writel(0xffff, base + TIMER_LOAD);
writel(ctrl, base + TIMER_CTRL);
clocksource_mmio_init(base + TIMER_VALUE, "timer2", clocksource_mmio_init(base + TIMER_VALUE, "timer2",
khz * 1000, 200, 16, clocksource_mmio_readl_down); khz * 1000, 200, 16, clocksource_mmio_readl_down);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment