diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-03-10 07:48:07 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-03-10 07:48:07 -0400 |
commit | fff94cd9f5527bbba13aa5ea5719d16531ca8e65 (patch) | |
tree | bddf3ef686410872d8da882688229688710d574b /arch/arm/plat-s3c24xx/sleep.S | |
parent | aa8aba6944203a17a7e941b42d8415153c649660 (diff) |
[ARM] S3C: Tidy sleep code path to fix call flow
As noted by Russell King, the sleep code path is not
elegant and makes use of leaving items on the stack
between calls.
Change the code that does the following:
if (s3c_cpu_save(regs_save) == 0) {
flush_cache_all();
S3C_PMDBG("preparing to sleep\n");
pm_cpu_sleep();
}
to simply call s3c_cpu_save, and let that do the
necessary calls to quiesce and sleep the system.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c24xx/sleep.S')
-rw-r--r-- | arch/arm/plat-s3c24xx/sleep.S | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/arch/arm/plat-s3c24xx/sleep.S b/arch/arm/plat-s3c24xx/sleep.S index ecb830be67d6..e73e3b6e88d2 100644 --- a/arch/arm/plat-s3c24xx/sleep.S +++ b/arch/arm/plat-s3c24xx/sleep.S | |||
@@ -43,20 +43,8 @@ | |||
43 | 43 | ||
44 | /* s3c_cpu_save | 44 | /* s3c_cpu_save |
45 | * | 45 | * |
46 | * save enough of the CPU state to allow us to re-start | ||
47 | * pm.c code. as we store items like the sp/lr, we will | ||
48 | * end up returning from this function when the cpu resumes | ||
49 | * so the return value is set to mark this. | ||
50 | * | ||
51 | * This arangement means we avoid having to flush the cache | ||
52 | * from this code. | ||
53 | * | ||
54 | * entry: | 46 | * entry: |
55 | * r0 = pointer to save block | 47 | * r0 = save address (virtual addr of s3c_sleep_save_phys) |
56 | * | ||
57 | * exit: | ||
58 | * r0 = 0 => we stored everything | ||
59 | * 1 => resumed from sleep | ||
60 | */ | 48 | */ |
61 | 49 | ||
62 | ENTRY(s3c_cpu_save) | 50 | ENTRY(s3c_cpu_save) |
@@ -71,14 +59,19 @@ ENTRY(s3c_cpu_save) | |||
71 | 59 | ||
72 | stmia r0, { r4 - r13 } | 60 | stmia r0, { r4 - r13 } |
73 | 61 | ||
74 | mov r0, #0 | 62 | @@ write our state back to RAM |
75 | ldmfd sp, { r4 - r12, pc } | 63 | bl s3c_pm_cb_flushcache |
76 | 64 | ||
65 | @@ jump to final code to send system to sleep | ||
66 | ldr r0, =pm_cpu_sleep | ||
67 | @@ldr pc, [ r0 ] | ||
68 | ldr r0, [ r0 ] | ||
69 | mov pc, r0 | ||
70 | |||
77 | @@ return to the caller, after having the MMU | 71 | @@ return to the caller, after having the MMU |
78 | @@ turned on, this restores the last bits from the | 72 | @@ turned on, this restores the last bits from the |
79 | @@ stack | 73 | @@ stack |
80 | resume_with_mmu: | 74 | resume_with_mmu: |
81 | mov r0, #1 | ||
82 | ldmfd sp!, { r4 - r12, pc } | 75 | ldmfd sp!, { r4 - r12, pc } |
83 | 76 | ||
84 | .ltorg | 77 | .ltorg |