diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2008-11-04 23:50:52 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-11 17:42:28 -0500 |
commit | 658ce97ef57f4c0737bfcb76050400b53389ed6b (patch) | |
tree | a204beddeafd77c9b6f763d616bb05f928aad5c2 /arch/arm/mach-omap2/pm34xx.c | |
parent | d7814e4df6e9c54680a30de3f439c66a2a55ce94 (diff) |
OMAP3: PM: decouple PER and CORE context save and restore
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index ff818aaec6c5..d8a6e10ac315 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -338,19 +338,20 @@ static void omap_sram_idle(void) | |||
338 | if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) | 338 | if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) |
339 | set_pwrdm_state(neon_pwrdm, mpu_next_state); | 339 | set_pwrdm_state(neon_pwrdm, mpu_next_state); |
340 | 340 | ||
341 | /* CORE & PER */ | 341 | /* PER */ |
342 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | ||
343 | if (per_next_state < PWRDM_POWER_ON) { | ||
344 | omap2_gpio_prepare_for_retention(); | ||
345 | omap_uart_prepare_idle(2); | ||
346 | if (per_next_state == PWRDM_POWER_OFF) | ||
347 | omap3_per_save_context(); | ||
348 | } | ||
349 | |||
350 | /* CORE */ | ||
342 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | 351 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); |
343 | if (core_next_state < PWRDM_POWER_ON) { | 352 | if (core_next_state < PWRDM_POWER_ON) { |
344 | omap2_gpio_prepare_for_retention(); | ||
345 | omap_uart_prepare_idle(0); | 353 | omap_uart_prepare_idle(0); |
346 | omap_uart_prepare_idle(1); | 354 | omap_uart_prepare_idle(1); |
347 | /* PER changes only with core */ | ||
348 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | ||
349 | if (per_next_state < PWRDM_POWER_ON) { | ||
350 | omap_uart_prepare_idle(2); | ||
351 | if (per_next_state == PWRDM_POWER_OFF) | ||
352 | omap3_per_save_context(); | ||
353 | } | ||
354 | if (core_next_state == PWRDM_POWER_OFF) { | 355 | if (core_next_state == PWRDM_POWER_OFF) { |
355 | omap3_core_save_context(); | 356 | omap3_core_save_context(); |
356 | omap3_prcm_save_context(); | 357 | omap3_prcm_save_context(); |
@@ -392,14 +393,8 @@ static void omap_sram_idle(void) | |||
392 | if (pwrdm_read_prev_pwrst(mpu_pwrdm) == PWRDM_POWER_OFF) | 393 | if (pwrdm_read_prev_pwrst(mpu_pwrdm) == PWRDM_POWER_OFF) |
393 | restore_table_entry(); | 394 | restore_table_entry(); |
394 | 395 | ||
396 | /* CORE */ | ||
395 | if (core_next_state < PWRDM_POWER_ON) { | 397 | if (core_next_state < PWRDM_POWER_ON) { |
396 | if (per_next_state < PWRDM_POWER_ON) | ||
397 | omap_uart_resume_idle(2); | ||
398 | omap_uart_resume_idle(1); | ||
399 | omap_uart_resume_idle(0); | ||
400 | |||
401 | /* Disable IO-PAD wakeup */ | ||
402 | prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); | ||
403 | core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm); | 398 | core_prev_state = pwrdm_read_prev_pwrst(core_pwrdm); |
404 | if (core_prev_state == PWRDM_POWER_OFF) { | 399 | if (core_prev_state == PWRDM_POWER_OFF) { |
405 | omap3_core_restore_context(); | 400 | omap3_core_restore_context(); |
@@ -407,15 +402,27 @@ static void omap_sram_idle(void) | |||
407 | omap3_sram_restore_context(); | 402 | omap3_sram_restore_context(); |
408 | omap2_sms_restore_context(); | 403 | omap2_sms_restore_context(); |
409 | } | 404 | } |
410 | if (per_next_state < PWRDM_POWER_ON) { | 405 | omap_uart_resume_idle(0); |
411 | per_prev_state = | 406 | omap_uart_resume_idle(1); |
412 | pwrdm_read_prev_pwrst(per_pwrdm); | 407 | if (core_next_state == PWRDM_POWER_OFF) |
413 | if (per_prev_state == PWRDM_POWER_OFF) | 408 | prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF, |
414 | omap3_per_restore_context(); | 409 | OMAP3430_GR_MOD, |
415 | } | 410 | OMAP3_PRM_VOLTCTRL_OFFSET); |
411 | } | ||
412 | |||
413 | /* PER */ | ||
414 | if (per_next_state < PWRDM_POWER_ON) { | ||
415 | per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); | ||
416 | omap_uart_resume_idle(2); | ||
417 | if (per_prev_state == PWRDM_POWER_OFF) | ||
418 | omap3_per_restore_context(); | ||
416 | omap2_gpio_resume_after_retention(); | 419 | omap2_gpio_resume_after_retention(); |
417 | } | 420 | } |
418 | 421 | ||
422 | /* Disable IO-PAD wakeup */ | ||
423 | if (core_next_state < PWRDM_POWER_ON) | ||
424 | prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); | ||
425 | |||
419 | pwrdm_post_transition(); | 426 | pwrdm_post_transition(); |
420 | 427 | ||
421 | } | 428 | } |