diff options
-rw-r--r-- | arch/arm/mach-omap1/time.c | 23 | ||||
-rw-r--r-- | arch/arm/plat-omap/Kconfig | 1 |
2 files changed, 7 insertions, 17 deletions
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index e7ab61625b44..03e1e1062ad4 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c | |||
@@ -190,24 +190,11 @@ static __init void omap_init_mpu_timer(unsigned long rate) | |||
190 | * --------------------------------------------------------------------------- | 190 | * --------------------------------------------------------------------------- |
191 | */ | 191 | */ |
192 | 192 | ||
193 | static cycle_t mpu_read(struct clocksource *cs) | ||
194 | { | ||
195 | return ~omap_mpu_timer_read(1); | ||
196 | } | ||
197 | |||
198 | static struct clocksource clocksource_mpu = { | ||
199 | .name = "mpu_timer2", | ||
200 | .rating = 300, | ||
201 | .read = mpu_read, | ||
202 | .mask = CLOCKSOURCE_MASK(32), | ||
203 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | ||
204 | }; | ||
205 | |||
206 | static DEFINE_CLOCK_DATA(cd); | 193 | static DEFINE_CLOCK_DATA(cd); |
207 | 194 | ||
208 | static inline unsigned long long notrace _omap_mpu_sched_clock(void) | 195 | static inline unsigned long long notrace _omap_mpu_sched_clock(void) |
209 | { | 196 | { |
210 | u32 cyc = mpu_read(&clocksource_mpu); | 197 | u32 cyc = ~omap_mpu_timer_read(1); |
211 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); | 198 | return cyc_to_sched_clock(&cd, cyc, (u32)~0); |
212 | } | 199 | } |
213 | 200 | ||
@@ -225,20 +212,22 @@ static unsigned long long notrace omap_mpu_sched_clock(void) | |||
225 | 212 | ||
226 | static void notrace mpu_update_sched_clock(void) | 213 | static void notrace mpu_update_sched_clock(void) |
227 | { | 214 | { |
228 | u32 cyc = mpu_read(&clocksource_mpu); | 215 | u32 cyc = ~omap_mpu_timer_read(1); |
229 | update_sched_clock(&cd, cyc, (u32)~0); | 216 | update_sched_clock(&cd, cyc, (u32)~0); |
230 | } | 217 | } |
231 | 218 | ||
232 | static void __init omap_init_clocksource(unsigned long rate) | 219 | static void __init omap_init_clocksource(unsigned long rate) |
233 | { | 220 | { |
221 | omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(1); | ||
234 | static char err[] __initdata = KERN_ERR | 222 | static char err[] __initdata = KERN_ERR |
235 | "%s: can't register clocksource!\n"; | 223 | "%s: can't register clocksource!\n"; |
236 | 224 | ||
237 | omap_mpu_timer_start(1, ~0, 1); | 225 | omap_mpu_timer_start(1, ~0, 1); |
238 | init_sched_clock(&cd, mpu_update_sched_clock, 32, rate); | 226 | init_sched_clock(&cd, mpu_update_sched_clock, 32, rate); |
239 | 227 | ||
240 | if (clocksource_register_hz(&clocksource_mpu, rate)) | 228 | if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate, |
241 | printk(err, clocksource_mpu.name); | 229 | 300, 32, clocksource_mmio_readl_down)) |
230 | printk(err, "mpu_timer2"); | ||
242 | } | 231 | } |
243 | 232 | ||
244 | static void __init omap_mpu_timer_init(void) | 233 | static void __init omap_mpu_timer_init(void) |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index cd5f993612fd..e9c0efc5d4af 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -12,6 +12,7 @@ choice | |||
12 | config ARCH_OMAP1 | 12 | config ARCH_OMAP1 |
13 | bool "TI OMAP1" | 13 | bool "TI OMAP1" |
14 | select CLKDEV_LOOKUP | 14 | select CLKDEV_LOOKUP |
15 | select CLKSRC_MMIO | ||
15 | help | 16 | help |
16 | "Systems based on omap7xx, omap15xx or omap16xx" | 17 | "Systems based on omap7xx, omap15xx or omap16xx" |
17 | 18 | ||