[PATCH 07/17] OMAP3: Disable Smartreflex before pwrdm enters RET

Tero Kristo
2009-10-16T11:04:23Z

From: Tero Kristo <tero.kristo@nokia.com>

Smartreflex for the corresponding powerdomain (MPU/CORE) must be disabled
before the domain enters retention, otherwise the device may hang. This is
caused by overlapping smartreflex / auto retention command on the voltage
channel resulting in incorrect voltage.

This fix has been confirmed from TI.

Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
arch/arm/mach-omap2/pm34xx.c | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 3e5ae14..5854fa7 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -531,11 +531,17 @@ void omap_sram_idle(void)
if (pwrdm_read_pwrst(cam_pwrdm) == PWRDM_POWER_ON)
omap2_clkdm_deny_idle(mpu_pwrdm->pwrdm_clkdms[0]);

- /* CORE */
- if (core_next_state < PWRDM_POWER_ON) {
- /* Disable smartreflex before entering WFI */
+ /*
+ * Disable smartreflex before entering WFI.
+ * Only needed if we are going to enter retention or off.
+ */
+ if (mpu_next_state <= PWRDM_POWER_RET)
disable_smartreflex(SR1);
+ if (core_next_state <= PWRDM_POWER_RET)
disable_smartreflex(SR2);
+
+ /* CORE */
+ if (core_next_state < PWRDM_POWER_ON) {
omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1);
if (core_next_state == PWRDM_POWER_OFF) {
@@ -608,10 +614,17 @@ void omap_sram_idle(void)
prm_clear_mod_reg_bits(OMAP3430_AUTO_RET,
OMAP3430_GR_MOD,
OMAP3_PRM_VOLTCTRL_OFFSET);
- /* Enable smartreflex after WFI */
+ }
+
+ /*
+ * Enable smartreflex after WFI. Only needed if we
+ * entered retention or off.
+ */
+ if (mpu_next_state <= PWRDM_POWER_RET)
enable_smartreflex(SR1);
+ if (core_next_state <= PWRDM_POWER_RET)
enable_smartreflex(SR2);
- }
+
if (core_saved_state != core_next_state)
pwrdm_set_next_pwrst(core_pwrdm, core_saved_state);

--
1.5.4.3