aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock34xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.c')
-rw-r--r--arch/arm/mach-omap2/clock34xx.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 045da923e75b..1c6480d3ad62 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -725,7 +725,9 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
725 u32 unlock_dll = 0; 725 u32 unlock_dll = 0;
726 u32 c; 726 u32 c;
727 unsigned long validrate, sdrcrate, mpurate; 727 unsigned long validrate, sdrcrate, mpurate;
728 struct omap_sdrc_params *sp; 728 struct omap_sdrc_params *sdrc_cs0;
729 struct omap_sdrc_params *sdrc_cs1;
730 int ret;
729 731
730 if (!clk || !rate) 732 if (!clk || !rate)
731 return -EINVAL; 733 return -EINVAL;
@@ -743,8 +745,8 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
743 else 745 else
744 sdrcrate >>= ((clk->rate / rate) >> 1); 746 sdrcrate >>= ((clk->rate / rate) >> 1);
745 747
746 sp = omap2_sdrc_get_params(sdrcrate); 748 ret = omap2_sdrc_get_params(sdrcrate, &sdrc_cs0, &sdrc_cs1);
747 if (!sp) 749 if (ret)
748 return -EINVAL; 750 return -EINVAL;
749 751
750 if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) { 752 if (sdrcrate < MIN_SDRC_DLL_LOCK_FREQ) {
@@ -765,12 +767,29 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
765 767
766 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate, 768 pr_debug("clock: changing CORE DPLL rate from %lu to %lu\n", clk->rate,
767 validrate); 769 validrate);
768 pr_debug("clock: SDRC timing params used: %08x %08x %08x\n", 770 pr_debug("clock: SDRC CS0 timing params used:"
769 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); 771 " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
770 772 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
771 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, 773 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr);
772 sp->actim_ctrlb, new_div, unlock_dll, c, 774 if (sdrc_cs1)
773 sp->mr, rate > clk->rate); 775 pr_debug("clock: SDRC CS1 timing params used: "
776 " RFR %08x CTRLA %08x CTRLB %08x MR %08x\n",
777 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
778 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
779
780 if (sdrc_cs1)
781 omap3_configure_core_dpll(
782 new_div, unlock_dll, c, rate > clk->rate,
783 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
784 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
785 sdrc_cs1->rfr_ctrl, sdrc_cs1->actim_ctrla,
786 sdrc_cs1->actim_ctrlb, sdrc_cs1->mr);
787 else
788 omap3_configure_core_dpll(
789 new_div, unlock_dll, c, rate > clk->rate,
790 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
791 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
792 0, 0, 0, 0);
774 793
775 return 0; 794 return 0;
776} 795}