aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-03-29 18:54:49 -0400
committerTony Lindgren <tony@atomide.com>2011-06-27 15:14:01 -0400
commit11a0186f3ef6aa6a9b8b81f5a501b6063fa47500 (patch)
treecf48a0045d12479cc3a747e35b3b35ed93ba208c
parent98e182a26bbbf5575457622337684ef61493e864 (diff)
omap2+: Reserve clocksource and timesource and initialize dmtimer later
There's no need to initialize the dmtimer framework early. Just mark the clocksource and timesource as reserved, and initialize dmtimer with an arch_initcall. Signed-off-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--arch/arm/mach-omap1/timer32k.c4
-rw-r--r--arch/arm/mach-omap2/timer-gp.c6
-rw-r--r--arch/arm/plat-omap/dmtimer.c10
-rw-r--r--arch/arm/plat-omap/include/plat/dmtimer.h3
4 files changed, 14 insertions, 9 deletions
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 13d7b8f145bd..96604a50c4fe 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -183,10 +183,6 @@ static __init void omap_init_32k_timer(void)
183bool __init omap_32k_timer_init(void) 183bool __init omap_32k_timer_init(void)
184{ 184{
185 omap_init_clocksource_32k(); 185 omap_init_clocksource_32k();
186
187#ifdef CONFIG_OMAP_DM_TIMER
188 omap_dm_timer_init();
189#endif
190 omap_init_32k_timer(); 186 omap_init_32k_timer();
191 187
192 return true; 188 return true;
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 578e9df4fdea..cf2ec85b95fa 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -69,6 +69,8 @@
69/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ 69/* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
70#define MAX_GPTIMER_ID 12 70#define MAX_GPTIMER_ID 12
71 71
72u32 sys_timer_reserved;
73
72/* Clockevent code */ 74/* Clockevent code */
73 75
74static struct omap_dm_timer clkev; 76static struct omap_dm_timer clkev;
@@ -195,6 +197,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
195 197
196 omap_hwmod_enable(oh); 198 omap_hwmod_enable(oh);
197 199
200 sys_timer_reserved |= (1 << (gptimer_id - 1));
201
198 if (gptimer_id != 12) { 202 if (gptimer_id != 12) {
199 struct clk *src; 203 struct clk *src;
200 204
@@ -321,7 +325,6 @@ static void __init omap2_gp_clocksource_init(void)
321#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src) \ 325#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src) \
322static void __init omap##name##_timer_init(void) \ 326static void __init omap##name##_timer_init(void) \
323{ \ 327{ \
324 omap_dm_timer_init(); \
325 omap2_gp_clockevent_init((clkev_nr), clkev_src); \ 328 omap2_gp_clockevent_init((clkev_nr), clkev_src); \
326 omap2_gp_clocksource_init(); \ 329 omap2_gp_clocksource_init(); \
327} 330}
@@ -350,7 +353,6 @@ static void __init omap4_timer_init(void)
350 twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); 353 twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
351 BUG_ON(!twd_base); 354 BUG_ON(!twd_base);
352#endif 355#endif
353 omap_dm_timer_init();
354 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); 356 omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE);
355 omap2_gp_clocksource_init(); 357 omap2_gp_clocksource_init();
356} 358}
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 7c5cb4e128f2..8dfb8186b2c2 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -572,7 +572,7 @@ int omap_dm_timers_active(void)
572} 572}
573EXPORT_SYMBOL_GPL(omap_dm_timers_active); 573EXPORT_SYMBOL_GPL(omap_dm_timers_active);
574 574
575int __init omap_dm_timer_init(void) 575static int __init omap_dm_timer_init(void)
576{ 576{
577 struct omap_dm_timer *timer; 577 struct omap_dm_timer *timer;
578 int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ 578 int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */
@@ -625,8 +625,16 @@ int __init omap_dm_timer_init(void)
625 sprintf(clk_name, "gpt%d_fck", i + 1); 625 sprintf(clk_name, "gpt%d_fck", i + 1);
626 timer->fclk = clk_get(NULL, clk_name); 626 timer->fclk = clk_get(NULL, clk_name);
627 } 627 }
628
629 /* One or two timers may be set up early for sys_timer */
630 if (sys_timer_reserved & (1 << i)) {
631 timer->reserved = 1;
632 timer->posted = 1;
633 }
628#endif 634#endif
629 } 635 }
630 636
631 return 0; 637 return 0;
632} 638}
639
640arch_initcall(omap_dm_timer_init);
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h
index 8adcb187fe71..d0f3a2d22fd3 100644
--- a/arch/arm/plat-omap/include/plat/dmtimer.h
+++ b/arch/arm/plat-omap/include/plat/dmtimer.h
@@ -61,8 +61,6 @@
61struct omap_dm_timer; 61struct omap_dm_timer;
62struct clk; 62struct clk;
63 63
64int omap_dm_timer_init(void);
65
66struct omap_dm_timer *omap_dm_timer_request(void); 64struct omap_dm_timer *omap_dm_timer_request(void);
67struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 65struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id);
68void omap_dm_timer_free(struct omap_dm_timer *timer); 66void omap_dm_timer_free(struct omap_dm_timer *timer);
@@ -221,6 +219,7 @@ struct omap_dm_timer {
221 unsigned posted:1; 219 unsigned posted:1;
222}; 220};
223 221
222extern u32 sys_timer_reserved;
224void omap_dm_timer_prepare(struct omap_dm_timer *timer); 223void omap_dm_timer_prepare(struct omap_dm_timer *timer);
225 224
226static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg, 225static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg,