diff options
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0d50b45d041c..f3e043fe5eb8 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -27,8 +27,8 @@ | |||
27 | 27 | ||
28 | #include <plat/prcm.h> | 28 | #include <plat/prcm.h> |
29 | #include <plat/irqs.h> | 29 | #include <plat/irqs.h> |
30 | #include <plat/powerdomain.h> | 30 | #include "powerdomain.h" |
31 | #include <plat/clockdomain.h> | 31 | #include "clockdomain.h" |
32 | #include <plat/serial.h> | 32 | #include <plat/serial.h> |
33 | 33 | ||
34 | #include "pm.h" | 34 | #include "pm.h" |
@@ -293,25 +293,26 @@ select_state: | |||
293 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | 293 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); |
294 | 294 | ||
295 | /** | 295 | /** |
296 | * omap3_cpuidle_update_states - Update the cpuidle states. | 296 | * omap3_cpuidle_update_states() - Update the cpuidle states |
297 | * @mpu_deepest_state: Enable states upto and including this for mpu domain | ||
298 | * @core_deepest_state: Enable states upto and including this for core domain | ||
297 | * | 299 | * |
298 | * Currently, this function toggles the validity of idle states based upon | 300 | * This goes through the list of states available and enables and disables the |
299 | * the flag 'enable_off_mode'. When the flag is set all states are valid. | 301 | * validity of C states based on deepest state that can be achieved for the |
300 | * Else, states leading to OFF state set to be invalid. | 302 | * variable domain |
301 | */ | 303 | */ |
302 | void omap3_cpuidle_update_states(void) | 304 | void omap3_cpuidle_update_states(u32 mpu_deepest_state, u32 core_deepest_state) |
303 | { | 305 | { |
304 | int i; | 306 | int i; |
305 | 307 | ||
306 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { | 308 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { |
307 | struct omap3_processor_cx *cx = &omap3_power_states[i]; | 309 | struct omap3_processor_cx *cx = &omap3_power_states[i]; |
308 | 310 | ||
309 | if (enable_off_mode) { | 311 | if ((cx->mpu_state >= mpu_deepest_state) && |
312 | (cx->core_state >= core_deepest_state)) { | ||
310 | cx->valid = 1; | 313 | cx->valid = 1; |
311 | } else { | 314 | } else { |
312 | if ((cx->mpu_state == PWRDM_POWER_OFF) || | 315 | cx->valid = 0; |
313 | (cx->core_state == PWRDM_POWER_OFF)) | ||
314 | cx->valid = 0; | ||
315 | } | 316 | } |
316 | } | 317 | } |
317 | } | 318 | } |
@@ -452,6 +453,18 @@ void omap_init_power_states(void) | |||
452 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; | 453 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; |
453 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | | 454 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | |
454 | CPUIDLE_FLAG_CHECK_BM; | 455 | CPUIDLE_FLAG_CHECK_BM; |
456 | |||
457 | /* | ||
458 | * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot | ||
459 | * enable OFF mode in a stable form for previous revisions. | ||
460 | * we disable C7 state as a result. | ||
461 | */ | ||
462 | if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { | ||
463 | omap3_power_states[OMAP3_STATE_C7].valid = 0; | ||
464 | cpuidle_params_table[OMAP3_STATE_C7].valid = 0; | ||
465 | WARN_ONCE(1, "%s: core off state C7 disabled due to i583\n", | ||
466 | __func__); | ||
467 | } | ||
455 | } | 468 | } |
456 | 469 | ||
457 | struct cpuidle_driver omap3_idle_driver = { | 470 | struct cpuidle_driver omap3_idle_driver = { |
@@ -504,7 +517,10 @@ int __init omap3_idle_init(void) | |||
504 | return -EINVAL; | 517 | return -EINVAL; |
505 | dev->state_count = count; | 518 | dev->state_count = count; |
506 | 519 | ||
507 | omap3_cpuidle_update_states(); | 520 | if (enable_off_mode) |
521 | omap3_cpuidle_update_states(PWRDM_POWER_OFF, PWRDM_POWER_OFF); | ||
522 | else | ||
523 | omap3_cpuidle_update_states(PWRDM_POWER_RET, PWRDM_POWER_RET); | ||
508 | 524 | ||
509 | if (cpuidle_register_device(dev)) { | 525 | if (cpuidle_register_device(dev)) { |
510 | printk(KERN_ERR "%s: CPUidle register device failed\n", | 526 | printk(KERN_ERR "%s: CPUidle register device failed\n", |