diff options
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index ba05aa42bd8e..9e43fe5209d3 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -129,6 +129,9 @@ static struct omap_clk omap34xx_clks[] = { | |||
129 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2), | 129 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2), |
130 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2), | 130 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2), |
131 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), | 131 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), |
132 | CLK(NULL, "modem_fck", &modem_fck, CK_343X), | ||
133 | CLK(NULL, "sad2d_ick", &sad2d_ick, CK_343X), | ||
134 | CLK(NULL, "mad2d_ick", &mad2d_ick, CK_343X), | ||
132 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X), | 135 | CLK(NULL, "gpt10_fck", &gpt10_fck, CK_343X), |
133 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X), | 136 | CLK(NULL, "gpt11_fck", &gpt11_fck, CK_343X), |
134 | CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2), | 137 | CLK(NULL, "cpefuse_fck", &cpefuse_fck, CK_3430ES2), |
@@ -281,6 +284,8 @@ static struct omap_clk omap34xx_clks[] = { | |||
281 | 284 | ||
282 | #define MAX_DPLL_WAIT_TRIES 1000000 | 285 | #define MAX_DPLL_WAIT_TRIES 1000000 |
283 | 286 | ||
287 | #define MIN_SDRC_DLL_LOCK_FREQ 83000000 | ||
288 | |||
284 | /** | 289 | /** |
285 | * omap3_dpll_recalc - recalculate DPLL rate | 290 | * omap3_dpll_recalc - recalculate DPLL rate |
286 | * @clk: DPLL struct clk | 291 | * @clk: DPLL struct clk |
@@ -703,6 +708,7 @@ static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate) | |||
703 | static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | 708 | static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) |
704 | { | 709 | { |
705 | u32 new_div = 0; | 710 | u32 new_div = 0; |
711 | u32 unlock_dll = 0; | ||
706 | unsigned long validrate, sdrcrate; | 712 | unsigned long validrate, sdrcrate; |
707 | struct omap_sdrc_params *sp; | 713 | struct omap_sdrc_params *sp; |
708 | 714 | ||
@@ -729,17 +735,22 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | |||
729 | if (!sp) | 735 | if (!sp) |
730 | return -EINVAL; | 736 | return -EINVAL; |
731 | 737 | ||
732 | pr_info("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | 738 | if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) { |
733 | validrate); | 739 | pr_debug("clock: will unlock SDRC DLL\n"); |
734 | pr_info("clock: SDRC timing params used: %08x %08x %08x\n", | 740 | unlock_dll = 1; |
735 | sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); | 741 | } |
742 | |||
743 | pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, | ||
744 | validrate); | ||
745 | pr_debug("clock: SDRC timing params used: %08x %08x %08x\n", | ||
746 | sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); | ||
736 | 747 | ||
737 | /* REVISIT: SRAM code doesn't support other M2 divisors yet */ | 748 | /* REVISIT: SRAM code doesn't support other M2 divisors yet */ |
738 | WARN_ON(new_div != 1 && new_div != 2); | 749 | WARN_ON(new_div != 1 && new_div != 2); |
739 | 750 | ||
740 | /* REVISIT: Add SDRC_MR changing to this code also */ | 751 | /* REVISIT: Add SDRC_MR changing to this code also */ |
741 | omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, | 752 | omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, |
742 | sp->actim_ctrlb, new_div); | 753 | sp->actim_ctrlb, new_div, unlock_dll); |
743 | 754 | ||
744 | return 0; | 755 | return 0; |
745 | } | 756 | } |
@@ -956,7 +967,7 @@ int __init omap2_clk_init(void) | |||
956 | clk_init(&omap2_clk_functions); | 967 | clk_init(&omap2_clk_functions); |
957 | 968 | ||
958 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) | 969 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) |
959 | clk_init_one(c->lk.clk); | 970 | clk_preinit(c->lk.clk); |
960 | 971 | ||
961 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) | 972 | for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) |
962 | if (c->cpu & cpu_clkflg) { | 973 | if (c->cpu & cpu_clkflg) { |