aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock34xx.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2009-05-26 17:41:35 -0400
committerTony Lindgren <tony@atomide.com>2009-05-26 17:41:35 -0400
commit88b6f7eb9b4a06fbfe27f2d98e249577f4cfdaef (patch)
tree9ef0d7ecd3e0551ca4d13ac0134aeb3ecd8558c7 /arch/arm/mach-omap2/clock34xx.c
parent8f9ccfeeb2cecb54dd093119291ab271ab0fd94a (diff)
parent7971687094ef48695aa56a0c03416b609bd4d1fd (diff)
Merge branch 'omap-clock-upstream' of git://git.pwsan.com/linux-2.6 into for-next
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.c')
-rw-r--r--arch/arm/mach-omap2/clock34xx.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index ba05aa42bd8e..62021397e5f9 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -281,6 +281,8 @@ static struct omap_clk omap34xx_clks[] = {
281 281
282#define MAX_DPLL_WAIT_TRIES 1000000 282#define MAX_DPLL_WAIT_TRIES 1000000
283 283
284#define MIN_SDRC_DLL_LOCK_FREQ 83000000
285
284/** 286/**
285 * omap3_dpll_recalc - recalculate DPLL rate 287 * omap3_dpll_recalc - recalculate DPLL rate
286 * @clk: DPLL struct clk 288 * @clk: DPLL struct clk
@@ -703,6 +705,7 @@ static int omap3_dpll4_set_rate(struct clk *clk, unsigned long rate)
703static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) 705static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
704{ 706{
705 u32 new_div = 0; 707 u32 new_div = 0;
708 u32 unlock_dll = 0;
706 unsigned long validrate, sdrcrate; 709 unsigned long validrate, sdrcrate;
707 struct omap_sdrc_params *sp; 710 struct omap_sdrc_params *sp;
708 711
@@ -729,17 +732,22 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
729 if (!sp) 732 if (!sp)
730 return -EINVAL; 733 return -EINVAL;
731 734
732 pr_info("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, 735 if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) {
733 validrate); 736 pr_debug("clock: will unlock SDRC DLL\n");
734 pr_info("clock: SDRC timing params used: %08x %08x %08x\n", 737 unlock_dll = 1;
735 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); 738 }
739
740 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate,
741 validrate);
742 pr_debug("clock: SDRC timing params used: %08x %08x %08x\n",
743 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb);
736 744
737 /* REVISIT: SRAM code doesn't support other M2 divisors yet */ 745 /* REVISIT: SRAM code doesn't support other M2 divisors yet */
738 WARN_ON(new_div != 1 && new_div != 2); 746 WARN_ON(new_div != 1 && new_div != 2);
739 747
740 /* REVISIT: Add SDRC_MR changing to this code also */ 748 /* REVISIT: Add SDRC_MR changing to this code also */
741 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, 749 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla,
742 sp->actim_ctrlb, new_div); 750 sp->actim_ctrlb, new_div, unlock_dll);
743 751
744 return 0; 752 return 0;
745} 753}
@@ -956,7 +964,7 @@ int __init omap2_clk_init(void)
956 clk_init(&omap2_clk_functions); 964 clk_init(&omap2_clk_functions);
957 965
958 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++) 966 for (c = omap34xx_clks; c < omap34xx_clks + ARRAY_SIZE(omap34xx_clks); c++)
959 clk_init_one(c->lk.clk); 967 clk_preinit(c->lk.clk);
960 968
961 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++)
962 if (c->cpu & cpu_clkflg) { 970 if (c->cpu & cpu_clkflg) {