diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
commit | 56dbed129df3fdd4caf9018b6e7599ee258a5420 (patch) | |
tree | b902491aef3a99efe0d9d49edd0f6e414dba654f /arch/arm/mach-omap2/cpuidle34xx.c | |
parent | 2a2d31c8dc6f1ebcf5eab1d93a0cb0fb4ed57c7c (diff) | |
parent | f878133bf022717b880d0e0995b8f91436fd605c (diff) |
Merge branch 'linus' into idle-test
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 f9be4e3078bc..5bdfc443b77d 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" |
@@ -295,25 +295,26 @@ select_state: | |||
295 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | 295 | DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); |
296 | 296 | ||
297 | /** | 297 | /** |
298 | * omap3_cpuidle_update_states - Update the cpuidle states. | 298 | * omap3_cpuidle_update_states() - Update the cpuidle states |
299 | * @mpu_deepest_state: Enable states upto and including this for mpu domain | ||
300 | * @core_deepest_state: Enable states upto and including this for core domain | ||
299 | * | 301 | * |
300 | * Currently, this function toggles the validity of idle states based upon | 302 | * This goes through the list of states available and enables and disables the |
301 | * the flag 'enable_off_mode'. When the flag is set all states are valid. | 303 | * validity of C states based on deepest state that can be achieved for the |
302 | * Else, states leading to OFF state set to be invalid. | 304 | * variable domain |
303 | */ | 305 | */ |
304 | void omap3_cpuidle_update_states(void) | 306 | void omap3_cpuidle_update_states(u32 mpu_deepest_state, u32 core_deepest_state) |
305 | { | 307 | { |
306 | int i; | 308 | int i; |
307 | 309 | ||
308 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { | 310 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { |
309 | struct omap3_processor_cx *cx = &omap3_power_states[i]; | 311 | struct omap3_processor_cx *cx = &omap3_power_states[i]; |
310 | 312 | ||
311 | if (enable_off_mode) { | 313 | if ((cx->mpu_state >= mpu_deepest_state) && |
314 | (cx->core_state >= core_deepest_state)) { | ||
312 | cx->valid = 1; | 315 | cx->valid = 1; |
313 | } else { | 316 | } else { |
314 | if ((cx->mpu_state == PWRDM_POWER_OFF) || | 317 | cx->valid = 0; |
315 | (cx->core_state == PWRDM_POWER_OFF)) | ||
316 | cx->valid = 0; | ||
317 | } | 318 | } |
318 | } | 319 | } |
319 | } | 320 | } |
@@ -454,6 +455,18 @@ void omap_init_power_states(void) | |||
454 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; | 455 | omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; |
455 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | | 456 | omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | |
456 | CPUIDLE_FLAG_CHECK_BM; | 457 | CPUIDLE_FLAG_CHECK_BM; |
458 | |||
459 | /* | ||
460 | * Erratum i583: implementation for ES rev < Es1.2 on 3630. We cannot | ||
461 | * enable OFF mode in a stable form for previous revisions. | ||
462 | * we disable C7 state as a result. | ||
463 | */ | ||
464 | if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { | ||
465 | omap3_power_states[OMAP3_STATE_C7].valid = 0; | ||
466 | cpuidle_params_table[OMAP3_STATE_C7].valid = 0; | ||
467 | WARN_ONCE(1, "%s: core off state C7 disabled due to i583\n", | ||
468 | __func__); | ||
469 | } | ||
457 | } | 470 | } |
458 | 471 | ||
459 | struct cpuidle_driver omap3_idle_driver = { | 472 | struct cpuidle_driver omap3_idle_driver = { |
@@ -506,7 +519,10 @@ int __init omap3_idle_init(void) | |||
506 | return -EINVAL; | 519 | return -EINVAL; |
507 | dev->state_count = count; | 520 | dev->state_count = count; |
508 | 521 | ||
509 | omap3_cpuidle_update_states(); | 522 | if (enable_off_mode) |
523 | omap3_cpuidle_update_states(PWRDM_POWER_OFF, PWRDM_POWER_OFF); | ||
524 | else | ||
525 | omap3_cpuidle_update_states(PWRDM_POWER_RET, PWRDM_POWER_RET); | ||
510 | 526 | ||
511 | if (cpuidle_register_device(dev)) { | 527 | if (cpuidle_register_device(dev)) { |
512 | printk(KERN_ERR "%s: CPUidle register device failed\n", | 528 | printk(KERN_ERR "%s: CPUidle register device failed\n", |