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