ARM: OMAP2+: some PM fixes and cleanup for 3.9
Subsystems (4)
Paul Walmsley
maintainercover ARM: OMAP2+: some PM fixes and cleanup for 3.9
Several OMAP2+ power management fixes, optimizations, and cleanup, intended for 3.9. This series is a prerequisite for the functional powerdomain conversion series.
- Paul
---
vmlinux object size
(delta in bytes from TEST_cleanup-prcm_c9d501e5_v3.7-rc (c9d501e5cb0238910337213e12a09127221c35d8)):
text data bss total kernel
0 0 0 0 am33xx_only
+56 0 0 +56 n800_multi_omap2xxx
+56 0 0 +56 n800_only_a
0 0 0 0 omap1_defconfig
0 0 0 0 omap1_defconfig_1510innovator_only
0 0 0 0 omap1_defconfig_5912osk_only
+160 0 0 +160 omap2plus_defconfig
+88 0 0 +88 omap2plus_defconfig_2430sdp_only
+108 0 0 +108 omap2plus_defconfig_cpupm
+160 0 0 +160 omap2plus_defconfig_no_pm
+32 0 0 +32 omap2plus_defconfig_omap2_4_only
-84 0 0 -84 omap2plus_defconfig_omap3_4_only
+304 0 -48 +256 rmk_omap3430_ldp_allnoconfig
0 0 0 0 rmk_omap3430_ldp_oldconfig
+304 0 -48 +256 rmk_omap4430_sdp_allnoconfig
-48 0 0 -48 rmk_omap4430_sdp_oldconfigJean Pihet (1):
ARM: OMAP2+: powerdomain: fix powerdomain trace integration
Paul Walmsley (5):
ARM: OMAP2xxx: powerdomain: core powerdomain missing logic retention states
ARM: OMAP2/3: PRM: fix bogus OMAP2xxx powerstate return values
ARM: OMAP3xxx: CPUIdle: simplify the PER next-state code
ARM: OMAP3xxx: CPUIdle: optimize __omap3_enter_idle()
ARM: OMAP4: MPUSS PM: remove unnecessary shim functions for powerdomain control
arch/arm/mach-omap2/cpuidle34xx.c | 79 ++++++++++++++---------- arch/arm/mach-omap2/omap-mpuss-lowpower.c | 43 ++----------- arch/arm/mach-omap2/powerdomain.c | 7 +- arch/arm/mach-omap2/powerdomains2xxx_data.c | 1 arch/arm/mach-omap2/prm2xxx.c | 88 ++++++++++++++++++++++++++- arch/arm/mach-omap2/prm2xxx_3xxx.c | 22 ------- arch/arm/mach-omap2/prm3xxx.c | 28 ++++++++- 7 files changed, 166 insertions(+), 102 deletions(-)
Paul Walmsley
maintainerPATCH 1/6 ARM: OMAP2xxx: powerdomain: core powerdomain missing logic retention states
Add the possible logic retention states for the 24xx CORE powerdomain. Subsequent patches use this data to avoid returning incorrect data, by skipping reads from register bitfields that don't actually exist.
--- arch/arm/mach-omap2/powerdomains2xxx_data.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/powerdomains2xxx_data.c +1 -0
@@ -60,6 +60,7 @@ static struct powerdomain core_24xx_pwrdm = { .name = "core_pwrdm", .prcm_offs = CORE_MOD, .pwrsts = PWRSTS_OFF_RET_ON, + .pwrsts_logic_ret = PWRSTS_RET, .banks = 3, .pwrsts_mem_ret = { [0] = PWRSTS_OFF_RET, /* MEM1RETSTATE */
Paul Walmsley
maintainerPATCH 2/6 ARM: OMAP2/3: PRM: fix bogus OMAP2xxx powerstate return values
In reply to Paul WalmsleyOn OMAP2xxx chips, the register bitfields for the PM_PWSTCTRL_*.POWERSTATE and PM_PWSTST_*.LASTSTATEENTERED are different than those used on OMAP3/4. The order is reversed. So, for example, on OMAP2xxx, 0x0 indicates 'ON'; but on OMAP3/4, 0x0 indicates 'OFF'. Similarly, on OMAP2xxx, 0x3 indicates 'OFF', but on OMAP3/4, 0x3 indicates 'ON'.
To fix this, we treat the OMAP3/4 values as the powerdomain API values, and create new low-level powerdomain functions for the OMAP2xxx chips which translate between the OMAP2xxx values and the OMAP3/4 values.
Without this patch, the conversion of the OMAP2xxx PM code to the functional powerstate code results in a non-booting kernel.
--- arch/arm/mach-omap2/prm2xxx.c | 88 +++++++++++++++++++++++++++++++++++- arch/arm/mach-omap2/prm2xxx_3xxx.c | 22 --------- arch/arm/mach-omap2/prm3xxx.c | 28 ++++++++++- 3 files changed, 110 insertions(+), 28 deletions(-)
arch/arm/mach-omap2/prm2xxx.c +85 -3
@@ -29,6 +29,14 @@#include "prm-regbits-24xx.h" /* +* OMAP24xx PM_PWSTCTRL_*.POWERSTATE and PM_PWSTST_*.LASTSTATEENTERED bits - +* these are reversed from the bits used on OMAP3+ +*/ +#define OMAP24XX_PWRDM_POWER_ON 0x0 +#define OMAP24XX_PWRDM_POWER_RET 0x1 +#define OMAP24XX_PWRDM_POWER_OFF 0x3 + +/* * omap2xxx_prm_reset_src_map - map from bits in the PRM_RSTST_WKUP * hardware register (which are specific to the OMAP2xxx SoCs) to * reset source ID bit shifts (which is an OMAP SoC-independent
@@ -69,6 +77,34 @@ static u32 omap2xxx_prm_read_reset_sources(void) }/** +* omap2xxx_pwrst_to_common_pwrst - convert OMAP2xxx pwrst to common pwrst +* @omap2xxx_pwrst: OMAP2xxx hardware power state to convert +* +* Return the common power state bits corresponding to the OMAP2xxx +* hardware power state bits @omap2xxx_pwrst, or -EINVAL upon error. +*/ +static int omap2xxx_pwrst_to_common_pwrst (u8 omap2xxx_pwrst) +{ +u8 pwrst; + +switch (omap2xxx_pwrst) { +case OMAP24XX_PWRDM_POWER_OFF : + pwrst =PWRDM_POWER_OFF ; +break ; +case OMAP24XX_PWRDM_POWER_RET : + pwrst =PWRDM_POWER_RET ; +break ; +case OMAP24XX_PWRDM_POWER_ON : + pwrst =PWRDM_POWER_ON ; +break ; +default : +return -EINVAL ; + } + +return pwrst; +} + +/** * omap2xxx_prm_dpll_reset - use DPLL reset to reboot the OMAP SoC * * Set the DPLL reset bit, which should reboot the SoC. This is the
@@ -98,10 +134,56 @@ int omap2xxx_clkdm_wakeup(struct clockdomain *clkdm)return 0 ; } +static int omap2xxx_pwrdm_set_next_pwrst (struct powerdomain *pwrdm,u8 pwrst) +{ +u8 omap24xx_pwrst; + +switch (pwrst) { +case PWRDM_POWER_OFF : + omap24xx_pwrst =OMAP24XX_PWRDM_POWER_OFF ; +break ; +case PWRDM_POWER_RET : + omap24xx_pwrst =OMAP24XX_PWRDM_POWER_RET ; +break ; +case PWRDM_POWER_ON : + omap24xx_pwrst =OMAP24XX_PWRDM_POWER_ON ; +break ; +default : +return -EINVAL ; + } + +omap2_prm_rmw_mod_reg_bits (OMAP_POWERSTATE_MASK , + (omap24xx_pwrst <<OMAP_POWERSTATE_SHIFT ), + pwrdm->prcm_offs,OMAP2_PM_PWSTCTRL ); +return 0 ; +} + +static int omap2xxx_pwrdm_read_next_pwrst (struct powerdomain *pwrdm) +{ +u8 omap2xxx_pwrst; + + omap2xxx_pwrst =omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, +OMAP2_PM_PWSTCTRL , +OMAP_POWERSTATE_MASK ); + +return omap2xxx_pwrst_to_common_pwrst (omap2xxx_pwrst); +} + +static int omap2xxx_pwrdm_read_pwrst (struct powerdomain *pwrdm) +{ +u8 omap2xxx_pwrst; + + omap2xxx_pwrst =omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, +OMAP2_PM_PWSTST , +OMAP_POWERSTATEST_MASK ); + +return omap2xxx_pwrst_to_common_pwrst (omap2xxx_pwrst); +} +struct pwrdm_ops omap2_pwrdm_operations = { - .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst, - .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst, - .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst, + .pwrdm_set_next_pwrst = omap2xxx_pwrdm_set_next_pwrst, + .pwrdm_read_next_pwrst = omap2xxx_pwrdm_read_next_pwrst, + .pwrdm_read_pwrst = omap2xxx_pwrdm_read_pwrst, .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst, .pwrdm_set_mem_onst = omap2_pwrdm_set_mem_onst, .pwrdm_set_mem_retst = omap2_pwrdm_set_mem_retst,
arch/arm/mach-omap2/prm2xxx_3xxx.c +0 -22
@@ -103,28 +103,6 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift)/* Powerdomain low-level functions */ /* Common functions across OMAP2 and OMAP3 */ -int omap2_pwrdm_set_next_pwrst (struct powerdomain *pwrdm,u8 pwrst) -{ -omap2_prm_rmw_mod_reg_bits (OMAP_POWERSTATE_MASK , - (pwrst <<OMAP_POWERSTATE_SHIFT ), - pwrdm->prcm_offs,OMAP2_PM_PWSTCTRL ); -return 0 ; -} - -int omap2_pwrdm_read_next_pwrst (struct powerdomain *pwrdm) -{ -return omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, -OMAP2_PM_PWSTCTRL , -OMAP_POWERSTATE_MASK ); -} - -int omap2_pwrdm_read_pwrst (struct powerdomain *pwrdm) -{ -return omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, -OMAP2_PM_PWSTST , -OMAP_POWERSTATEST_MASK ); -} -int omap2_pwrdm_set_mem_onst (struct powerdomain *pwrdm,u8 bank,u8 pwrst) {
arch/arm/mach-omap2/prm3xxx.c +25 -3
@@ -278,6 +278,28 @@ static u32 omap3xxx_prm_read_reset_sources(void)/* Powerdomain low-level functions */ +static int omap3_pwrdm_set_next_pwrst (struct powerdomain *pwrdm,u8 pwrst) +{ +omap2_prm_rmw_mod_reg_bits (OMAP_POWERSTATE_MASK , + (pwrst <<OMAP_POWERSTATE_SHIFT ), + pwrdm->prcm_offs,OMAP2_PM_PWSTCTRL ); +return 0 ; +} + +static int omap3_pwrdm_read_next_pwrst (struct powerdomain *pwrdm) +{ +return omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, +OMAP2_PM_PWSTCTRL , +OMAP_POWERSTATE_MASK ); +} + +static int omap3_pwrdm_read_pwrst (struct powerdomain *pwrdm) +{ +return omap2_prm_read_mod_bits_shift (pwrdm->prcm_offs, +OMAP2_PM_PWSTST , +OMAP_POWERSTATEST_MASK ); +} +/* Applicable only for OMAP3. Not supported on OMAP2 */ static int omap3_pwrdm_read_prev_pwrst (struct powerdomain *pwrdm) {
@@ -356,9 +378,9 @@ static int omap3_pwrdm_disable_hdwr_sar(struct powerdomain *pwrdm) }struct pwrdm_ops omap3_pwrdm_operations = { - .pwrdm_set_next_pwrst = omap2_pwrdm_set_next_pwrst, - .pwrdm_read_next_pwrst = omap2_pwrdm_read_next_pwrst, - .pwrdm_read_pwrst = omap2_pwrdm_read_pwrst, + .pwrdm_set_next_pwrst = omap3_pwrdm_set_next_pwrst, + .pwrdm_read_next_pwrst = omap3_pwrdm_read_next_pwrst, + .pwrdm_read_pwrst = omap3_pwrdm_read_pwrst, .pwrdm_read_prev_pwrst = omap3_pwrdm_read_prev_pwrst, .pwrdm_set_logic_retst = omap2_pwrdm_set_logic_retst, .pwrdm_read_logic_pwrst = omap3_pwrdm_read_logic_pwrst,
Paul Walmsley
maintainerPATCH 3/6 ARM: OMAP3xxx: CPUIdle: simplify the PER next-state code
In reply to Paul WalmsleyThe OMAP3xxx CPUIdle driver contains some code to place a lower bound on the PER powerdomain's power state. Convert this code to a data-driven implementation to remove branches and to improve readability.
--- arch/arm/mach-omap2/cpuidle34xx.c | 44 +++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-)
arch/arm/mach-omap2/cpuidle34xx.c +22 -22
@@ -36,38 +36,51 @@/* Mach specific information to be recorded in the C-state driver_data */ struct omap3_idle_statedata { -u32 mpu_state; -u32 core_state; +u8 mpu_state; +u8 core_state; +u8 per_min_state; }; +/* +* Prevent PER OFF if CORE is not in RETention or OFF as this would +* disable PER wakeups completely. +*/ static struct omap3_idle_statedata omap3_idle_data[] = { { .mpu_state =PWRDM_POWER_ON , .core_state =PWRDM_POWER_ON , +/* In C1 do not allow PER state lower than CORE state */ + .per_min_state =PWRDM_POWER_ON , }, { .mpu_state =PWRDM_POWER_ON , .core_state =PWRDM_POWER_ON , + .per_min_state =PWRDM_POWER_RET , }, { .mpu_state =PWRDM_POWER_RET , .core_state =PWRDM_POWER_ON , + .per_min_state =PWRDM_POWER_RET , }, { .mpu_state =PWRDM_POWER_OFF , .core_state =PWRDM_POWER_ON , + .per_min_state =PWRDM_POWER_RET , }, { .mpu_state =PWRDM_POWER_RET , .core_state =PWRDM_POWER_RET , + .per_min_state =PWRDM_POWER_OFF , }, { .mpu_state =PWRDM_POWER_OFF , .core_state =PWRDM_POWER_RET , + .per_min_state =PWRDM_POWER_OFF , }, { .mpu_state =PWRDM_POWER_OFF , .core_state =PWRDM_POWER_OFF , + .per_min_state =PWRDM_POWER_OFF , }, };
@@ -207,10 +220,9 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,struct cpuidle_driver *drv, int index) { - int new_state_idx; -u32 core_next_state, per_next_state =0 , per_saved_state =0 ; + int new_state_idx, ret; +u8 per_next_state, per_saved_state;struct omap3_idle_statedata *cx; -int ret;/* * Use only C1 if CAM is active.
@@ -231,25 +243,13 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,/* Program PER state */ cx = &omap3_idle_data[new_state_idx]; - core_next_state = cx->core_state; - per_next_state = per_saved_state =pwrdm_read_next_pwrst (per_pd); -if (new_state_idx ==0 ) { -/* In C1 do not allow PER state lower than CORE state */ -if (per_next_state < core_next_state) - per_next_state = core_next_state; - }else { -/* -* Prevent PER OFF if CORE is not in RETention or OFF as this -* would disable PER wakeups completely. -*/ -if ((per_next_state ==PWRDM_POWER_OFF ) && - (core_next_state >PWRDM_POWER_RET )) - per_next_state =PWRDM_POWER_RET ; - } -/* Are we changing PER target state? */ -if (per_next_state != per_saved_state) + per_next_state =pwrdm_read_next_pwrst (per_pd); + per_saved_state = per_next_state; +if (per_next_state < cx->per_min_state) { + per_next_state = cx->per_min_state;pwrdm_set_next_pwrst (per_pd, per_next_state); + } ret =omap3_enter_idle (dev, drv, new_state_idx);
Paul Walmsley
maintainerPATCH 4/6 ARM: OMAP3xxx: CPUIdle: optimize __omap3_enter_idle()
In reply to Paul WalmsleyAvoid programming the MPU and CORE powerdomain next-power-state registers if those powerdomains will never enter low-power states (e.g., the state that people refer to as "C1").
To avoid making assumptions about CPUIdle states based on their order in the list, use a flag to mark CPUIdle states that don't enter powerdomain low-power states.
Avoid a previous-power-state register read on the MPU powerdomain unless we know that the MPU was supposed to go OFF during the last state transition. Previous-power-state register reads can be very expensive, so it's worth avoiding these when possible.
Since the CORE_L3 clockdomain can't go inactive unless the MPU is active, there's little point blocking autoidle on the CORE_L3 clockdomain in "C1" state, since we've programmed the MPU clockdomain to stay active. Remove the unnecessary code.
--- arch/arm/mach-omap2/cpuidle34xx.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/cpuidle34xx.c +22 -13
@@ -39,9 +39,21 @@ struct omap3_idle_statedata {u8 mpu_state;u8 core_state;u8 per_min_state; +u8 flags; };/* +* Possible flag bits for struct omap3_idle_statedata.flags: +* +* OMAP_CPUIDLE_CX_NO_CLKDM_IDLE: don't allow the MPU clockdomain to go +* inactive. This in turn prevents the MPU DPLL from entering autoidle +* mode, so wakeup latency is greatly reduced, at the cost of additional +* energy consumption. This also prevents the CORE clockdomain from +* entering idle. +*/ +#define OMAP_CPUIDLE_CX_NO_CLKDM_IDLE BIT(0) + +/* * Prevent PER OFF if CORE is not in RETention or OFF as this would * disable PER wakeups completely. */
@@ -51,6 +63,7 @@ static struct omap3_idle_statedata omap3_idle_data[] = { .core_state = PWRDM_POWER_ON, /* In C1 do not allow PER state lower than CORE state */ .per_min_state = PWRDM_POWER_ON, + .flags = OMAP_CPUIDLE_CX_NO_CLKDM_IDLE, }, { .mpu_state = PWRDM_POWER_ON,
@@ -91,27 +104,25 @@ static int __omap3_enter_idle(struct cpuidle_device *dev, int index) {struct omap3_idle_statedata *cx = &omap3_idle_data[index]; -u32 mpu_state = cx->mpu_state, core_state = cx->core_state;local_fiq_disable (); -pwrdm_set_next_pwrst (mpu_pd, mpu_state); -pwrdm_set_next_pwrst (core_pd, core_state); -if (omap_irq_pending () ||need_resched ()) goto return_sleep_time;/* Deny idle for C1 */ -if (index ==0 ) { +if (cx->flags &OMAP_CPUIDLE_CX_NO_CLKDM_IDLE ) {clkdm_deny_idle (mpu_pd->pwrdm_clkdms[0 ]); -clkdm_deny_idle (core_pd->pwrdm_clkdms[0 ]); + }else { +pwrdm_set_next_pwrst (mpu_pd, cx->mpu_state); +pwrdm_set_next_pwrst (core_pd, cx->core_state); }/* * Call idle CPU PM enter notifier chain so that * VFP context is saved. */ -if (mpu_state ==PWRDM_POWER_OFF ) +if (cx->mpu_state ==PWRDM_POWER_OFF )cpu_pm_enter ();/* Execute ARM wfi */
@@ -121,17 +132,15 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,* Call idle CPU PM enter notifier chain to restore * VFP context. */ -if (pwrdm_read_prev_pwrst (mpu_pd) ==PWRDM_POWER_OFF ) +if (cx->mpu_state ==PWRDM_POWER_OFF && +pwrdm_read_prev_pwrst (mpu_pd) ==PWRDM_POWER_OFF )cpu_pm_exit ();/* Re-allow idle for C1 */ -if (index ==0 ) { +if (cx->flags &OMAP_CPUIDLE_CX_NO_CLKDM_IDLE )clkdm_allow_idle (mpu_pd->pwrdm_clkdms[0 ]); -clkdm_allow_idle (core_pd->pwrdm_clkdms[0 ]); - } return_sleep_time: -local_fiq_enable ();return index;
@@ -196,7 +205,7 @@ static int next_valid_state(struct cpuidle_device *dev,* Start search from the next (lower) state. */ for (idx = index -1 ; idx >=0 ; idx--) { - cx = &omap3_idle_data[idx]; + cx = &omap3_idle_data[idx];if ((cx->mpu_state >= mpu_deepest_state) && (cx->core_state >= core_deepest_state)) { next_index = idx;
Paul Walmsley
maintainerPATCH 5/6 ARM: OMAP4: MPUSS PM: remove unnecessary shim functions for powerdomain control
In reply to Paul WalmsleyThe OMAP4 MPU subsystem power management code contains several unnecessary shim functions for powerdomain control; remove them.
--- arch/arm/mach-omap2/omap-mpuss-lowpower.c | 43 +++++------------------------ 1 file changed, 7 insertions(+), 36 deletions(-)
arch/arm/mach-omap2/omap-mpuss-lowpower.c +7 -36
@@ -86,37 +86,6 @@ static inline void set_cpu_wakeup_addr(unsigned int cpu_id, u32 addr) }/* -* Set the CPUx powerdomain's previous power state -*/ -static inline void set_cpu_next_pwrst (unsigned int cpu_id, -unsigned int power_state) -{ -struct omap4_cpu_pm_info *pm_info = &per_cpu (omap4_pm_info, cpu_id); - -pwrdm_set_next_pwrst (pm_info->pwrdm, power_state); -} - -/* -* Read CPU's previous power state -*/ -static inline unsigned int read_cpu_prev_pwrst (unsigned int cpu_id) -{ -struct omap4_cpu_pm_info *pm_info = &per_cpu (omap4_pm_info, cpu_id); - -return pwrdm_read_prev_pwrst (pm_info->pwrdm); -} - -/* -* Clear the CPUx powerdomain's previous power state -*/ -static inline void clear_cpu_prev_pwrst (unsigned int cpu_id) -{ -struct omap4_cpu_pm_info *pm_info = &per_cpu (omap4_pm_info, cpu_id); - -pwrdm_clear_all_prev_pwrst (pm_info->pwrdm); -} - -/* * Store the SCU power status value to scratchpad memory */ static void scu_pwrst_prepare (unsigned int cpu_id,unsigned int cpu_state)
@@ -229,6 +198,7 @@ static void save_l2x0_context(void)*/ int omap4_enter_lowpower (unsigned int cpu,unsigned int power_state) { +struct omap4_cpu_pm_info *pm_info = &per_cpu (omap4_pm_info, cpu);unsigned int save_state =0 ;unsigned int wakeup_cpu;
@@ -267,7 +237,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state) save_state =2 ;cpu_clear_prev_logic_pwrst (cpu); -set_cpu_next_pwrst (cpu, power_state); +pwrdm_set_next_pwrst (pm_info->pwrdm, power_state);set_cpu_wakeup_addr (cpu,virt_to_phys (omap4_cpu_resume));scu_pwrst_prepare (cpu, power_state);l2x0_pwrst_prepare (cpu, save_state);
@@ -285,7 +255,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)* domain transition */ wakeup_cpu =smp_processor_id (); -set_cpu_next_pwrst (wakeup_cpu,PWRDM_POWER_ON ); +pwrdm_set_next_pwrst (pm_info->pwrdm,PWRDM_POWER_ON );pwrdm_post_transition (NULL );
@@ -299,6 +269,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)*/ int __cpuinit omap4_hotplug_cpu (unsigned int cpu,unsigned int power_state) { +struct omap4_cpu_pm_info *pm_info = &per_cpu (omap4_pm_info, cpu);unsigned int cpu_state =0 ;if (omap_rev () ==OMAP4430_REV_ES1_0 )
@@ -307,8 +278,8 @@ int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)if (power_state ==PWRDM_POWER_OFF ) cpu_state =1 ; -clear_cpu_prev_pwrst (cpu); -set_cpu_next_pwrst (cpu, power_state); +pwrdm_clear_all_prev_pwrst (pm_info->pwrdm); +pwrdm_set_next_pwrst (pm_info->pwrdm, power_state);set_cpu_wakeup_addr (cpu,virt_to_phys (omap_secondary_startup));scu_pwrst_prepare (cpu, power_state);
@@ -319,7 +290,7 @@ int __cpuinit omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state)*/ omap4_finish_suspend (cpu_state); -set_cpu_next_pwrst (cpu,PWRDM_POWER_ON ); +pwrdm_set_next_pwrst (pm_info->pwrdm,PWRDM_POWER_ON );return 0 ; }
PATCH 5/6 ARM: OMAP4: MPUSS PM: remove unnecessary shim functions for powerdomain control
Quoted 7 lines · Paul Walmsley
The OMAP4 MPU subsystem power management code contains several unnecessary shim functions for powerdomain control; remove them.
Signed-off-by Paul Walmsley <[email protected]>Cc Santosh Shilimkar <[email protected]>Cc Kevin Hilman <[email protected]>---
Most of them are inline functions so final object code will mostly same after and before the patch. But cleaning these helpers is better I guess. So..
Paul Walmsley
maintainerPATCH 6/6 ARM: OMAP2+: powerdomain: fix powerdomain trace integration
In reply to Paul WalmsleyFrom: Jean Pihet <[email protected]>
Fix the trace in the case a power domain did not hit the desired state, as reported by Paul Walmsley.
[paul at pwsan.com: split this fix off from the patch
"ARM: OMAP2+: PM debug: trace the functional power domains states"]
--- arch/arm/mach-omap2/powerdomain.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/powerdomain.c +4 -3
@@ -143,7 +143,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)static int _pwrdm_state_switch (struct powerdomain *pwrdm,int flag) { -int prev, state, trace_state =0 ; +int prev, next, state, trace_state =0 ;if (pwrdm ==NULL )return -EINVAL ;
@@ -164,9 +164,10 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)* If the power domain did not hit the desired state, * generate a trace event with both the desired and hit states */ -if (state != prev) { + next =pwrdm_read_next_pwrst (pwrdm); +if (next != prev) { trace_state = (PWRDM_TRACE_STATES_FLAG | - ((state &OMAP_POWERSTATE_MASK ) <<8 ) | + ((next &OMAP_POWERSTATE_MASK ) <<8 ) | ((prev &OMAP_POWERSTATE_MASK ) <<0 ));trace_power_domain_target (pwrdm->name, trace_state,smp_processor_id ());