diff options
author | Rajendra Nayak <rnayak@ti.com> | 2008-09-26 08:19:56 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-11 17:42:25 -0500 |
commit | 61255ab9e853ddbbe092328c30921d2ba9434134 (patch) | |
tree | fb98af6ee37546e36ebce77da40d4a6fd99aee78 | |
parent | 57f277b0122722ffa1de1b53aceb70646ce9a8e1 (diff) |
OMAP3: PM: MPU off-mode support
Adds a 'save_state' option when calling into SRAM idle function
and adds some minor cleanups of SRAM asm code.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
-rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 8b5bf91dc070..9fb087607e76 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <plat/powerdomain.h> | 28 | #include <plat/powerdomain.h> |
29 | #include <plat/control.h> | 29 | #include <plat/control.h> |
30 | #include <plat/serial.h> | 30 | #include <plat/serial.h> |
31 | #include <plat/sdrc.h> | ||
31 | 32 | ||
32 | #include <asm/tlbflush.h> | 33 | #include <asm/tlbflush.h> |
33 | 34 | ||
@@ -223,6 +224,9 @@ static void omap_sram_idle(void) | |||
223 | /* No need to save context */ | 224 | /* No need to save context */ |
224 | save_state = 0; | 225 | save_state = 0; |
225 | break; | 226 | break; |
227 | case PWRDM_POWER_OFF: | ||
228 | save_state = 3; | ||
229 | break; | ||
226 | default: | 230 | default: |
227 | /* Invalid state */ | 231 | /* Invalid state */ |
228 | printk(KERN_ERR "Invalid mpu state in sram_idle\n"); | 232 | printk(KERN_ERR "Invalid mpu state in sram_idle\n"); |
@@ -248,7 +252,12 @@ static void omap_sram_idle(void) | |||
248 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); | 252 | prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); |
249 | } | 253 | } |
250 | 254 | ||
251 | _omap_sram_idle(NULL, save_state); | 255 | /* |
256 | * omap3_arm_context is the location where ARM registers | ||
257 | * get saved. The restore path then reads from this | ||
258 | * location and restores them back. | ||
259 | */ | ||
260 | _omap_sram_idle(omap3_arm_context, save_state); | ||
252 | cpu_init(); | 261 | cpu_init(); |
253 | 262 | ||
254 | /* Restore table entry modified during MMU restoration */ | 263 | /* Restore table entry modified during MMU restoration */ |
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index 6a749f2fea63..f8d3834bf681 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -36,12 +36,11 @@ | |||
36 | OMAP3430_PM_PREPWSTST) | 36 | OMAP3430_PM_PREPWSTST) |
37 | #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ | 37 | #define PM_PREPWSTST_MPU_V OMAP34XX_PRM_REGADDR(MPU_MOD, \ |
38 | OMAP3430_PM_PREPWSTST) | 38 | OMAP3430_PM_PREPWSTST) |
39 | #define PM_PWSTCTRL_MPU_P OMAP34XX_PRM_REGADDR(MPU_MOD, PM_PWSTCTRL) | 39 | #define PM_PWSTCTRL_MPU_P OMAP3430_PRM_BASE + MPU_MOD + PM_PWSTCTRL |
40 | #define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is | 40 | #define SCRATCHPAD_MEM_OFFS 0x310 /* Move this as correct place is |
41 | * available */ | 41 | * available */ |
42 | #define SCRATCHPAD_BASE_P OMAP343X_CTRL_REGADDR(\ | 42 | #define SCRATCHPAD_BASE_P (OMAP343X_CTRL_BASE + OMAP343X_CONTROL_MEM_WKUP\ |
43 | OMAP343X_CONTROL_MEM_WKUP +\ | 43 | + SCRATCHPAD_MEM_OFFS) |
44 | SCRATCHPAD_MEM_OFFS) | ||
45 | #define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER) | 44 | #define SDRC_POWER_V OMAP34XX_SDRC_REGADDR(SDRC_POWER) |
46 | 45 | ||
47 | .text | 46 | .text |
@@ -96,7 +95,7 @@ loop: | |||
96 | 95 | ||
97 | ldmfd sp!, {r0-r12, pc} @ restore regs and return | 96 | ldmfd sp!, {r0-r12, pc} @ restore regs and return |
98 | restore: | 97 | restore: |
99 | /* b restore*/ @ Enable to debug restore code | 98 | /* b restore*/ @ Enable to debug restore code |
100 | /* Check what was the reason for mpu reset and store the reason in r9*/ | 99 | /* Check what was the reason for mpu reset and store the reason in r9*/ |
101 | /* 1 - Only L1 and logic lost */ | 100 | /* 1 - Only L1 and logic lost */ |
102 | /* 2 - Only L2 lost - In this case, we wont be here */ | 101 | /* 2 - Only L2 lost - In this case, we wont be here */ |
@@ -416,8 +415,6 @@ scratchpad_base: | |||
416 | .word SCRATCHPAD_BASE_P | 415 | .word SCRATCHPAD_BASE_P |
417 | sdrc_power: | 416 | sdrc_power: |
418 | .word SDRC_POWER_V | 417 | .word SDRC_POWER_V |
419 | context_mem: | ||
420 | .word 0x803E3E14 | ||
421 | clk_stabilize_delay: | 418 | clk_stabilize_delay: |
422 | .word 0x000001FF | 419 | .word 0x000001FF |
423 | assoc_mask: | 420 | assoc_mask: |