aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-09-08 16:21:42 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-10-17 04:12:43 -0400
commit02f5632122ccbb6eb0c3b3f612b564b659defb32 (patch)
tree641f61b76c4a16b9d9f85422e8bda333d94ff767 /arch/arm
parent1b56b17f9903b6a17b8bb8d72d885f6d12b4d597 (diff)
ARM: 7085/2: mach-integrator: clockevent supports oneshot mode
The Integrator AP timer has no problem supporting oneshot ticks with proper code, so let's do it so we can have NOHZ configured in for this platform too. Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index aa30ab650183..e66a8bce3999 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -360,15 +360,29 @@ static void clkevt_set_mode(enum clock_event_mode mode, struct clock_event_devic
360{ 360{
361 u32 ctrl = readl(clkevt_base + TIMER_CTRL) & ~TIMER_CTRL_ENABLE; 361 u32 ctrl = readl(clkevt_base + TIMER_CTRL) & ~TIMER_CTRL_ENABLE;
362 362
363 BUG_ON(mode == CLOCK_EVT_MODE_ONESHOT); 363 /* Disable timer */
364 writel(ctrl, clkevt_base + TIMER_CTRL);
364 365
365 if (mode == CLOCK_EVT_MODE_PERIODIC) { 366 switch (mode) {
366 writel(ctrl, clkevt_base + TIMER_CTRL); 367 case CLOCK_EVT_MODE_PERIODIC:
368 /* Enable the timer and start the periodic tick */
367 writel(timer_reload, clkevt_base + TIMER_LOAD); 369 writel(timer_reload, clkevt_base + TIMER_LOAD);
368 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; 370 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
371 writel(ctrl, clkevt_base + TIMER_CTRL);
372 break;
373 case CLOCK_EVT_MODE_ONESHOT:
374 /* Leave the timer disabled, .set_next_event will enable it */
375 ctrl &= ~TIMER_CTRL_PERIODIC;
376 writel(ctrl, clkevt_base + TIMER_CTRL);
377 break;
378 case CLOCK_EVT_MODE_UNUSED:
379 case CLOCK_EVT_MODE_SHUTDOWN:
380 case CLOCK_EVT_MODE_RESUME:
381 default:
382 /* Just leave in disabled state */
383 break;
369 } 384 }
370 385
371 writel(ctrl, clkevt_base + TIMER_CTRL);
372} 386}
373 387
374static int clkevt_set_next_event(unsigned long next, struct clock_event_device *evt) 388static int clkevt_set_next_event(unsigned long next, struct clock_event_device *evt)
@@ -385,7 +399,7 @@ static int clkevt_set_next_event(unsigned long next, struct clock_event_device *
385static struct clock_event_device integrator_clockevent = { 399static struct clock_event_device integrator_clockevent = {
386 .name = "timer1", 400 .name = "timer1",
387 .shift = 34, 401 .shift = 34,
388 .features = CLOCK_EVT_FEAT_PERIODIC, 402 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
389 .set_mode = clkevt_set_mode, 403 .set_mode = clkevt_set_mode,
390 .set_next_event = clkevt_set_next_event, 404 .set_next_event = clkevt_set_next_event,
391 .rating = 300, 405 .rating = 300,