aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTero Kristo <tero.kristo@nokia.com>2009-06-19 21:08:29 -0400
committerpaul <paul@twilight.(none)>2009-06-19 21:09:32 -0400
commit3afec6332e1e7cf2d74e0bf08160a68f43a59073 (patch)
treeb0b6d4b12d54cb5079975a3a58583c98f892f708 /arch/arm/mach-omap2
parentdf14e4747aa58126a508ae26661c73d83127c831 (diff)
OMAP3: Add support for DPLL3 divisor values higher than 2
Previously only 1 and 2 was supported. This is needed for DVFS VDD2 control. Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/clock34xx.c9
-rw-r--r--arch/arm/mach-omap2/sram34xx.S8
2 files changed, 8 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index cf41ab55fa97..045da923e75b 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -739,9 +739,9 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
739 739
740 sdrcrate = sdrc_ick.rate; 740 sdrcrate = sdrc_ick.rate;
741 if (rate > clk->rate) 741 if (rate > clk->rate)
742 sdrcrate <<= ((rate / clk->rate) - 1); 742 sdrcrate <<= ((rate / clk->rate) >> 1);
743 else 743 else
744 sdrcrate >>= ((clk->rate / rate) - 1); 744 sdrcrate >>= ((clk->rate / rate) >> 1);
745 745
746 sp = omap2_sdrc_get_params(sdrcrate); 746 sp = omap2_sdrc_get_params(sdrcrate);
747 if (!sp) 747 if (!sp)
@@ -768,12 +768,9 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
768 pr_debug("clock: SDRC timing params used: %08x %08x %08x\n", 768 pr_debug("clock: SDRC timing params used: %08x %08x %08x\n",
769 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb); 769 sp->rfr_ctrl, sp->actim_ctrla, sp->actim_ctrlb);
770 770
771 /* REVISIT: SRAM code doesn't support other M2 divisors yet */
772 WARN_ON(new_div != 1 && new_div != 2);
773
774 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, 771 omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla,
775 sp->actim_ctrlb, new_div, unlock_dll, c, 772 sp->actim_ctrlb, new_div, unlock_dll, c,
776 sp->mr); 773 sp->mr, rate > clk->rate);
777 774
778 return 0; 775 return 0;
779} 776}
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S
index 16eb4efa8b74..487fa8609cde 100644
--- a/arch/arm/mach-omap2/sram34xx.S
+++ b/arch/arm/mach-omap2/sram34xx.S
@@ -70,6 +70,7 @@
70 * r5 = number of MPU cycles to wait for SDRC to stabilize after 70 * r5 = number of MPU cycles to wait for SDRC to stabilize after
71 * reprogramming the SDRC when switching to a slower MPU speed 71 * reprogramming the SDRC when switching to a slower MPU speed
72 * r6 = new SDRC_MR_0 register value 72 * r6 = new SDRC_MR_0 register value
73 * r7 = increasing SDRC rate? (1 = yes, 0 = no)
73 * 74 *
74 */ 75 */
75ENTRY(omap3_sram_configure_core_dpll) 76ENTRY(omap3_sram_configure_core_dpll)
@@ -77,9 +78,10 @@ ENTRY(omap3_sram_configure_core_dpll)
77 ldr r4, [sp, #52] @ pull extra args off the stack 78 ldr r4, [sp, #52] @ pull extra args off the stack
78 ldr r5, [sp, #56] @ load extra args from the stack 79 ldr r5, [sp, #56] @ load extra args from the stack
79 ldr r6, [sp, #60] @ load extra args from the stack 80 ldr r6, [sp, #60] @ load extra args from the stack
81 ldr r7, [sp, #64] @ load extra args from the stack
80 dsb @ flush buffered writes to interconnect 82 dsb @ flush buffered writes to interconnect
81 cmp r3, #0x2 @ if increasing SDRC clk rate, 83 cmp r7, #1 @ if increasing SDRC clk rate,
82 blne configure_sdrc @ program the SDRC regs early (for RFR) 84 bleq configure_sdrc @ program the SDRC regs early (for RFR)
83 cmp r4, #SDRC_UNLOCK_DLL @ set the intended DLL state 85 cmp r4, #SDRC_UNLOCK_DLL @ set the intended DLL state
84 bleq unlock_dll 86 bleq unlock_dll
85 blne lock_dll 87 blne lock_dll
@@ -89,7 +91,7 @@ ENTRY(omap3_sram_configure_core_dpll)
89 cmp r4, #SDRC_UNLOCK_DLL @ wait for DLL status to change 91 cmp r4, #SDRC_UNLOCK_DLL @ wait for DLL status to change
90 bleq wait_dll_unlock 92 bleq wait_dll_unlock
91 blne wait_dll_lock 93 blne wait_dll_lock
92 cmp r3, #0x1 @ if increasing SDRC clk rate, 94 cmp r7, #1 @ if increasing SDRC clk rate,
93 beq return_to_sdram @ return to SDRAM code, otherwise, 95 beq return_to_sdram @ return to SDRAM code, otherwise,
94 bl configure_sdrc @ reprogram SDRC regs now 96 bl configure_sdrc @ reprogram SDRC regs now
95 mov r12, r5 97 mov r12, r5