diff options
Diffstat (limited to 'arch/arm/mach-spear3xx/clock.c')
-rw-r--r-- | arch/arm/mach-spear3xx/clock.c | 74 |
1 files changed, 45 insertions, 29 deletions
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c index 98bc7edc95a6..f67860cd649f 100644 --- a/arch/arm/mach-spear3xx/clock.c +++ b/arch/arm/mach-spear3xx/clock.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <asm/mach-types.h> | ||
16 | #include <plat/clock.h> | 17 | #include <plat/clock.h> |
17 | #include <mach/misc_regs.h> | 18 | #include <mach/misc_regs.h> |
18 | 19 | ||
@@ -688,56 +689,71 @@ static struct clk_lookup spear_clk_lookups[] = { | |||
688 | { .dev_id = "adc", .clk = &adc_clk}, | 689 | { .dev_id = "adc", .clk = &adc_clk}, |
689 | { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk}, | 690 | { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk}, |
690 | { .dev_id = "gpio", .clk = &gpio_clk}, | 691 | { .dev_id = "gpio", .clk = &gpio_clk}, |
691 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | 692 | }; |
692 | { .dev_id = "physmap-flash", .clk = &emi_clk}, | ||
693 | #endif | ||
694 | #if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR310) || \ | ||
695 | defined(CONFIG_MACH_SPEAR320) | ||
696 | { .con_id = "fsmc", .clk = &fsmc_clk}, | ||
697 | #endif | ||
698 | |||
699 | /* common clocks to spear310 and spear320 */ | ||
700 | #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) | ||
701 | { .dev_id = "uart1", .clk = &uart1_clk}, | ||
702 | { .dev_id = "uart2", .clk = &uart2_clk}, | ||
703 | #endif | ||
704 | |||
705 | /* common clock to spear300 and spear320 */ | ||
706 | #if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR320) | ||
707 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
708 | { .dev_id = "sdhci", .clk = &sdhci_clk}, | ||
709 | #endif /* CONFIG_MACH_SPEAR300 || CONFIG_MACH_SPEAR320 */ | ||
710 | 693 | ||
711 | /* spear300 machine specific clock structures */ | 694 | /* array of all spear 300 clock lookups */ |
712 | #ifdef CONFIG_MACH_SPEAR300 | 695 | #ifdef CONFIG_MACH_SPEAR300 |
696 | static struct clk_lookup spear300_clk_lookups[] = { | ||
697 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
698 | { .con_id = "fsmc", .clk = &fsmc_clk}, | ||
713 | { .dev_id = "gpio1", .clk = &gpio1_clk}, | 699 | { .dev_id = "gpio1", .clk = &gpio1_clk}, |
714 | { .dev_id = "keyboard", .clk = &kbd_clk}, | 700 | { .dev_id = "keyboard", .clk = &kbd_clk}, |
701 | { .dev_id = "sdhci", .clk = &sdhci_clk}, | ||
702 | }; | ||
715 | #endif | 703 | #endif |
716 | 704 | ||
717 | /* spear310 machine specific clock structures */ | 705 | /* array of all spear 310 clock lookups */ |
718 | #ifdef CONFIG_MACH_SPEAR310 | 706 | #ifdef CONFIG_MACH_SPEAR310 |
707 | static struct clk_lookup spear310_clk_lookups[] = { | ||
708 | { .con_id = "fsmc", .clk = &fsmc_clk}, | ||
709 | { .con_id = "emi", .clk = &emi_clk}, | ||
710 | { .dev_id = "uart1", .clk = &uart1_clk}, | ||
711 | { .dev_id = "uart2", .clk = &uart2_clk}, | ||
719 | { .dev_id = "uart3", .clk = &uart3_clk}, | 712 | { .dev_id = "uart3", .clk = &uart3_clk}, |
720 | { .dev_id = "uart4", .clk = &uart4_clk}, | 713 | { .dev_id = "uart4", .clk = &uart4_clk}, |
721 | { .dev_id = "uart5", .clk = &uart5_clk}, | 714 | { .dev_id = "uart5", .clk = &uart5_clk}, |
722 | 715 | }; | |
723 | #endif | 716 | #endif |
724 | /* spear320 machine specific clock structures */ | 717 | |
718 | /* array of all spear 320 clock lookups */ | ||
725 | #ifdef CONFIG_MACH_SPEAR320 | 719 | #ifdef CONFIG_MACH_SPEAR320 |
720 | static struct clk_lookup spear320_clk_lookups[] = { | ||
721 | { .dev_id = "clcd", .clk = &clcd_clk}, | ||
722 | { .con_id = "fsmc", .clk = &fsmc_clk}, | ||
723 | { .dev_id = "i2c_designware.1", .clk = &i2c1_clk}, | ||
724 | { .con_id = "emi", .clk = &emi_clk}, | ||
725 | { .dev_id = "pwm", .clk = &pwm_clk}, | ||
726 | { .dev_id = "sdhci", .clk = &sdhci_clk}, | ||
726 | { .dev_id = "c_can_platform.0", .clk = &can0_clk}, | 727 | { .dev_id = "c_can_platform.0", .clk = &can0_clk}, |
727 | { .dev_id = "c_can_platform.1", .clk = &can1_clk}, | 728 | { .dev_id = "c_can_platform.1", .clk = &can1_clk}, |
728 | { .dev_id = "i2c_designware.1", .clk = &i2c1_clk}, | ||
729 | { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk}, | 729 | { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk}, |
730 | { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk}, | 730 | { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk}, |
731 | { .dev_id = "pwm", .clk = &pwm_clk}, | 731 | { .dev_id = "uart1", .clk = &uart1_clk}, |
732 | #endif | 732 | { .dev_id = "uart2", .clk = &uart2_clk}, |
733 | }; | 733 | }; |
734 | #endif | ||
734 | 735 | ||
735 | void __init clk_init(void) | 736 | void __init spear3xx_clk_init(void) |
736 | { | 737 | { |
737 | int i; | 738 | int i, cnt; |
739 | struct clk_lookup *lookups; | ||
740 | |||
741 | if (machine_is_spear300()) { | ||
742 | cnt = ARRAY_SIZE(spear300_clk_lookups); | ||
743 | lookups = spear300_clk_lookups; | ||
744 | } else if (machine_is_spear310()) { | ||
745 | cnt = ARRAY_SIZE(spear310_clk_lookups); | ||
746 | lookups = spear310_clk_lookups; | ||
747 | } else { | ||
748 | cnt = ARRAY_SIZE(spear320_clk_lookups); | ||
749 | lookups = spear320_clk_lookups; | ||
750 | } | ||
738 | 751 | ||
739 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) | 752 | for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) |
740 | clk_register(&spear_clk_lookups[i]); | 753 | clk_register(&spear_clk_lookups[i]); |
741 | 754 | ||
742 | recalc_root_clocks(); | 755 | for (i = 0; i < cnt; i++) |
756 | clk_register(&lookups[i]); | ||
757 | |||
758 | clk_init(); | ||
743 | } | 759 | } |