OMAP3: PM: SDRC: ensure mux of SDRC clock enable pins for self-refresh
Subsystems (3)
PATCH 1/1 OMAP3: PM: SDRC: ensure mux of SDRC clock enable pins for self-refresh
For SDRAM self-refresh to work properly, the SDRC clock-enable pins for both chip selects must be mux'd properly.
Since these pins are not shared with anything else (according to ES3.1 TRM ver. P), they should always be mux'd in the SDRC mode (mode 0.)
Special thanks to Paul Walmsley for pointing this out.
--- arch/arm/mach-omap2/mux.c | 5 +++++ arch/arm/mach-omap2/sdrc.c | 8 ++++++++ arch/arm/plat-omap/include/mach/mux.h | 3 +++ 3 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/mux.c +5 -0
@@ -486,6 +486,11 @@ MUX_CFG_34XX("H19_34XX_GPIO164_OUT", 0x19c, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT) MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6, OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT) + +MUX_CFG_34XX("H16_34XX_SDRC_CKE0", 0x262, + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_OUTPUT) +MUX_CFG_34XX ("H17_34XX_SDRC_CKE1" ,0x264 , +OMAP34XX_MUX_MODE0 |OMAP34XX_PIN_OUTPUT ) };#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
arch/arm/mach-omap2/sdrc.c +8 -0
@@ -136,5 +136,13 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sp) (1 <<SDRC_POWER_PWDENA_SHIFT ) | (1 <<SDRC_POWER_PAGEPOLICY_SHIFT );sdrc_write_reg (l,SDRC_POWER ); + +/* Ensure SDRC pins for both chip selcts are mux'd properly +* for self-refresh */ +if (cpu_is_omap34xx ()) { +omap_cfg_reg (H16_34XX_SDRC_CKE0 ); +omap_cfg_reg (H17_34XX_SDRC_CKE1 ); + } +omap2_sms_save_context (); }
arch/arm/plat-omap/include/mach/mux.h +3 -0
@@ -803,6 +803,9 @@ enum omap34xx_index {AE5_34XX_GPIO143 ,H19_34XX_GPIO164_OUT ,J25_34XX_GPIO170 , + +H16_34XX_SDRC_CKE0 , + H17_34XX_SDRC_CKE1, }; struct omap_mux_cfg {
Signature · 1 line
1.6.2.2
Hi Kevin
Quoted 8 lines · Kevin Hilman
arch/arm/mach-omap2/sdrc.c +0
-0@@ -136,5 +136,13 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sp) (1 <<SDRC_POWER_PWDENA_SHIFT ) | (1 <<SDRC_POWER_PAGEPOLICY_SHIFT );sdrc_write_reg (l,SDRC_POWER );
arch/arm/mach-omap2/sdrc.c void __init omap2_sdrc_init(struct omap_sdrc_params *sp) · line 148
Quoted 10 lines
arch/arm/mach-omap2/sdrc.c +8
-0+ +/* Ensure SDRC pins for both chip selcts are mux'd properly +* for self-refresh */ +if (cpu_is_omap34xx ()) { +omap_cfg_reg (H16_34XX_SDRC_CKE0 ); +omap_cfg_reg (H17_34XX_SDRC_CKE1 ); + } +omap2_sms_save_context (); }
would suggest keeping pin remuxing in board-*.c or maybe chip-*.c files; ideally this file would only pertain to the SDRC IP block itself.
- Paul
Quoted 28 lines · Paul Walmsley
Hi Kevin
Quoted 16 lines · Kevin Hilman
arch/arm/mach-omap2/sdrc.c +0
-0@@ -136,5 +136,13 @@ void __init omap2_sdrc_init(struct omap_sdrc_params *sp)(1 <<
SDRC_POWER_PWDENA_SHIFT) |
(1 <<SDRC_POWER_PAGEPOLICY_SHIFT);
sdrc_write_reg(l, SDRC_POWER);arch/arm/mach-omap2/sdrc.c +8
-0+ + /* Ensure SDRC pins for both chip selcts are mux'd properly + * for self-refresh */ + if (cpu_is_omap34xx()) { + omap_cfg_reg(H16_34XX_SDRC_CKE0); + omap_cfg_reg(H17_34XX_SDRC_CKE1); + } +Quoted 2 lines
omap2_sms_save_context();
}would suggest keeping pin remuxing in board-*.c or maybe chip-*.c files; ideally this file would only pertain to the SDRC IP block itself.
Quoted 1 line
- Paul
Is there a reason why any board-*.c would not want this? It seems a little silly for everyone to be doing the same repetitive pin muxing if they want to suspend properly for a reasonable amount of time.
- Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Mike Chan
Quoted 3 lines · Paul Walmsley
would suggest keeping pin remuxing in board-*.c or maybe chip-*.c files; ideally this file would only pertain to the SDRC IP block itself.
Is there a reason why any board-*.c would not want this? It seems a little silly for everyone to be doing the same repetitive pin muxing if they want to suspend properly for a reasonable amount of time.
I suspect you are asking a slightly different question, which is, "why shouldn't this pin muxing go in sdrc.c". The reason is because the pin muxing API we have is chip- and package-specific. This sdrc.c file shouldn't contain any chip- or package-specific information. Whether it goes into board-*.c or into a chip- or package-specific file is another question.
Richard's earlier E-mail covered the answer to your literal question. It seems wisest for boards that don't use SDRC_CKE1 to keep it in safe mode.
- Paul