diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-06 10:48:39 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-22 12:11:23 -0500 |
commit | f6b0fa02e8b0708d17d631afce456524eadf87ff (patch) | |
tree | 900fcd2149a03ba229bb29e982d3d6a5f3d3fcfc /arch/arm/mm/proc-v6.S | |
parent | 753790e713d80b50b867fa1ed32ec0eb5e82ae8e (diff) |
ARM: pm: add generic CPU suspend/resume support
This adds core support for saving and restoring CPU coprocessor
registers for suspend/resume support. This contains support for suspend
with ARM920, ARM926, SA11x0, PXA25x, PXA27x, PXA3xx, V6 and V7 CPUs.
Tested on Assabet and Tegra 2.
Tested-by: Colin Cross <ccross@android.com>
Tested-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/proc-v6.S')
-rw-r--r-- | arch/arm/mm/proc-v6.S | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 59a7e1ffe7bc..832b6bdc192c 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -121,6 +121,53 @@ ENTRY(cpu_v6_set_pte_ext) | |||
121 | #endif | 121 | #endif |
122 | mov pc, lr | 122 | mov pc, lr |
123 | 123 | ||
124 | /* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ | ||
125 | .globl cpu_v6_suspend_size | ||
126 | .equ cpu_v6_suspend_size, 4 * 8 | ||
127 | #ifdef CONFIG_PM | ||
128 | ENTRY(cpu_v6_do_suspend) | ||
129 | stmfd sp!, {r4 - r11, lr} | ||
130 | mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID | ||
131 | mrc p15, 0, r5, c13, c0, 1 @ Context ID | ||
132 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID | ||
133 | mrc p15, 0, r7, c2, c0, 0 @ Translation table base 0 | ||
134 | mrc p15, 0, r8, c2, c0, 1 @ Translation table base 1 | ||
135 | mrc p15, 0, r9, c1, c0, 1 @ auxillary control register | ||
136 | mrc p15, 0, r10, c1, c0, 2 @ co-processor access control | ||
137 | mrc p15, 0, r11, c1, c0, 0 @ control register | ||
138 | stmia r0, {r4 - r11} | ||
139 | ldmfd sp!, {r4- r11, pc} | ||
140 | ENDPROC(cpu_v6_do_suspend) | ||
141 | |||
142 | ENTRY(cpu_v6_do_resume) | ||
143 | mov ip, #0 | ||
144 | mcr p15, 0, ip, c7, c14, 0 @ clean+invalidate D cache | ||
145 | mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache | ||
146 | mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache | ||
147 | mcr p15, 0, ip, c7, c10, 4 @ drain write buffer | ||
148 | ldmia r0, {r4 - r11} | ||
149 | mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID | ||
150 | mcr p15, 0, r5, c13, c0, 1 @ Context ID | ||
151 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID | ||
152 | mcr p15, 0, r7, c2, c0, 0 @ Translation table base 0 | ||
153 | mcr p15, 0, r8, c2, c0, 1 @ Translation table base 1 | ||
154 | mcr p15, 0, r9, c1, c0, 1 @ auxillary control register | ||
155 | mcr p15, 0, r10, c1, c0, 2 @ co-processor access control | ||
156 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register | ||
157 | mcr p15, 0, ip, c7, c5, 4 @ ISB | ||
158 | mov r0, r11 @ control register | ||
159 | mov r2, r7, lsr #14 @ get TTB0 base | ||
160 | mov r2, r2, lsl #14 | ||
161 | ldr r3, cpu_resume_l1_flags | ||
162 | b cpu_resume_mmu | ||
163 | ENDPROC(cpu_v6_do_resume) | ||
164 | cpu_resume_l1_flags: | ||
165 | ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_SMP) | ||
166 | ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_UP) | ||
167 | #else | ||
168 | #define cpu_v6_do_suspend 0 | ||
169 | #define cpu_v6_do_resume 0 | ||
170 | #endif | ||
124 | 171 | ||
125 | 172 | ||
126 | .type cpu_v6_name, #object | 173 | .type cpu_v6_name, #object |
@@ -206,6 +253,9 @@ ENTRY(v6_processor_functions) | |||
206 | .word cpu_v6_dcache_clean_area | 253 | .word cpu_v6_dcache_clean_area |
207 | .word cpu_v6_switch_mm | 254 | .word cpu_v6_switch_mm |
208 | .word cpu_v6_set_pte_ext | 255 | .word cpu_v6_set_pte_ext |
256 | .word cpu_v6_suspend_size | ||
257 | .word cpu_v6_do_suspend | ||
258 | .word cpu_v6_do_resume | ||
209 | .size v6_processor_functions, . - v6_processor_functions | 259 | .size v6_processor_functions, . - v6_processor_functions |
210 | 260 | ||
211 | .section ".rodata" | 261 | .section ".rodata" |