浏览代码

OMAP3: PM: fix save secure RAM to restore MPU power state

Currently, on HS/EMU devices, MPU power state forced to on during PM
init by the save secure RAM code.  Rather than forcing the state of
MPU powerdomain to on, simply read the current value and restore it
after the ROM code has run.

This only affects the !CPUidle case since when CPUidle is enabled, the
MPU power state is dynamically changed by CPUidle.  In the !CPUidle
case, MPU power state is initialized once at init and never touched.

Acked-by: Tero Kristo <tero.kristo@nokia.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Kevin Hilman 14 年之前
父节点
当前提交
617fcc9802
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      arch/arm/mach-omap2/pm34xx.c

+ 4 - 3
arch/arm/mach-omap2/pm34xx.c

@@ -168,9 +168,10 @@ static void omap3_core_restore_context(void)
  * once during boot sequence, but this works as we are not using secure
  * once during boot sequence, but this works as we are not using secure
  * services.
  * services.
  */
  */
-static void omap3_save_secure_ram_context(u32 target_mpu_state)
+static void omap3_save_secure_ram_context(void)
 {
 {
 	u32 ret;
 	u32 ret;
+	int mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
 
 
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
 		/*
 		/*
@@ -181,7 +182,7 @@ static void omap3_save_secure_ram_context(u32 target_mpu_state)
 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
 		pwrdm_set_next_pwrst(mpu_pwrdm, PWRDM_POWER_ON);
 		ret = _omap_save_secure_sram((u32 *)
 		ret = _omap_save_secure_sram((u32 *)
 				__pa(omap3_secure_ram_storage));
 				__pa(omap3_secure_ram_storage));
-		pwrdm_set_next_pwrst(mpu_pwrdm, target_mpu_state);
+		pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state);
 		/* Following is for error tracking, it should not happen */
 		/* Following is for error tracking, it should not happen */
 		if (ret) {
 		if (ret) {
 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
 			printk(KERN_ERR "save_secure_sram() returns %08x\n",
@@ -1094,7 +1095,7 @@ static int __init omap3_pm_init(void)
 		local_fiq_disable();
 		local_fiq_disable();
 
 
 		omap_dma_global_context_save();
 		omap_dma_global_context_save();
-		omap3_save_secure_ram_context(PWRDM_POWER_ON);
+		omap3_save_secure_ram_context();
 		omap_dma_global_context_restore();
 		omap_dma_global_context_restore();
 
 
 		local_irq_enable();
 		local_irq_enable();