aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/time.c')
-rw-r--r--arch/arm/mach-omap1/time.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index a39a15e4f3f9..b03f34d55d88 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -57,6 +57,8 @@
57 57
58#include <plat/common.h> 58#include <plat/common.h>
59 59
60#ifdef CONFIG_OMAP_MPU_TIMER
61
60#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE 62#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
61#define OMAP_MPU_TIMER_OFFSET 0x100 63#define OMAP_MPU_TIMER_OFFSET 0x100
62 64
@@ -236,12 +238,7 @@ static void __init omap_init_clocksource(unsigned long rate)
236 printk(err, clocksource_mpu.name); 238 printk(err, clocksource_mpu.name);
237} 239}
238 240
239/* 241static void __init omap_mpu_timer_init(void)
240 * ---------------------------------------------------------------------------
241 * Timer initialization
242 * ---------------------------------------------------------------------------
243 */
244static void __init omap_timer_init(void)
245{ 242{
246 struct clk *ck_ref = clk_get(NULL, "ck_ref"); 243 struct clk *ck_ref = clk_get(NULL, "ck_ref");
247 unsigned long rate; 244 unsigned long rate;
@@ -256,13 +253,38 @@ static void __init omap_timer_init(void)
256 253
257 omap_init_mpu_timer(rate); 254 omap_init_mpu_timer(rate);
258 omap_init_clocksource(rate); 255 omap_init_clocksource(rate);
259 /* 256}
260 * XXX Since this file seems to deal mostly with the MPU timer, 257
261 * this doesn't seem like the correct place for the sync timer 258#else
262 * clocksource init. 259static inline void omap_mpu_timer_init(void)
263 */ 260{
264 if (!cpu_is_omap7xx() && !cpu_is_omap15xx()) 261 pr_err("Bogus timer, should not happen\n");
265 omap_init_clocksource_32k(); 262}
263#endif /* CONFIG_OMAP_MPU_TIMER */
264
265static inline int omap_32k_timer_usable(void)
266{
267 int res = false;
268
269 if (cpu_is_omap730() || cpu_is_omap15xx())
270 return res;
271
272#ifdef CONFIG_OMAP_32K_TIMER
273 res = omap_32k_timer_init();
274#endif
275
276 return res;
277}
278
279/*
280 * ---------------------------------------------------------------------------
281 * Timer initialization
282 * ---------------------------------------------------------------------------
283 */
284static void __init omap_timer_init(void)
285{
286 if (!omap_32k_timer_usable())
287 omap_mpu_timer_init();
266} 288}
267 289
268struct sys_timer omap_timer = { 290struct sys_timer omap_timer = {