aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-omap2/control.c7
-rw-r--r--arch/arm/mach-omap2/control.h6
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S55
3 files changed, 16 insertions, 52 deletions
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index da53ba3917ca..aab884fecc55 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -286,14 +286,15 @@ void omap3_save_scratchpad_contents(void)
286 scratchpad_contents.boot_config_ptr = 0x0; 286 scratchpad_contents.boot_config_ptr = 0x0;
287 if (cpu_is_omap3630()) 287 if (cpu_is_omap3630())
288 scratchpad_contents.public_restore_ptr = 288 scratchpad_contents.public_restore_ptr =
289 virt_to_phys(get_omap3630_restore_pointer()); 289 virt_to_phys(omap3_restore_3630);
290 else if (omap_rev() != OMAP3430_REV_ES3_0 && 290 else if (omap_rev() != OMAP3430_REV_ES3_0 &&
291 omap_rev() != OMAP3430_REV_ES3_1) 291 omap_rev() != OMAP3430_REV_ES3_1)
292 scratchpad_contents.public_restore_ptr = 292 scratchpad_contents.public_restore_ptr =
293 virt_to_phys(get_restore_pointer()); 293 virt_to_phys(omap3_restore);
294 else 294 else
295 scratchpad_contents.public_restore_ptr = 295 scratchpad_contents.public_restore_ptr =
296 virt_to_phys(get_es3_restore_pointer()); 296 virt_to_phys(omap3_restore_es3);
297
297 if (omap_type() == OMAP2_DEVICE_TYPE_GP) 298 if (omap_type() == OMAP2_DEVICE_TYPE_GP)
298 scratchpad_contents.secure_ram_restore_ptr = 0x0; 299 scratchpad_contents.secure_ram_restore_ptr = 0x0;
299 else 300 else
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h
index a016c8b59e00..d4ef75d5a382 100644
--- a/arch/arm/mach-omap2/control.h
+++ b/arch/arm/mach-omap2/control.h
@@ -386,9 +386,9 @@ extern void omap4_ctrl_pad_writel(u32 val, u16 offset);
386 386
387extern void omap3_save_scratchpad_contents(void); 387extern void omap3_save_scratchpad_contents(void);
388extern void omap3_clear_scratchpad_contents(void); 388extern void omap3_clear_scratchpad_contents(void);
389extern u32 *get_restore_pointer(void); 389extern void omap3_restore(void);
390extern u32 *get_es3_restore_pointer(void); 390extern void omap3_restore_es3(void);
391extern u32 *get_omap3630_restore_pointer(void); 391extern void omap3_restore_3630(void);
392extern u32 omap3_arm_context[128]; 392extern u32 omap3_arm_context[128];
393extern void omap3_control_save_context(void); 393extern void omap3_control_save_context(void);
394extern void omap3_control_restore_context(void); 394extern void omap3_control_restore_context(void);
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 9a1349ea460a..d18f52e46c7c 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -74,46 +74,6 @@
74 * API functions 74 * API functions
75 */ 75 */
76 76
77/*
78 * The "get_*restore_pointer" functions are used to provide a
79 * physical restore address where the ROM code jumps while waking
80 * up from MPU OFF/OSWR state.
81 * The restore pointer is stored into the scratchpad.
82 */
83
84 .text
85/* Function call to get the restore pointer for resume from OFF */
86ENTRY(get_restore_pointer)
87 stmfd sp!, {lr} @ save registers on stack
88 adr r0, restore
89 ldmfd sp!, {pc} @ restore regs and return
90ENDPROC(get_restore_pointer)
91 .align
92ENTRY(get_restore_pointer_sz)
93 .word . - get_restore_pointer
94
95 .text
96/* Function call to get the restore pointer for 3630 resume from OFF */
97ENTRY(get_omap3630_restore_pointer)
98 stmfd sp!, {lr} @ save registers on stack
99 adr r0, restore_3630
100 ldmfd sp!, {pc} @ restore regs and return
101ENDPROC(get_omap3630_restore_pointer)
102 .align
103ENTRY(get_omap3630_restore_pointer_sz)
104 .word . - get_omap3630_restore_pointer
105
106 .text
107/* Function call to get the restore pointer for ES3 to resume from OFF */
108ENTRY(get_es3_restore_pointer)
109 stmfd sp!, {lr} @ save registers on stack
110 adr r0, restore_es3
111 ldmfd sp!, {pc} @ restore regs and return
112ENDPROC(get_es3_restore_pointer)
113 .align
114ENTRY(get_es3_restore_pointer_sz)
115 .word . - get_es3_restore_pointer
116
117 .text 77 .text
118/* 78/*
119 * L2 cache needs to be toggled for stable OFF mode functionality on 3630. 79 * L2 cache needs to be toggled for stable OFF mode functionality on 3630.
@@ -316,12 +276,12 @@ omap3_do_wfi:
316 * restore_3630: applies to 36xx 276 * restore_3630: applies to 36xx
317 * restore: common code for 3xxx 277 * restore: common code for 3xxx
318 */ 278 */
319restore_es3: 279ENTRY(omap3_restore_es3)
320 ldr r5, pm_prepwstst_core_p 280 ldr r5, pm_prepwstst_core_p
321 ldr r4, [r5] 281 ldr r4, [r5]
322 and r4, r4, #0x3 282 and r4, r4, #0x3
323 cmp r4, #0x0 @ Check if previous power state of CORE is OFF 283 cmp r4, #0x0 @ Check if previous power state of CORE is OFF
324 bne restore 284 bne omap3_restore
325 adr r0, es3_sdrc_fix 285 adr r0, es3_sdrc_fix
326 ldr r1, sram_base 286 ldr r1, sram_base
327 ldr r2, es3_sdrc_fix_sz 287 ldr r2, es3_sdrc_fix_sz
@@ -333,22 +293,24 @@ copy_to_sram:
333 bne copy_to_sram 293 bne copy_to_sram
334 ldr r1, sram_base 294 ldr r1, sram_base
335 blx r1 295 blx r1
336 b restore 296 b omap3_restore
297ENDPROC(omap3_restore_es3)
337 298
338restore_3630: 299ENTRY(omap3_restore_3630)
339 ldr r1, pm_prepwstst_core_p 300 ldr r1, pm_prepwstst_core_p
340 ldr r2, [r1] 301 ldr r2, [r1]
341 and r2, r2, #0x3 302 and r2, r2, #0x3
342 cmp r2, #0x0 @ Check if previous power state of CORE is OFF 303 cmp r2, #0x0 @ Check if previous power state of CORE is OFF
343 bne restore 304 bne omap3_restore
344 /* Disable RTA before giving control */ 305 /* Disable RTA before giving control */
345 ldr r1, control_mem_rta 306 ldr r1, control_mem_rta
346 mov r2, #OMAP36XX_RTA_DISABLE 307 mov r2, #OMAP36XX_RTA_DISABLE
347 str r2, [r1] 308 str r2, [r1]
309ENDPROC(omap3_restore_3630)
348 310
349 /* Fall through to common code for the remaining logic */ 311 /* Fall through to common code for the remaining logic */
350 312
351restore: 313ENTRY(omap3_restore)
352 /* 314 /*
353 * Read the pwstctrl register to check the reason for mpu reset. 315 * Read the pwstctrl register to check the reason for mpu reset.
354 * This tells us what was lost. 316 * This tells us what was lost.
@@ -438,6 +400,7 @@ skipl2reen:
438 400
439 /* Now branch to the common CPU resume function */ 401 /* Now branch to the common CPU resume function */
440 b cpu_resume 402 b cpu_resume
403ENDPROC(omap3_restore)
441 404
442 .ltorg 405 .ltorg
443 406