diff options
Diffstat (limited to 'arch/arm/mach-omap/am33xx_clock.c')
-rw-r--r-- | arch/arm/mach-omap/am33xx_clock.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/am33xx_clock.c b/arch/arm/mach-omap/am33xx_clock.c index 6d8addef32..ad735cb216 100644 --- a/arch/arm/mach-omap/am33xx_clock.c +++ b/arch/arm/mach-omap/am33xx_clock.c @@ -15,6 +15,7 @@ #include <common.h> #include <asm/io.h> #include <mach/am33xx-clock.h> +#include <asm-generic/div64.h> #define PRCM_MOD_EN 0x2 #define PRCM_FORCE_WAKEUP 0x2 @@ -304,8 +305,13 @@ void am33xx_enable_ddr_clocks(void) /* * Configure the PLL/PRCM for necessary peripherals */ -void am33xx_pll_init(int mpupll_M, int osc, int ddrpll_M) +void am33xx_pll_init(int mpupll_M, int ddrpll_M) { + int osc; + + osc = am33xx_get_osc_clock(); + osc /= 1000; + mpu_pll_config(mpupll_M, osc); core_pll_config(osc); per_pll_config(osc); @@ -318,3 +324,30 @@ void am33xx_pll_init(int mpupll_M, int osc, int ddrpll_M) /* Enable the required peripherals */ am33xx_enable_per_clocks(); } + +/* + * Return the OSC clock value from SYSBOOT pins in kHz. + */ +int am33xx_get_osc_clock(void) +{ + int osc; + u32 sysboot; + + sysboot = (readl(AM33XX_CTRL_STATUS) >> 22) & 3; + switch (sysboot) { + case 0: + osc = 19200; + break; + case 1: + osc = 24000; + break; + case 2: + osc = 25000; + break; + case 3: + osc = 26000; + break; + } + + return osc; +} |