From: Grazvydas Ignotas Date: Thu, 26 May 2016 00:31:09 +0000 (+0300) Subject: OMAP3: PM: some OFF mode hacks X-Git-Tag: sz_175~8 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d47245447c94832d2372b63ac2ad7001589368f1;p=pandora-kernel.git OMAP3: PM: some OFF mode hacks Set off mode by default where it works. Allow to set off mode for everythng except core+per or just per. --- diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index bbb1a21b7f42..64592bba7f0e 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -177,6 +177,10 @@ static int next_valid_state(struct cpuidle_device *dev, */ if (!IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) core_deepest_state = PWRDM_POWER_OFF; + + /* pandora hack */ + if (enable_off_mode < 2) + core_deepest_state = PWRDM_POWER_RET; } if (!omap_uart_can_sleep()) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 78993efc6510..572202591030 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -762,6 +762,9 @@ void omap3_pm_off_mode_enable(int enable) pwrst->next_state = PWRDM_POWER_RET; pr_warn("%s: Core OFF disabled due to errata i583\n", __func__); + } else if (enable < 3 && pwrst->pwrdm == per_pwrdm) { + /* pandora hack */ + pwrst->next_state = PWRDM_POWER_RET; } else { pwrst->next_state = state; } @@ -810,6 +813,29 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) if (pwrdm_has_hdwr_sar(pwrdm)) pwrdm_enable_hdwr_sar(pwrdm); + /* pandora OFF hacks, notes for missing: + * - core_pwrdm - loses GPIO state?! + * - per_pwrdm - must keep RET because of GPIOs + * - neon_pwrdm - depends on mpu_pwrdm + * - mpu_pwrdm - sometimes hangs? + * notes for enabled: + * - usbhost_pwrdm - does driver reload + reinit anyway, no runtime PM + * - sgx_pwrdm - only OFF is supported + * - dss_pwrdm - works, needs working context_loss counter + * - cam_pwrdm - not used + * - iva2_pwrdm - c64_tools reprograms with direct reg hits anyway + */ + if ( pwrdm == pwrdm_lookup("usbhost_pwrdm") + || pwrdm == pwrdm_lookup("sgx_pwrdm") + || pwrdm == pwrdm_lookup("cam_pwrdm") + || pwrdm == pwrdm_lookup("iva2_pwrdm") + ) + pwrst->next_state = PWRDM_POWER_OFF; + + /* on OMAP3, at least on ES2.1, DSS drains more in OFF than in RET?? */ + else if (cpu_is_omap3630() && pwrdm == pwrdm_lookup("dss_pwrdm")) + pwrst->next_state = PWRDM_POWER_OFF; + return omap_set_pwrdm_state(pwrst->pwrdm, pwrst->next_state); }