diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
| -rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 6f67bfa0b03..bdb2388ef4c 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -59,6 +59,10 @@ #include "pad_wkup.h" +#define OMAP3_SECURE_RAM_CTX_ADDR 0x83036000 + +extern bool global_disable_off_mode; + /* pm34xx errata defined in pm.h */ u16 pm34xx_errata; bool suspend_debug; @@ -133,8 +137,7 @@ static void omap3_save_secure_ram_context(void) * will hang the system. */ pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON); - ret = _omap_save_secure_sram((u32 *) - __pa(omap3_secure_ram_storage)); + ret = _omap_save_secure_sram((u32 *)omap3_secure_ram_context); pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); /* Following is for error tracking, it should not happen */ if (ret) { @@ -667,6 +670,12 @@ 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 (global_disable_off_mode && + pwrst->pwrdm == core_pwrdm && + state == PWRDM_POWER_OFF) { + pwrst->next_state = PWRDM_POWER_RET; + pr_warn("%s: Core OFF disabled due global disable\n", + __func__); } else { pwrst->next_state = state; } @@ -741,13 +750,14 @@ static void __init pm_errata_configure(void) /* Enable the l2 cache toggling in sleep logic */ enable_omap3630_toggle_l2_on_restore(); - if (omap_rev() < OMAP3630_REV_ES1_2) + if (omap_rev() < OMAP3630_REV_ES1_2) { pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582; #ifndef CONFIG_DISABLE_OMAP_ERRATA_i583 pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; #endif - if (meminfo.bank[0].size > 256 * (1024 * 1024)) - pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; + if (meminfo.bank[0].size > 256 * (1024 * 1024)) + pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; + } } else if (cpu_is_omap34xx()) { pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582; @@ -818,8 +828,7 @@ int __init omap3_pm_init(void) omap_pm_suspend = omap3_pm_suspend; #endif - if (omap_pm_get_off_mode()) - omap3_pm_off_mode_enable(true); + omap3_pm_off_mode_enable(omap_pm_get_off_mode()); arm_pm_idle = omap3_pm_idle; omap3_idle_init(); @@ -850,15 +859,16 @@ int __init omap3_pm_init(void) * XXX Technically this workaround is only needed if off-mode * or OSWR is enabled. */ - if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582)) - clkdm_add_wkdep(per_clkdm, wkup_clkdm); + + /* + * The PER wake dependency is still needed on ES1.2 which + * has fixed i582 + */ + clkdm_add_wkdep(per_clkdm, wkup_clkdm); clkdm_add_wkdep(neon_clkdm, mpu_clkdm); if (omap_type() != OMAP2_DEVICE_TYPE_GP) { - omap3_secure_ram_storage = - kmalloc(0x803F, GFP_KERNEL); - if (!omap3_secure_ram_storage) - pr_err("Memory allocation failed when allocating for secure sram context\n"); + omap3_secure_ram_context = OMAP3_SECURE_RAM_CTX_ADDR; local_irq_disable(); |