diff options
author | Paul Walmsley <paul@pwsan.com> | 2009-06-19 21:08:27 -0400 |
---|---|---|
committer | paul <paul@twilight.(none)> | 2009-06-19 21:09:31 -0400 |
commit | d0ba3922ae241a87d22a1c3ffad72b96fe993c9a (patch) | |
tree | 3f23d60fbbf2ffceef44b01c8579db7be7d20025 | |
parent | c9812d042a21eb492a36cfabf9f41107f5ecee3d (diff) |
OMAP3 clock/SDRC: program SDRC_MR register during SDRC clock change
Program the SDRC_MR_0 register as well during SDRC clock changes.
This register allows selection of the memory CAS latency. Some SDRAM
chips, such as the Qimonda HYB18M512160AF6, have a lower CAS latency
at lower clock rates.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sram34xx.S | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/sram.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/sram.c | 6 |
4 files changed, 14 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 4bfa650bb34b..cf41ab55fa97 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -771,9 +771,9 @@ static int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate) | |||
771 | /* REVISIT: SRAM code doesn't support other M2 divisors yet */ | 771 | /* REVISIT: SRAM code doesn't support other M2 divisors yet */ |
772 | WARN_ON(new_div != 1 && new_div != 2); | 772 | WARN_ON(new_div != 1 && new_div != 2); |
773 | 773 | ||
774 | /* REVISIT: Add SDRC_MR changing to this code also */ | ||
775 | omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, | 774 | omap3_configure_core_dpll(sp->rfr_ctrl, sp->actim_ctrla, |
776 | sp->actim_ctrlb, new_div, unlock_dll, c); | 775 | sp->actim_ctrlb, new_div, unlock_dll, c, |
776 | sp->mr); | ||
777 | 777 | ||
778 | return 0; | 778 | return 0; |
779 | } | 779 | } |
diff --git a/arch/arm/mach-omap2/sram34xx.S b/arch/arm/mach-omap2/sram34xx.S index 8d4a88c30718..d13f1cc4bd58 100644 --- a/arch/arm/mach-omap2/sram34xx.S +++ b/arch/arm/mach-omap2/sram34xx.S | |||
@@ -44,12 +44,14 @@ | |||
44 | * SDRC rates < 83MHz | 44 | * SDRC rates < 83MHz |
45 | * r5 = number of MPU cycles to wait for SDRC to stabilize after | 45 | * r5 = number of MPU cycles to wait for SDRC to stabilize after |
46 | * reprogramming the SDRC when switching to a slower MPU speed | 46 | * reprogramming the SDRC when switching to a slower MPU speed |
47 | * r6 = SDRC_MR_0 register value | ||
47 | * | 48 | * |
48 | */ | 49 | */ |
49 | ENTRY(omap3_sram_configure_core_dpll) | 50 | ENTRY(omap3_sram_configure_core_dpll) |
50 | stmfd sp!, {r1-r12, lr} @ store regs to stack | 51 | stmfd sp!, {r1-r12, lr} @ store regs to stack |
51 | ldr r4, [sp, #52] @ pull extra args off the stack | 52 | ldr r4, [sp, #52] @ pull extra args off the stack |
52 | ldr r5, [sp, #56] @ load extra args from the stack | 53 | ldr r5, [sp, #56] @ load extra args from the stack |
54 | ldr r6, [sp, #60] @ load extra args from the stack | ||
53 | dsb @ flush buffered writes to interconnect | 55 | dsb @ flush buffered writes to interconnect |
54 | cmp r3, #0x2 | 56 | cmp r3, #0x2 |
55 | blne configure_sdrc | 57 | blne configure_sdrc |
@@ -151,7 +153,9 @@ configure_sdrc: | |||
151 | str r1, [r11] | 153 | str r1, [r11] |
152 | ldr r11, omap3_sdrc_actim_ctrlb | 154 | ldr r11, omap3_sdrc_actim_ctrlb |
153 | str r2, [r11] | 155 | str r2, [r11] |
154 | ldr r2, [r11] @ posted-write barrier for SDRC | 156 | ldr r11, omap3_sdrc_mr_0 |
157 | str r6, [r11] | ||
158 | ldr r6, [r11] @ posted-write barrier for SDRC | ||
155 | bx lr | 159 | bx lr |
156 | 160 | ||
157 | omap3_sdrc_power: | 161 | omap3_sdrc_power: |
@@ -168,6 +172,8 @@ omap3_sdrc_actim_ctrla: | |||
168 | .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_0) | 172 | .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_A_0) |
169 | omap3_sdrc_actim_ctrlb: | 173 | omap3_sdrc_actim_ctrlb: |
170 | .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_0) | 174 | .word OMAP34XX_SDRC_REGADDR(SDRC_ACTIM_CTRL_B_0) |
175 | omap3_sdrc_mr_0: | ||
176 | .word OMAP34XX_SDRC_REGADDR(SDRC_MR_0) | ||
171 | omap3_sdrc_dlla_status: | 177 | omap3_sdrc_dlla_status: |
172 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) | 178 | .word OMAP34XX_SDRC_REGADDR(SDRC_DLLA_STATUS) |
173 | omap3_sdrc_dlla_ctrl: | 179 | omap3_sdrc_dlla_ctrl: |
diff --git a/arch/arm/plat-omap/include/mach/sram.h b/arch/arm/plat-omap/include/mach/sram.h index c32fa0a220dc..4f87056a3677 100644 --- a/arch/arm/plat-omap/include/mach/sram.h +++ b/arch/arm/plat-omap/include/mach/sram.h | |||
@@ -24,7 +24,7 @@ extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); | |||
24 | extern u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, | 24 | extern u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, |
25 | u32 sdrc_actim_ctrla, | 25 | u32 sdrc_actim_ctrla, |
26 | u32 sdrc_actim_ctrlb, u32 m2, | 26 | u32 sdrc_actim_ctrlb, u32 m2, |
27 | u32 unlock_dll, u32 f); | 27 | u32 unlock_dll, u32 f, u32 sdrc_mr); |
28 | 28 | ||
29 | /* Do not use these */ | 29 | /* Do not use these */ |
30 | extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); | 30 | extern void omap1_sram_reprogram_clock(u32 ckctl, u32 dpllctl); |
@@ -62,7 +62,7 @@ extern unsigned long omap243x_sram_reprogram_sdrc_sz; | |||
62 | extern u32 omap3_sram_configure_core_dpll(u32 sdrc_rfr_ctrl, | 62 | extern u32 omap3_sram_configure_core_dpll(u32 sdrc_rfr_ctrl, |
63 | u32 sdrc_actim_ctrla, | 63 | u32 sdrc_actim_ctrla, |
64 | u32 sdrc_actim_ctrlb, u32 m2, | 64 | u32 sdrc_actim_ctrlb, u32 m2, |
65 | u32 unlock_dll, u32 f); | 65 | u32 unlock_dll, u32 f, u32 sdrc_mr); |
66 | extern unsigned long omap3_sram_configure_core_dpll_sz; | 66 | extern unsigned long omap3_sram_configure_core_dpll_sz; |
67 | 67 | ||
68 | #endif | 68 | #endif |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index 79c0f0254426..7dadf1a59fb5 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -372,16 +372,16 @@ static u32 (*_omap3_sram_configure_core_dpll)(u32 sdrc_rfr_ctrl, | |||
372 | u32 sdrc_actim_ctrla, | 372 | u32 sdrc_actim_ctrla, |
373 | u32 sdrc_actim_ctrlb, | 373 | u32 sdrc_actim_ctrlb, |
374 | u32 m2, u32 unlock_dll, | 374 | u32 m2, u32 unlock_dll, |
375 | u32 f); | 375 | u32 f, u32 sdrc_mr); |
376 | u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, u32 sdrc_actim_ctrla, | 376 | u32 omap3_configure_core_dpll(u32 sdrc_rfr_ctrl, u32 sdrc_actim_ctrla, |
377 | u32 sdrc_actim_ctrlb, u32 m2, u32 unlock_dll, | 377 | u32 sdrc_actim_ctrlb, u32 m2, u32 unlock_dll, |
378 | u32 f) | 378 | u32 f, u32 sdrc_mr) |
379 | { | 379 | { |
380 | BUG_ON(!_omap3_sram_configure_core_dpll); | 380 | BUG_ON(!_omap3_sram_configure_core_dpll); |
381 | return _omap3_sram_configure_core_dpll(sdrc_rfr_ctrl, | 381 | return _omap3_sram_configure_core_dpll(sdrc_rfr_ctrl, |
382 | sdrc_actim_ctrla, | 382 | sdrc_actim_ctrla, |
383 | sdrc_actim_ctrlb, m2, | 383 | sdrc_actim_ctrlb, m2, |
384 | unlock_dll, f); | 384 | unlock_dll, f, sdrc_mr); |
385 | } | 385 | } |
386 | 386 | ||
387 | /* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */ | 387 | /* REVISIT: Should this be same as omap34xx_sram_init() after off-idle? */ |