diff options
author | Kevin Hilman <khilman@mvista.com> | 2007-10-19 02:04:43 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-03-20 10:56:09 -0400 |
commit | 06cad098d28e02d2ee3ed587bb261377e4ae2f17 (patch) | |
tree | 3fcea2c58607af9dc5a6c5849f529b0b0df0d7b3 /arch/arm | |
parent | 457fb605834504af294916411be128a9b21fc3f6 (diff) |
ARM: OMAP: Fix clockevent support for hrtimers
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap1/time.c | 10 | ||||
-rw-r--r-- | arch/arm/plat-omap/Kconfig | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 955fc53c1c01..4039a133006e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -469,6 +469,7 @@ config ARCH_OMAP | |||
469 | bool "TI OMAP" | 469 | bool "TI OMAP" |
470 | select GENERIC_GPIO | 470 | select GENERIC_GPIO |
471 | select GENERIC_TIME | 471 | select GENERIC_TIME |
472 | select GENERIC_CLOCKEVENTS | ||
472 | help | 473 | help |
473 | Support for TI's OMAP platform (OMAP1 and OMAP2). | 474 | Support for TI's OMAP platform (OMAP1 and OMAP2). |
474 | 475 | ||
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 237651ebae5d..572a2dbc72ab 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -132,13 +132,20 @@ static inline void omap_mpu_timer_start(int nr, unsigned long load_val, | |||
132 | timer->cntl = timerflags; | 132 | timer->cntl = timerflags; |
133 | } | 133 | } |
134 | 134 | ||
135 | static inline void omap_mpu_timer_stop(int nr) | ||
136 | { | ||
137 | volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); | ||
138 | |||
139 | timer->cntl &= ~MPU_TIMER_ST; | ||
140 | } | ||
141 | |||
135 | /* | 142 | /* |
136 | * --------------------------------------------------------------------------- | 143 | * --------------------------------------------------------------------------- |
137 | * MPU timer 1 ... count down to zero, interrupt, reload | 144 | * MPU timer 1 ... count down to zero, interrupt, reload |
138 | * --------------------------------------------------------------------------- | 145 | * --------------------------------------------------------------------------- |
139 | */ | 146 | */ |
140 | static int omap_mpu_set_next_event(unsigned long cycles, | 147 | static int omap_mpu_set_next_event(unsigned long cycles, |
141 | struct clock_event_device *evt) | 148 | struct clock_event_device *evt) |
142 | { | 149 | { |
143 | omap_mpu_timer_start(0, cycles, 0); | 150 | omap_mpu_timer_start(0, cycles, 0); |
144 | return 0; | 151 | return 0; |
@@ -152,6 +159,7 @@ static void omap_mpu_set_mode(enum clock_event_mode mode, | |||
152 | omap_mpu_set_autoreset(0); | 159 | omap_mpu_set_autoreset(0); |
153 | break; | 160 | break; |
154 | case CLOCK_EVT_MODE_ONESHOT: | 161 | case CLOCK_EVT_MODE_ONESHOT: |
162 | omap_mpu_timer_stop(0); | ||
155 | omap_mpu_remove_autoreset(0); | 163 | omap_mpu_remove_autoreset(0); |
156 | break; | 164 | break; |
157 | case CLOCK_EVT_MODE_UNUSED: | 165 | case CLOCK_EVT_MODE_UNUSED: |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index c1f7e5a819a3..b917206ee906 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -11,7 +11,6 @@ choice | |||
11 | 11 | ||
12 | config ARCH_OMAP1 | 12 | config ARCH_OMAP1 |
13 | bool "TI OMAP1" | 13 | bool "TI OMAP1" |
14 | select GENERIC_CLOCKEVENTS | ||
15 | 14 | ||
16 | config ARCH_OMAP2 | 15 | config ARCH_OMAP2 |
17 | bool "TI OMAP2" | 16 | bool "TI OMAP2" |