aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/timer.c')
-rw-r--r--arch/arm/mach-omap2/timer.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index b8ad6e632bb8..afaeff4920ab 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -552,7 +552,7 @@ static inline void __init realtime_counter_init(void)
552 552
553#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ 553#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
554 clksrc_nr, clksrc_src) \ 554 clksrc_nr, clksrc_src) \
555static void __init omap##name##_gptimer_timer_init(void) \ 555void __init omap##name##_gptimer_timer_init(void) \
556{ \ 556{ \
557 omap_dmtimer_init(); \ 557 omap_dmtimer_init(); \
558 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 558 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
@@ -561,7 +561,7 @@ static void __init omap##name##_gptimer_timer_init(void) \
561 561
562#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \ 562#define OMAP_SYS_32K_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
563 clksrc_nr, clksrc_src) \ 563 clksrc_nr, clksrc_src) \
564static void __init omap##name##_sync32k_timer_init(void) \ 564void __init omap##name##_sync32k_timer_init(void) \
565{ \ 565{ \
566 omap_dmtimer_init(); \ 566 omap_dmtimer_init(); \
567 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \ 567 omap2_gp_clockevent_init((clkev_nr), clkev_src, clkev_prop); \
@@ -572,33 +572,23 @@ static void __init omap##name##_sync32k_timer_init(void) \
572 omap2_sync32k_clocksource_init(); \ 572 omap2_sync32k_clocksource_init(); \
573} 573}
574 574
575#define OMAP_SYS_TIMER(name, clksrc) \
576struct sys_timer omap##name##_timer = { \
577 .init = omap##name##_##clksrc##_timer_init, \
578};
579
580#ifdef CONFIG_ARCH_OMAP2 575#ifdef CONFIG_ARCH_OMAP2
581OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon", 576OMAP_SYS_32K_TIMER_INIT(2, 1, OMAP2_32K_SOURCE, "ti,timer-alwon",
582 2, OMAP2_MPU_SOURCE); 577 2, OMAP2_MPU_SOURCE);
583OMAP_SYS_TIMER(2, sync32k);
584#endif /* CONFIG_ARCH_OMAP2 */ 578#endif /* CONFIG_ARCH_OMAP2 */
585 579
586#ifdef CONFIG_ARCH_OMAP3 580#ifdef CONFIG_ARCH_OMAP3
587OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon", 581OMAP_SYS_32K_TIMER_INIT(3, 1, OMAP3_32K_SOURCE, "ti,timer-alwon",
588 2, OMAP3_MPU_SOURCE); 582 2, OMAP3_MPU_SOURCE);
589OMAP_SYS_TIMER(3, sync32k);
590OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure", 583OMAP_SYS_32K_TIMER_INIT(3_secure, 12, OMAP3_32K_SOURCE, "ti,timer-secure",
591 2, OMAP3_MPU_SOURCE); 584 2, OMAP3_MPU_SOURCE);
592OMAP_SYS_TIMER(3_secure, sync32k);
593OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon", 585OMAP_SYS_GP_TIMER_INIT(3_gp, 1, OMAP3_MPU_SOURCE, "ti,timer-alwon",
594 2, OMAP3_MPU_SOURCE); 586 2, OMAP3_MPU_SOURCE);
595OMAP_SYS_TIMER(3_gp, gptimer);
596#endif /* CONFIG_ARCH_OMAP3 */ 587#endif /* CONFIG_ARCH_OMAP3 */
597 588
598#ifdef CONFIG_SOC_AM33XX 589#ifdef CONFIG_SOC_AM33XX
599OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon", 590OMAP_SYS_GP_TIMER_INIT(3_am33xx, 1, OMAP4_MPU_SOURCE, "ti,timer-alwon",
600 2, OMAP4_MPU_SOURCE); 591 2, OMAP4_MPU_SOURCE);
601OMAP_SYS_TIMER(3_am33xx, gptimer);
602#endif /* CONFIG_SOC_AM33XX */ 592#endif /* CONFIG_SOC_AM33XX */
603 593
604#ifdef CONFIG_ARCH_OMAP4 594#ifdef CONFIG_ARCH_OMAP4
@@ -606,7 +596,7 @@ OMAP_SYS_32K_TIMER_INIT(4, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
606 2, OMAP4_MPU_SOURCE); 596 2, OMAP4_MPU_SOURCE);
607#ifdef CONFIG_LOCAL_TIMERS 597#ifdef CONFIG_LOCAL_TIMERS
608static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29); 598static DEFINE_TWD_LOCAL_TIMER(twd_local_timer, OMAP44XX_LOCAL_TWD_BASE, 29);
609static void __init omap4_local_timer_init(void) 599void __init omap4_local_timer_init(void)
610{ 600{
611 omap4_sync32k_timer_init(); 601 omap4_sync32k_timer_init();
612 /* Local timers are not supprted on OMAP4430 ES1.0 */ 602 /* Local timers are not supprted on OMAP4430 ES1.0 */
@@ -624,18 +614,17 @@ static void __init omap4_local_timer_init(void)
624 } 614 }
625} 615}
626#else /* CONFIG_LOCAL_TIMERS */ 616#else /* CONFIG_LOCAL_TIMERS */
627static void __init omap4_local_timer_init(void) 617void __init omap4_local_timer_init(void)
628{ 618{
629 omap4_sync32k_timer_init(); 619 omap4_sync32k_timer_init();
630} 620}
631#endif /* CONFIG_LOCAL_TIMERS */ 621#endif /* CONFIG_LOCAL_TIMERS */
632OMAP_SYS_TIMER(4, local);
633#endif /* CONFIG_ARCH_OMAP4 */ 622#endif /* CONFIG_ARCH_OMAP4 */
634 623
635#ifdef CONFIG_SOC_OMAP5 624#ifdef CONFIG_SOC_OMAP5
636OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon", 625OMAP_SYS_32K_TIMER_INIT(5, 1, OMAP4_32K_SOURCE, "ti,timer-alwon",
637 2, OMAP4_MPU_SOURCE); 626 2, OMAP4_MPU_SOURCE);
638static void __init omap5_realtime_timer_init(void) 627void __init omap5_realtime_timer_init(void)
639{ 628{
640 int err; 629 int err;
641 630
@@ -646,7 +635,6 @@ static void __init omap5_realtime_timer_init(void)
646 if (err) 635 if (err)
647 pr_err("%s: arch_timer_register failed %d\n", __func__, err); 636 pr_err("%s: arch_timer_register failed %d\n", __func__, err);
648} 637}
649OMAP_SYS_TIMER(5, realtime);
650#endif /* CONFIG_SOC_OMAP5 */ 638#endif /* CONFIG_SOC_OMAP5 */
651 639
652/** 640/**