diff options
Diffstat (limited to 'arch/arm/mach-omap2/timer-gp.c')
-rw-r--r-- | arch/arm/mach-omap2/timer-gp.c | 41 |
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 | ||
250 | static void __init omap2_gp_timer_init(void) | 250 | #define OMAP_SYS_TIMER_INIT(name) \ |
251 | static 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) \ | ||
259 | struct sys_timer omap##name##_timer = { \ | ||
260 | .init = omap##name##_timer_init, \ | ||
261 | }; | ||
262 | |||
263 | #ifdef CONFIG_ARCH_OMAP2 | ||
264 | OMAP_SYS_TIMER_INIT(2) | ||
265 | OMAP_SYS_TIMER(2) | ||
266 | #endif | ||
267 | |||
268 | #ifdef CONFIG_ARCH_OMAP3 | ||
269 | OMAP_SYS_TIMER_INIT(3) | ||
270 | OMAP_SYS_TIMER(3) | ||
271 | OMAP_SYS_TIMER_INIT(3_secure) | ||
272 | OMAP_SYS_TIMER(3_secure) | ||
273 | #endif | ||
274 | |||
275 | #ifdef CONFIG_ARCH_OMAP4 | ||
276 | static 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 | 286 | OMAP_SYS_TIMER(4) | |
264 | struct sys_timer omap_timer = { | 287 | #endif |
265 | .init = omap2_gp_timer_init, | ||
266 | }; | ||