diff options
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r-- | arch/arm/mach-omap1/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap1/board-ams-delta.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap1/clock.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap1/clock_data.c | 53 | ||||
-rw-r--r-- | arch/arm/mach-omap1/devices.c | 3 |
5 files changed, 46 insertions, 31 deletions
diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index e0a028161dde..73f287d6429b 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig | |||
@@ -171,14 +171,6 @@ config MACH_OMAP_GENERIC | |||
171 | comment "OMAP CPU Speed" | 171 | comment "OMAP CPU Speed" |
172 | depends on ARCH_OMAP1 | 172 | depends on ARCH_OMAP1 |
173 | 173 | ||
174 | config OMAP_CLOCKS_SET_BY_BOOTLOADER | ||
175 | bool "OMAP clocks set by bootloader" | ||
176 | depends on ARCH_OMAP1 | ||
177 | help | ||
178 | Enable this option to prevent the kernel from overriding the clock | ||
179 | frequencies programmed by bootloader for MPU, DSP, MMUs, TC, | ||
180 | internal LCD controller and MPU peripherals. | ||
181 | |||
182 | config OMAP_ARM_216MHZ | 174 | config OMAP_ARM_216MHZ |
183 | bool "OMAP ARM 216 MHz CPU (1710 only)" | 175 | bool "OMAP ARM 216 MHz CPU (1710 only)" |
184 | depends on ARCH_OMAP1 && ARCH_OMAP16XX | 176 | depends on ARCH_OMAP1 && ARCH_OMAP16XX |
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 51bae31cf361..b0f15d234a12 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c | |||
@@ -302,8 +302,6 @@ static void __init ams_delta_init(void) | |||
302 | omap_cfg_reg(J19_1610_CAM_D6); | 302 | omap_cfg_reg(J19_1610_CAM_D6); |
303 | omap_cfg_reg(J18_1610_CAM_D7); | 303 | omap_cfg_reg(J18_1610_CAM_D7); |
304 | 304 | ||
305 | iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); | ||
306 | |||
307 | omap_board_config = ams_delta_config; | 305 | omap_board_config = ams_delta_config; |
308 | omap_board_config_size = ARRAY_SIZE(ams_delta_config); | 306 | omap_board_config_size = ARRAY_SIZE(ams_delta_config); |
309 | omap_serial_init(); | 307 | omap_serial_init(); |
@@ -373,10 +371,16 @@ static int __init ams_delta_modem_init(void) | |||
373 | } | 371 | } |
374 | arch_initcall(ams_delta_modem_init); | 372 | arch_initcall(ams_delta_modem_init); |
375 | 373 | ||
374 | static void __init ams_delta_map_io(void) | ||
375 | { | ||
376 | omap15xx_map_io(); | ||
377 | iotable_init(ams_delta_io_desc, ARRAY_SIZE(ams_delta_io_desc)); | ||
378 | } | ||
379 | |||
376 | MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") | 380 | MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") |
377 | /* Maintainer: Jonathan McDowell <noodles@earth.li> */ | 381 | /* Maintainer: Jonathan McDowell <noodles@earth.li> */ |
378 | .atag_offset = 0x100, | 382 | .atag_offset = 0x100, |
379 | .map_io = omap15xx_map_io, | 383 | .map_io = ams_delta_map_io, |
380 | .init_early = omap1_init_early, | 384 | .init_early = omap1_init_early, |
381 | .reserve = omap_reserve, | 385 | .reserve = omap_reserve, |
382 | .init_irq = omap1_init_irq, | 386 | .init_irq = omap1_init_irq, |
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h index eaf09efb91ca..16b1423b454a 100644 --- a/arch/arm/mach-omap1/clock.h +++ b/arch/arm/mach-omap1/clock.h | |||
@@ -17,7 +17,8 @@ | |||
17 | 17 | ||
18 | #include <plat/clock.h> | 18 | #include <plat/clock.h> |
19 | 19 | ||
20 | extern int __init omap1_clk_init(void); | 20 | int omap1_clk_init(void); |
21 | void omap1_clk_late_init(void); | ||
21 | extern int omap1_clk_enable(struct clk *clk); | 22 | extern int omap1_clk_enable(struct clk *clk); |
22 | extern void omap1_clk_disable(struct clk *clk); | 23 | extern void omap1_clk_disable(struct clk *clk); |
23 | extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate); | 24 | extern long omap1_clk_round_rate(struct clk *clk, unsigned long rate); |
diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 92400b9eb69f..1297bb58869c 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c | |||
@@ -767,6 +767,15 @@ static struct clk_functions omap1_clk_functions = { | |||
767 | .clk_disable_unused = omap1_clk_disable_unused, | 767 | .clk_disable_unused = omap1_clk_disable_unused, |
768 | }; | 768 | }; |
769 | 769 | ||
770 | static void __init omap1_show_rates(void) | ||
771 | { | ||
772 | pr_notice("Clocking rate (xtal/DPLL1/MPU): " | ||
773 | "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", | ||
774 | ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10, | ||
775 | ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, | ||
776 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); | ||
777 | } | ||
778 | |||
770 | int __init omap1_clk_init(void) | 779 | int __init omap1_clk_init(void) |
771 | { | 780 | { |
772 | struct omap_clk *c; | 781 | struct omap_clk *c; |
@@ -835,9 +844,12 @@ int __init omap1_clk_init(void) | |||
835 | /* We want to be in syncronous scalable mode */ | 844 | /* We want to be in syncronous scalable mode */ |
836 | omap_writew(0x1000, ARM_SYSST); | 845 | omap_writew(0x1000, ARM_SYSST); |
837 | 846 | ||
838 | #ifdef CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER | 847 | |
839 | /* Use values set by bootloader. Determine PLL rate and recalculate | 848 | /* |
840 | * dependent clocks as if kernel had changed PLL or divisors. | 849 | * Initially use the values set by bootloader. Determine PLL rate and |
850 | * recalculate dependent clocks as if kernel had changed PLL or | ||
851 | * divisors. See also omap1_clk_late_init() that can reprogram dpll1 | ||
852 | * after the SRAM is initialized. | ||
841 | */ | 853 | */ |
842 | { | 854 | { |
843 | unsigned pll_ctl_val = omap_readw(DPLL_CTL); | 855 | unsigned pll_ctl_val = omap_readw(DPLL_CTL); |
@@ -862,25 +874,10 @@ int __init omap1_clk_init(void) | |||
862 | } | 874 | } |
863 | } | 875 | } |
864 | } | 876 | } |
865 | #else | ||
866 | /* Find the highest supported frequency and enable it */ | ||
867 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { | ||
868 | printk(KERN_ERR "System frequencies not set. Check your config.\n"); | ||
869 | /* Guess sane values (60MHz) */ | ||
870 | omap_writew(0x2290, DPLL_CTL); | ||
871 | omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL); | ||
872 | ck_dpll1.rate = 60000000; | ||
873 | } | ||
874 | #endif | ||
875 | propagate_rate(&ck_dpll1); | 877 | propagate_rate(&ck_dpll1); |
876 | /* Cache rates for clocks connected to ck_ref (not dpll1) */ | 878 | /* Cache rates for clocks connected to ck_ref (not dpll1) */ |
877 | propagate_rate(&ck_ref); | 879 | propagate_rate(&ck_ref); |
878 | printk(KERN_INFO "Clocking rate (xtal/DPLL1/MPU): " | 880 | omap1_show_rates(); |
879 | "%ld.%01ld/%ld.%01ld/%ld.%01ld MHz\n", | ||
880 | ck_ref.rate / 1000000, (ck_ref.rate / 100000) % 10, | ||
881 | ck_dpll1.rate / 1000000, (ck_dpll1.rate / 100000) % 10, | ||
882 | arm_ck.rate / 1000000, (arm_ck.rate / 100000) % 10); | ||
883 | |||
884 | if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { | 881 | if (machine_is_omap_perseus2() || machine_is_omap_fsample()) { |
885 | /* Select slicer output as OMAP input clock */ | 882 | /* Select slicer output as OMAP input clock */ |
886 | omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, | 883 | omap_writew(omap_readw(OMAP7XX_PCC_UPLD_CTRL) & ~0x1, |
@@ -925,3 +922,21 @@ int __init omap1_clk_init(void) | |||
925 | 922 | ||
926 | return 0; | 923 | return 0; |
927 | } | 924 | } |
925 | |||
926 | #define OMAP1_DPLL1_SANE_VALUE 60000000 | ||
927 | |||
928 | void __init omap1_clk_late_init(void) | ||
929 | { | ||
930 | if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE) | ||
931 | return; | ||
932 | |||
933 | /* Find the highest supported frequency and enable it */ | ||
934 | if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) { | ||
935 | pr_err("System frequencies not set, using default. Check your config.\n"); | ||
936 | omap_writew(0x2290, DPLL_CTL); | ||
937 | omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL); | ||
938 | ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE; | ||
939 | } | ||
940 | propagate_rate(&ck_dpll1); | ||
941 | omap1_show_rates(); | ||
942 | } | ||
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index 48ef9888e820..475cb2f50d87 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <plat/omap7xx.h> | 30 | #include <plat/omap7xx.h> |
31 | #include <plat/mcbsp.h> | 31 | #include <plat/mcbsp.h> |
32 | 32 | ||
33 | #include "clock.h" | ||
34 | |||
33 | /*-------------------------------------------------------------------------*/ | 35 | /*-------------------------------------------------------------------------*/ |
34 | 36 | ||
35 | #if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE) | 37 | #if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE) |
@@ -293,6 +295,7 @@ static int __init omap1_init_devices(void) | |||
293 | return -ENODEV; | 295 | return -ENODEV; |
294 | 296 | ||
295 | omap_sram_init(); | 297 | omap_sram_init(); |
298 | omap1_clk_late_init(); | ||
296 | 299 | ||
297 | /* please keep these calls, and their implementations above, | 300 | /* please keep these calls, and their implementations above, |
298 | * in alphabetical order so they're easier to sort through. | 301 | * in alphabetical order so they're easier to sort through. |