diff options
author | Tony Lindgren <tony@atomide.com> | 2011-01-18 15:42:23 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2011-01-19 13:38:43 -0500 |
commit | 05b5ca9b100300c8b98429962071aa66c5d2460e (patch) | |
tree | 643c3a38bd271997c61a58d59ccdbebc1f6beb28 /arch/arm/mach-omap1/time.c | |
parent | f376ea1780085196fcfff6bc27e8f6ddb324ae57 (diff) |
omap1: Fix booting for 15xx and 730 with omap1_defconfig
For omap15xx and 730 we need to use the MPU timer
as the 32K timer is not available. For omap16xx
we want to use the 32K timer because of PM. Fix this
by allowing to build in both timers.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/time.c')
-rw-r--r-- | arch/arm/mach-omap1/time.c | 48 |
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 | /* | 241 | static void __init omap_mpu_timer_init(void) |
240 | * --------------------------------------------------------------------------- | ||
241 | * Timer initialization | ||
242 | * --------------------------------------------------------------------------- | ||
243 | */ | ||
244 | static 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. | 259 | static 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 | |||
265 | static 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 | */ | ||
284 | static void __init omap_timer_init(void) | ||
285 | { | ||
286 | if (!omap_32k_timer_usable()) | ||
287 | omap_mpu_timer_init(); | ||
266 | } | 288 | } |
267 | 289 | ||
268 | struct sys_timer omap_timer = { | 290 | struct sys_timer omap_timer = { |