diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-06 12:39:31 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-22 12:11:25 -0500 |
commit | 2e2f3d3792de5913897b6bb49ac13915b0b020d5 (patch) | |
tree | 02126d58ee15cf94c7335604ef8f9e8eb21d7378 /arch/arm/mach-s3c64xx | |
parent | 96c20015dae59e58d055c1e2e17a811e0d1f1d03 (diff) |
ARM: pm: convert samsung platforms to generic suspend/resume support
Tested-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c64xx')
-rw-r--r-- | arch/arm/mach-s3c64xx/sleep.S | 63 |
1 files changed, 4 insertions, 59 deletions
diff --git a/arch/arm/mach-s3c64xx/sleep.S b/arch/arm/mach-s3c64xx/sleep.S index b2ef44317368..afe5a762f46e 100644 --- a/arch/arm/mach-s3c64xx/sleep.S +++ b/arch/arm/mach-s3c64xx/sleep.S | |||
@@ -32,25 +32,13 @@ | |||
32 | * code after resume. | 32 | * code after resume. |
33 | * | 33 | * |
34 | * entry: | 34 | * entry: |
35 | * r0 = pointer to the save block | 35 | * r1 = v:p offset |
36 | */ | 36 | */ |
37 | 37 | ||
38 | ENTRY(s3c_cpu_save) | 38 | ENTRY(s3c_cpu_save) |
39 | stmfd sp!, { r4 - r12, lr } | 39 | stmfd sp!, { r4 - r12, lr } |
40 | 40 | ldr r3, =resume_with_mmu | |
41 | mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID | 41 | bl cpu_suspend |
42 | mrc p15, 0, r5, c3, c0, 0 @ Domain ID | ||
43 | mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE0 | ||
44 | mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE1 | ||
45 | mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control | ||
46 | mrc p15, 0, r9, c1, c0, 0 @ Control register | ||
47 | mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register | ||
48 | mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls | ||
49 | |||
50 | stmia r0, { r4 - r13 } @ Save CP registers and SP | ||
51 | |||
52 | @@ save our state to ram | ||
53 | bl s3c_pm_cb_flushcache | ||
54 | 42 | ||
55 | @@ call final suspend code | 43 | @@ call final suspend code |
56 | ldr r0, =pm_cpu_sleep | 44 | ldr r0, =pm_cpu_sleep |
@@ -61,18 +49,6 @@ ENTRY(s3c_cpu_save) | |||
61 | resume_with_mmu: | 49 | resume_with_mmu: |
62 | ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save | 50 | ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save |
63 | 51 | ||
64 | .data | ||
65 | |||
66 | /* the next bit is code, but it requires easy access to the | ||
67 | * s3c_sleep_save_phys data before the MMU is switched on, so | ||
68 | * we store the code that needs this variable in the .data where | ||
69 | * the value can be written to (the .text segment is RO). | ||
70 | */ | ||
71 | |||
72 | .global s3c_sleep_save_phys | ||
73 | s3c_sleep_save_phys: | ||
74 | .word 0 | ||
75 | |||
76 | /* Sleep magic, the word before the resume entry point so that the | 52 | /* Sleep magic, the word before the resume entry point so that the |
77 | * bootloader can check for a resumeable image. */ | 53 | * bootloader can check for a resumeable image. */ |
78 | 54 | ||
@@ -110,35 +86,4 @@ ENTRY(s3c_cpu_resume) | |||
110 | orr r0, r0, #1 << 15 @ GPN15 | 86 | orr r0, r0, #1 << 15 @ GPN15 |
111 | str r0, [ r3, #S3C64XX_GPNDAT ] | 87 | str r0, [ r3, #S3C64XX_GPNDAT ] |
112 | #endif | 88 | #endif |
113 | 89 | b cpu_resume | |
114 | /* __v6_setup from arch/arm/mm/proc-v6.S, ensure that the caches | ||
115 | * are thoroughly cleaned just in case the bootloader didn't do it | ||
116 | * for us. */ | ||
117 | mov r0, #0 | ||
118 | mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache | ||
119 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | ||
120 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache | ||
121 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | ||
122 | @@mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs | ||
123 | @@mcr p15, 0, r0, c7, c7, 0 @ Invalidate I + D caches | ||
124 | |||
125 | ldr r0, s3c_sleep_save_phys | ||
126 | ldmia r0, { r4 - r13 } | ||
127 | |||
128 | mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID | ||
129 | mcr p15, 0, r5, c3, c0, 0 @ Domain ID | ||
130 | mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0 | ||
131 | mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1 | ||
132 | mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control | ||
133 | mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register | ||
134 | |||
135 | mov r0, #0 @ restore copro access controls | ||
136 | mcr p15, 0, r11, c1, c0, 2 @ Co-processor access controls | ||
137 | mcr p15, 0, r0, c7, c5, 4 | ||
138 | |||
139 | ldr r2, =resume_with_mmu | ||
140 | mcr p15, 0, r9, c1, c0, 0 /* turn mmu back on */ | ||
141 | nop | ||
142 | mov pc, r2 /* jump back */ | ||
143 | |||
144 | .end | ||