aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/timer-gp.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-03-29 18:54:48 -0400
committerTony Lindgren <tony@atomide.com>2011-06-20 04:25:39 -0400
commite74984e46e899c22137a385869fb4f3ae756e3df (patch)
tree2f40fe8d66afb676fefcf307b8df36b734c28ba3 /arch/arm/mach-omap2/timer-gp.c
parent741e3a89dee8a17aa9373975d51f130a65e1683d (diff)
omap: Set separate timer init functions to avoid cpu_is_omap tests
This is needed for the following patches so we can initialize the rest of the hardware timers later on. As with the init_irq calls, there's no need to do cpu_is_omap calls during the timer init as we only care about the major omap generation. This means that we can initialize the sys_timer with the .timer entries alone. Note that for now we just set stubs for the various sys_timer entries that will get populated in a later patch. The following patches will also remove the omap_dm_timer_init calls and change the init for the rest of the hardware timers to happen with an arch_initcall. Signed-off-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/timer-gp.c')
-rw-r--r--arch/arm/mach-omap2/timer-gp.c41
1 files changed, 31 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 3b9cf85f4bb9..a0d8e83594eb 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -247,20 +247,41 @@ static void __init omap2_gp_clocksource_init(void)
247} 247}
248#endif 248#endif
249 249
250static void __init omap2_gp_timer_init(void) 250#define OMAP_SYS_TIMER_INIT(name) \
251static void __init omap##name##_timer_init(void) \
252{ \
253 omap_dm_timer_init(); \
254 omap2_gp_clockevent_init(); \
255 omap2_gp_clocksource_init(); \
256}
257
258#define OMAP_SYS_TIMER(name) \
259struct sys_timer omap##name##_timer = { \
260 .init = omap##name##_timer_init, \
261};
262
263#ifdef CONFIG_ARCH_OMAP2
264OMAP_SYS_TIMER_INIT(2)
265OMAP_SYS_TIMER(2)
266#endif
267
268#ifdef CONFIG_ARCH_OMAP3
269OMAP_SYS_TIMER_INIT(3)
270OMAP_SYS_TIMER(3)
271OMAP_SYS_TIMER_INIT(3_secure)
272OMAP_SYS_TIMER(3_secure)
273#endif
274
275#ifdef CONFIG_ARCH_OMAP4
276static void __init omap4_timer_init(void)
251{ 277{
252#ifdef CONFIG_LOCAL_TIMERS 278#ifdef CONFIG_LOCAL_TIMERS
253 if (cpu_is_omap44xx()) { 279 twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256);
254 twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); 280 BUG_ON(!twd_base);
255 BUG_ON(!twd_base);
256 }
257#endif 281#endif
258 omap_dm_timer_init(); 282 omap_dm_timer_init();
259
260 omap2_gp_clockevent_init(); 283 omap2_gp_clockevent_init();
261 omap2_gp_clocksource_init(); 284 omap2_gp_clocksource_init();
262} 285}
263 286OMAP_SYS_TIMER(4)
264struct sys_timer omap_timer = { 287#endif
265 .init = omap2_gp_timer_init,
266};