One-shot mode was broken in MPU-timer support for OMAP1 due to a typo.
Also, ensure timer is stopped before changing the auto-reload flag.
The TRM says changing the AR flag when timer is running is undefined.
Also set GENERIC_CLOCKEVENTS for all omaps.
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Kevin Hilman <khilman@mvista.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
bool "TI OMAP"
select GENERIC_GPIO
select GENERIC_TIME
bool "TI OMAP"
select GENERIC_GPIO
select GENERIC_TIME
+ select GENERIC_CLOCKEVENTS
help
Support for TI's OMAP platform (OMAP1 and OMAP2).
help
Support for TI's OMAP platform (OMAP1 and OMAP2).
timer->cntl = timerflags;
}
timer->cntl = timerflags;
}
+static inline void omap_mpu_timer_stop(int nr)
+{
+ volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
+
+ timer->cntl &= ~MPU_TIMER_ST;
+}
+
/*
* ---------------------------------------------------------------------------
* MPU timer 1 ... count down to zero, interrupt, reload
* ---------------------------------------------------------------------------
*/
static int omap_mpu_set_next_event(unsigned long cycles,
/*
* ---------------------------------------------------------------------------
* MPU timer 1 ... count down to zero, interrupt, reload
* ---------------------------------------------------------------------------
*/
static int omap_mpu_set_next_event(unsigned long cycles,
- struct clock_event_device *evt)
+ struct clock_event_device *evt)
{
omap_mpu_timer_start(0, cycles, 0);
return 0;
{
omap_mpu_timer_start(0, cycles, 0);
return 0;
omap_mpu_set_autoreset(0);
break;
case CLOCK_EVT_MODE_ONESHOT:
omap_mpu_set_autoreset(0);
break;
case CLOCK_EVT_MODE_ONESHOT:
+ omap_mpu_timer_stop(0);
omap_mpu_remove_autoreset(0);
break;
case CLOCK_EVT_MODE_UNUSED:
omap_mpu_remove_autoreset(0);
break;
case CLOCK_EVT_MODE_UNUSED:
config ARCH_OMAP1
bool "TI OMAP1"
config ARCH_OMAP1
bool "TI OMAP1"
- select GENERIC_CLOCKEVENTS
config ARCH_OMAP2
bool "TI OMAP2"
config ARCH_OMAP2
bool "TI OMAP2"