summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/time.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-01-18 12:42:23 -0800
committerTony Lindgren <tony@atomide.com>2011-01-19 10:38:43 -0800
commit05b5ca9b100300c8b98429962071aa66c5d2460e (patch)
tree643c3a38bd271997c61a58d59ccdbebc1f6beb28 /arch/arm/mach-omap1/time.c
parentf376ea1780085196fcfff6bc27e8f6ddb324ae57 (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.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 a39a15e4f3f..b03f34d55d8 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -57,6 +57,8 @@
#include <plat/common.h>
+#ifdef CONFIG_OMAP_MPU_TIMER
+
#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
#define OMAP_MPU_TIMER_OFFSET 0x100
@@ -236,12 +238,7 @@ static void __init omap_init_clocksource(unsigned long rate)
printk(err, clocksource_mpu.name);
}
-/*
- * ---------------------------------------------------------------------------
- * Timer initialization
- * ---------------------------------------------------------------------------
- */
-static void __init omap_timer_init(void)
+static void __init omap_mpu_timer_init(void)
{
struct clk *ck_ref = clk_get(NULL, "ck_ref");
unsigned long rate;
@@ -256,13 +253,38 @@ static void __init omap_timer_init(void)
omap_init_mpu_timer(rate);
omap_init_clocksource(rate);
- /*
- * XXX Since this file seems to deal mostly with the MPU timer,
- * this doesn't seem like the correct place for the sync timer
- * clocksource init.
- */
- if (!cpu_is_omap7xx() && !cpu_is_omap15xx())
- omap_init_clocksource_32k();
+}
+
+#else
+static inline void omap_mpu_timer_init(void)
+{
+ pr_err("Bogus timer, should not happen\n");
+}
+#endif /* CONFIG_OMAP_MPU_TIMER */
+
+static inline int omap_32k_timer_usable(void)
+{
+ int res = false;
+
+ if (cpu_is_omap730() || cpu_is_omap15xx())
+ return res;
+
+#ifdef CONFIG_OMAP_32K_TIMER
+ res = omap_32k_timer_init();
+#endif
+
+ return res;
+}
+
+/*
+ * ---------------------------------------------------------------------------
+ * Timer initialization
+ * ---------------------------------------------------------------------------
+ */
+static void __init omap_timer_init(void)
+{
+ if (!omap_32k_timer_usable())
+ omap_mpu_timer_init();
}
struct sys_timer omap_timer = {