diff options
author | Kevin Hilman <khilman@ti.com> | 2011-06-23 20:16:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-06-24 04:54:31 -0400 |
commit | 14c79bbed7e06135bcbccb2b92c19df7115b4502 (patch) | |
tree | cf5d97f5fb988a1f5d5eea9a6cccb7f04d4ac73f /arch/arm/mach-omap2/sleep34xx.S | |
parent | 076f2cc449188b7d3d4866730afa3ac7be3e6640 (diff) |
ARM: pm: omap34xx: remove get_*_restore_pointer functions, directly use entry points
Upon return from off-mode, the ROM code jumps to a restore function
saved in the scratchpad. Based on SoC revision or errata, this
restore entry point is different. Current code uses some helper
functions in sleep34xx.S (get_*_restore_pointer) to get the restore
function entry point.
When returning from off-mode, this code is executed from SDRAM, so
there's no reason to use these helper functions when using the SDRAM
entry points directly would work just fine.
This patch uses ENTRY/ENDPROC to create "real" entry points for these
functions, and uses those values directly when writing the scratchpad.
Tested all three entry points
- restore_es3: 3430/n900
- restore_3630: 3630/Zoom3
- restore: 3530/Overo
Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Jean Pihet <j-pihet@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/sleep34xx.S')
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 55 |
1 files changed, 9 insertions, 46 deletions
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 */ | ||
86 | ENTRY(get_restore_pointer) | ||
87 | stmfd sp!, {lr} @ save registers on stack | ||
88 | adr r0, restore | ||
89 | ldmfd sp!, {pc} @ restore regs and return | ||
90 | ENDPROC(get_restore_pointer) | ||
91 | .align | ||
92 | ENTRY(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 */ | ||
97 | ENTRY(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 | ||
101 | ENDPROC(get_omap3630_restore_pointer) | ||
102 | .align | ||
103 | ENTRY(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 */ | ||
108 | ENTRY(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 | ||
112 | ENDPROC(get_es3_restore_pointer) | ||
113 | .align | ||
114 | ENTRY(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 | */ |
319 | restore_es3: | 279 | ENTRY(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 |
297 | ENDPROC(omap3_restore_es3) | ||
337 | 298 | ||
338 | restore_3630: | 299 | ENTRY(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] |
309 | ENDPROC(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 | ||
351 | restore: | 313 | ENTRY(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 |
403 | ENDPROC(omap3_restore) | ||
441 | 404 | ||
442 | .ltorg | 405 | .ltorg |
443 | 406 | ||