diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm24xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm24xx.c | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index c333fa6dffa8..b2a4df623545 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -90,11 +90,7 @@ static int omap2_enter_full_retention(void) | |||
90 | omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); | 90 | omap2_prm_write_mod_reg(0xffffffff, CORE_MOD, OMAP24XX_PM_WKST2); |
91 | omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); | 91 | omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); |
92 | 92 | ||
93 | /* | 93 | pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_RET); |
94 | * Set MPU powerdomain's next power state to RETENTION; | ||
95 | * preserve logic state during retention | ||
96 | */ | ||
97 | pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET); | ||
98 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); | 94 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); |
99 | 95 | ||
100 | /* Workaround to kill USB */ | 96 | /* Workaround to kill USB */ |
@@ -137,15 +133,10 @@ no_sleep: | |||
137 | /* Mask future PRCM-to-MPU interrupts */ | 133 | /* Mask future PRCM-to-MPU interrupts */ |
138 | omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); | 134 | omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); |
139 | 135 | ||
140 | return 0; | 136 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); |
141 | } | 137 | pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_ON); |
142 | |||
143 | static int omap2_i2c_active(void) | ||
144 | { | ||
145 | u32 l; | ||
146 | 138 | ||
147 | l = omap2_cm_read_mod_reg(CORE_MOD, CM_FCLKEN1); | 139 | return 0; |
148 | return l & (OMAP2420_EN_I2C2_MASK | OMAP2420_EN_I2C1_MASK); | ||
149 | } | 140 | } |
150 | 141 | ||
151 | static int sti_console_enabled; | 142 | static int sti_console_enabled; |
@@ -172,11 +163,6 @@ static int omap2_allow_mpu_retention(void) | |||
172 | 163 | ||
173 | static void omap2_enter_mpu_retention(void) | 164 | static void omap2_enter_mpu_retention(void) |
174 | { | 165 | { |
175 | /* Putting MPU into the WFI state while a transfer is active | ||
176 | * seems to cause the I2C block to timeout. Why? Good question. */ | ||
177 | if (omap2_i2c_active()) | ||
178 | return; | ||
179 | |||
180 | /* The peripherals seem not to be able to wake up the MPU when | 166 | /* The peripherals seem not to be able to wake up the MPU when |
181 | * it is in retention mode. */ | 167 | * it is in retention mode. */ |
182 | if (omap2_allow_mpu_retention()) { | 168 | if (omap2_allow_mpu_retention()) { |
@@ -186,17 +172,16 @@ static void omap2_enter_mpu_retention(void) | |||
186 | omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); | 172 | omap2_prm_write_mod_reg(0xffffffff, WKUP_MOD, PM_WKST); |
187 | 173 | ||
188 | /* Try to enter MPU retention */ | 174 | /* Try to enter MPU retention */ |
189 | omap2_prm_write_mod_reg((0x01 << OMAP_POWERSTATE_SHIFT) | | 175 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); |
190 | OMAP_LOGICRETSTATE_MASK, | 176 | |
191 | MPU_MOD, OMAP2_PM_PWSTCTRL); | ||
192 | } else { | 177 | } else { |
193 | /* Block MPU retention */ | 178 | /* Block MPU retention */ |
194 | 179 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); | |
195 | omap2_prm_write_mod_reg(OMAP_LOGICRETSTATE_MASK, MPU_MOD, | ||
196 | OMAP2_PM_PWSTCTRL); | ||
197 | } | 180 | } |
198 | 181 | ||
199 | omap2_sram_idle(); | 182 | omap2_sram_idle(); |
183 | |||
184 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); | ||
200 | } | 185 | } |
201 | 186 | ||
202 | static int omap2_can_sleep(void) | 187 | static int omap2_can_sleep(void) |
@@ -251,25 +236,17 @@ static void __init prcm_setup_regs(void) | |||
251 | for (i = 0; i < num_mem_banks; i++) | 236 | for (i = 0; i < num_mem_banks; i++) |
252 | pwrdm_set_mem_retst(core_pwrdm, i, PWRDM_POWER_RET); | 237 | pwrdm_set_mem_retst(core_pwrdm, i, PWRDM_POWER_RET); |
253 | 238 | ||
254 | /* Set CORE powerdomain's next power state to RETENTION */ | 239 | pwrdm_set_logic_retst(core_pwrdm, PWRDM_POWER_RET); |
255 | pwrdm_set_next_pwrst(core_pwrdm, PWRDM_POWER_RET); | ||
256 | 240 | ||
257 | /* | ||
258 | * Set MPU powerdomain's next power state to RETENTION; | ||
259 | * preserve logic state during retention | ||
260 | */ | ||
261 | pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET); | 241 | pwrdm_set_logic_retst(mpu_pwrdm, PWRDM_POWER_RET); |
262 | pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_RET); | ||
263 | 242 | ||
264 | /* Force-power down DSP, GFX powerdomains */ | 243 | /* Force-power down DSP, GFX powerdomains */ |
265 | 244 | ||
266 | pwrdm = clkdm_get_pwrdm(dsp_clkdm); | 245 | pwrdm = clkdm_get_pwrdm(dsp_clkdm); |
267 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); | 246 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); |
268 | clkdm_sleep(dsp_clkdm); | ||
269 | 247 | ||
270 | pwrdm = clkdm_get_pwrdm(gfx_clkdm); | 248 | pwrdm = clkdm_get_pwrdm(gfx_clkdm); |
271 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); | 249 | pwrdm_set_next_pwrst(pwrdm, PWRDM_POWER_OFF); |
272 | clkdm_sleep(gfx_clkdm); | ||
273 | 250 | ||
274 | /* Enable hardware-supervised idle for all clkdms */ | 251 | /* Enable hardware-supervised idle for all clkdms */ |
275 | clkdm_for_each(omap_pm_clkdms_setup, NULL); | 252 | clkdm_for_each(omap_pm_clkdms_setup, NULL); |