aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-08-27 17:39:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-20 18:33:38 -0400
commitde8e71ca4f2e17329f6718ae88d5c8336cb249ee (patch)
treecec0f26c5f4c9efd601edc1ac716aed168f65e1f /arch/arm
parente8ce0eb5e2254b85415e4b58e73f24a5d13846a1 (diff)
ARM: pm: only use preallocated page table during resume
Only use the preallocated page table during the resume, not while suspending. This avoids the overhead of having to switch unnecessarily to the resume page table in the suspend path. Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/kernel/sleep.S19
-rw-r--r--arch/arm/kernel/suspend.c17
-rw-r--r--arch/arm/mm/proc-arm920.S17
-rw-r--r--arch/arm/mm/proc-arm926.S17
-rw-r--r--arch/arm/mm/proc-sa1100.S21
-rw-r--r--arch/arm/mm/proc-v6.S31
-rw-r--r--arch/arm/mm/proc-v7.S33
-rw-r--r--arch/arm/mm/proc-xsc3.S22
-rw-r--r--arch/arm/mm/proc-xscale.S21
9 files changed, 99 insertions, 99 deletions
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 8cf13de1e368..25d42dfb0a92 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -9,12 +9,14 @@
9 9
10/* 10/*
11 * Save CPU state for a suspend 11 * Save CPU state for a suspend
12 * r0 = phys addr of temporary page tables
12 * r1 = v:p offset 13 * r1 = v:p offset
13 * r2 = suspend function arg0 14 * r2 = suspend function arg0
14 * r3 = suspend function 15 * r3 = suspend function
15 */ 16 */
16ENTRY(__cpu_suspend) 17ENTRY(__cpu_suspend)
17 stmfd sp!, {r4 - r11, lr} 18 stmfd sp!, {r4 - r11, lr}
19 mov r4, r0
18#ifdef MULTI_CPU 20#ifdef MULTI_CPU
19 ldr r10, =processor 21 ldr r10, =processor
20 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state 22 ldr r5, [r10, #CPU_SLEEP_SIZE] @ size of CPU sleep state
@@ -27,7 +29,7 @@ ENTRY(__cpu_suspend)
27 sub sp, sp, r5 @ allocate CPU state on stack 29 sub sp, sp, r5 @ allocate CPU state on stack
28 mov r0, sp @ save pointer to CPU save block 30 mov r0, sp @ save pointer to CPU save block
29 add ip, ip, r1 @ convert resume fn to phys 31 add ip, ip, r1 @ convert resume fn to phys
30 stmfd sp!, {r6, ip} @ save virt SP, phys resume fn 32 stmfd sp!, {r4, r6, ip} @ save phys pgd, virt SP, phys resume fn
31 ldr r5, =sleep_save_sp 33 ldr r5, =sleep_save_sp
32 add r6, sp, r1 @ convert SP to phys 34 add r6, sp, r1 @ convert SP to phys
33 stmfd sp!, {r2, r3} @ save suspend func arg and pointer 35 stmfd sp!, {r2, r3} @ save suspend func arg and pointer
@@ -60,7 +62,7 @@ ENDPROC(__cpu_suspend)
60 .ltorg 62 .ltorg
61 63
62cpu_suspend_abort: 64cpu_suspend_abort:
63 ldmia sp!, {r2 - r3} @ pop virt SP, phys resume fn 65 ldmia sp!, {r1 - r3} @ pop phys pgd, virt SP, phys resume fn
64 teq r0, #0 66 teq r0, #0
65 moveq r0, #1 @ force non-zero value 67 moveq r0, #1 @ force non-zero value
66 mov sp, r2 68 mov sp, r2
@@ -69,9 +71,6 @@ ENDPROC(cpu_suspend_abort)
69 71
70/* 72/*
71 * r0 = control register value 73 * r0 = control register value
72 * r1 = v:p offset (preserved by cpu_do_resume)
73 * r2 = phys page table base
74 * r3 = L1 section flags
75 */ 74 */
76ENTRY(cpu_resume_mmu) 75ENTRY(cpu_resume_mmu)
77 ldr r3, =cpu_resume_after_mmu 76 ldr r3, =cpu_resume_after_mmu
@@ -112,11 +111,11 @@ ENTRY(cpu_resume)
112 ldr r0, sleep_save_sp @ stack phys addr 111 ldr r0, sleep_save_sp @ stack phys addr
113#endif 112#endif
114 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set SVC, irqs off 113 setmode PSR_I_BIT | PSR_F_BIT | SVC_MODE, r1 @ set SVC, irqs off
115 @ load stack, resume fn 114 @ load phys pgd, stack, resume fn
116 ARM( ldmia r0!, {sp, pc} ) 115 ARM( ldmia r0!, {r1, sp, pc} )
117THUMB( ldmia r0!, {r2, r3} ) 116THUMB( ldmia r0!, {r1, r2, r3} )
118THUMB( mov sp, r2 ) 117THUMB( mov sp, r2 )
119THUMB( bx r3 ) 118THUMB( bx r3 )
120ENDPROC(cpu_resume) 119ENDPROC(cpu_resume)
121 120
122sleep_save_sp: 121sleep_save_sp:
diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 0a33f109549d..2beda56e4574 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -24,14 +24,17 @@ int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
24 return -EINVAL; 24 return -EINVAL;
25 25
26 /* 26 /*
27 * Temporarily switch the page tables to our suspend page 27 * Provide a temporary page table with an identity mapping for
28 * tables, which contain the temporary identity mapping 28 * the MMU-enable code, required for resuming. On successful
29 * required for resuming. 29 * resume (indicated by a zero return code), we need to switch
30 * back to the correct page tables.
30 */ 31 */
31 cpu_switch_mm(suspend_pgd, mm); 32 ret = __cpu_suspend(virt_to_phys(suspend_pgd),
32 ret = __cpu_suspend(0, PHYS_OFFSET - PAGE_OFFSET, arg, fn); 33 PHYS_OFFSET - PAGE_OFFSET, arg, fn);
33 cpu_switch_mm(mm->pgd, mm); 34 if (ret == 0) {
34 local_flush_tlb_all(); 35 cpu_switch_mm(mm->pgd, mm);
36 local_flush_tlb_all();
37 }
35 38
36 return ret; 39 return ret;
37} 40}
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 035d57bf1b7a..88fb3d9e0640 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -379,27 +379,26 @@ ENTRY(cpu_arm920_set_pte_ext)
379 379
380/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ 380/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
381.globl cpu_arm920_suspend_size 381.globl cpu_arm920_suspend_size
382.equ cpu_arm920_suspend_size, 4 * 4 382.equ cpu_arm920_suspend_size, 4 * 3
383#ifdef CONFIG_PM_SLEEP 383#ifdef CONFIG_PM_SLEEP
384ENTRY(cpu_arm920_do_suspend) 384ENTRY(cpu_arm920_do_suspend)
385 stmfd sp!, {r4 - r7, lr} 385 stmfd sp!, {r4 - r6, lr}
386 mrc p15, 0, r4, c13, c0, 0 @ PID 386 mrc p15, 0, r4, c13, c0, 0 @ PID
387 mrc p15, 0, r5, c3, c0, 0 @ Domain ID 387 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
388 mrc p15, 0, r6, c2, c0, 0 @ TTB address 388 mrc p15, 0, r6, c1, c0, 0 @ Control register
389 mrc p15, 0, r7, c1, c0, 0 @ Control register 389 stmia r0, {r4 - r6}
390 stmia r0, {r4 - r7} 390 ldmfd sp!, {r4 - r6, pc}
391 ldmfd sp!, {r4 - r7, pc}
392ENDPROC(cpu_arm920_do_suspend) 391ENDPROC(cpu_arm920_do_suspend)
393 392
394ENTRY(cpu_arm920_do_resume) 393ENTRY(cpu_arm920_do_resume)
395 mov ip, #0 394 mov ip, #0
396 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs 395 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
397 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches 396 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
398 ldmia r0, {r4 - r7} 397 ldmia r0, {r4 - r6}
399 mcr p15, 0, r4, c13, c0, 0 @ PID 398 mcr p15, 0, r4, c13, c0, 0 @ PID
400 mcr p15, 0, r5, c3, c0, 0 @ Domain ID 399 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
401 mcr p15, 0, r6, c2, c0, 0 @ TTB address 400 mcr p15, 0, r1, c2, c0, 0 @ TTB address
402 mov r0, r7 @ control register 401 mov r0, r6 @ control register
403 b cpu_resume_mmu 402 b cpu_resume_mmu
404ENDPROC(cpu_arm920_do_resume) 403ENDPROC(cpu_arm920_do_resume)
405#endif 404#endif
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 48add848b997..9f8fd91f918a 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -394,27 +394,26 @@ ENTRY(cpu_arm926_set_pte_ext)
394 394
395/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */ 395/* Suspend/resume support: taken from arch/arm/plat-s3c24xx/sleep.S */
396.globl cpu_arm926_suspend_size 396.globl cpu_arm926_suspend_size
397.equ cpu_arm926_suspend_size, 4 * 4 397.equ cpu_arm926_suspend_size, 4 * 3
398#ifdef CONFIG_PM_SLEEP 398#ifdef CONFIG_PM_SLEEP
399ENTRY(cpu_arm926_do_suspend) 399ENTRY(cpu_arm926_do_suspend)
400 stmfd sp!, {r4 - r7, lr} 400 stmfd sp!, {r4 - r6, lr}
401 mrc p15, 0, r4, c13, c0, 0 @ PID 401 mrc p15, 0, r4, c13, c0, 0 @ PID
402 mrc p15, 0, r5, c3, c0, 0 @ Domain ID 402 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
403 mrc p15, 0, r6, c2, c0, 0 @ TTB address 403 mrc p15, 0, r6, c1, c0, 0 @ Control register
404 mrc p15, 0, r7, c1, c0, 0 @ Control register 404 stmia r0, {r4 - r6}
405 stmia r0, {r4 - r7} 405 ldmfd sp!, {r4 - r6, pc}
406 ldmfd sp!, {r4 - r7, pc}
407ENDPROC(cpu_arm926_do_suspend) 406ENDPROC(cpu_arm926_do_suspend)
408 407
409ENTRY(cpu_arm926_do_resume) 408ENTRY(cpu_arm926_do_resume)
410 mov ip, #0 409 mov ip, #0
411 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs 410 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
412 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches 411 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
413 ldmia r0, {r4 - r7} 412 ldmia r0, {r4 - r6}
414 mcr p15, 0, r4, c13, c0, 0 @ PID 413 mcr p15, 0, r4, c13, c0, 0 @ PID
415 mcr p15, 0, r5, c3, c0, 0 @ Domain ID 414 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
416 mcr p15, 0, r6, c2, c0, 0 @ TTB address 415 mcr p15, 0, r1, c2, c0, 0 @ TTB address
417 mov r0, r7 @ control register 416 mov r0, r6 @ control register
418 b cpu_resume_mmu 417 b cpu_resume_mmu
419ENDPROC(cpu_arm926_do_resume) 418ENDPROC(cpu_arm926_do_resume)
420#endif 419#endif
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 52f73fb47ac1..7d91545d089b 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -168,20 +168,19 @@ ENTRY(cpu_sa1100_set_pte_ext)
168 mov pc, lr 168 mov pc, lr
169 169
170.globl cpu_sa1100_suspend_size 170.globl cpu_sa1100_suspend_size
171.equ cpu_sa1100_suspend_size, 4*4 171.equ cpu_sa1100_suspend_size, 4 * 3
172#ifdef CONFIG_PM_SLEEP 172#ifdef CONFIG_PM_SLEEP
173ENTRY(cpu_sa1100_do_suspend) 173ENTRY(cpu_sa1100_do_suspend)
174 stmfd sp!, {r4 - r7, lr} 174 stmfd sp!, {r4 - r6, lr}
175 mrc p15, 0, r4, c3, c0, 0 @ domain ID 175 mrc p15, 0, r4, c3, c0, 0 @ domain ID
176 mrc p15, 0, r5, c2, c0, 0 @ translation table base addr 176 mrc p15, 0, r5, c13, c0, 0 @ PID
177 mrc p15, 0, r6, c13, c0, 0 @ PID 177 mrc p15, 0, r6, c1, c0, 0 @ control reg
178 mrc p15, 0, r7, c1, c0, 0 @ control reg 178 stmia r0, {r4 - r6} @ store cp regs
179 stmia r0, {r4 - r7} @ store cp regs 179 ldmfd sp!, {r4 - r6, pc}
180 ldmfd sp!, {r4 - r7, pc}
181ENDPROC(cpu_sa1100_do_suspend) 180ENDPROC(cpu_sa1100_do_suspend)
182 181
183ENTRY(cpu_sa1100_do_resume) 182ENTRY(cpu_sa1100_do_resume)
184 ldmia r0, {r4 - r7} @ load cp regs 183 ldmia r0, {r4 - r6} @ load cp regs
185 mov ip, #0 184 mov ip, #0
186 mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs 185 mcr p15, 0, ip, c8, c7, 0 @ flush I+D TLBs
187 mcr p15, 0, ip, c7, c7, 0 @ flush I&D cache 186 mcr p15, 0, ip, c7, c7, 0 @ flush I&D cache
@@ -189,9 +188,9 @@ ENTRY(cpu_sa1100_do_resume)
189 mcr p15, 0, ip, c9, c0, 5 @ allow user space to use RB 188 mcr p15, 0, ip, c9, c0, 5 @ allow user space to use RB
190 189
191 mcr p15, 0, r4, c3, c0, 0 @ domain ID 190 mcr p15, 0, r4, c3, c0, 0 @ domain ID
192 mcr p15, 0, r5, c2, c0, 0 @ translation table base addr 191 mcr p15, 0, r1, c2, c0, 0 @ translation table base addr
193 mcr p15, 0, r6, c13, c0, 0 @ PID 192 mcr p15, 0, r5, c13, c0, 0 @ PID
194 mov r0, r7 @ control register 193 mov r0, r6 @ control register
195 b cpu_resume_mmu 194 b cpu_resume_mmu
196ENDPROC(cpu_sa1100_do_resume) 195ENDPROC(cpu_sa1100_do_resume)
197#endif 196#endif
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 414e3696bdf7..2e27b467c6a6 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -128,20 +128,19 @@ ENTRY(cpu_v6_set_pte_ext)
128 128
129/* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */ 129/* Suspend/resume support: taken from arch/arm/mach-s3c64xx/sleep.S */
130.globl cpu_v6_suspend_size 130.globl cpu_v6_suspend_size
131.equ cpu_v6_suspend_size, 4 * 8 131.equ cpu_v6_suspend_size, 4 * 7
132#ifdef CONFIG_PM_SLEEP 132#ifdef CONFIG_PM_SLEEP
133ENTRY(cpu_v6_do_suspend) 133ENTRY(cpu_v6_do_suspend)
134 stmfd sp!, {r4 - r11, lr} 134 stmfd sp!, {r4 - r10, lr}
135 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID 135 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
136 mrc p15, 0, r5, c13, c0, 1 @ Context ID 136 mrc p15, 0, r5, c13, c0, 1 @ Context ID
137 mrc p15, 0, r6, c3, c0, 0 @ Domain ID 137 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
138 mrc p15, 0, r7, c2, c0, 0 @ Translation table base 0 138 mrc p15, 0, r7, c2, c0, 1 @ Translation table base 1
139 mrc p15, 0, r8, c2, c0, 1 @ Translation table base 1 139 mrc p15, 0, r8, c1, c0, 1 @ auxiliary control register
140 mrc p15, 0, r9, c1, c0, 1 @ auxiliary control register 140 mrc p15, 0, r9, c1, c0, 2 @ co-processor access control
141 mrc p15, 0, r10, c1, c0, 2 @ co-processor access control 141 mrc p15, 0, r10, c1, c0, 0 @ control register
142 mrc p15, 0, r11, c1, c0, 0 @ control register 142 stmia r0, {r4 - r10}
143 stmia r0, {r4 - r11} 143 ldmfd sp!, {r4- r10, pc}
144 ldmfd sp!, {r4- r11, pc}
145ENDPROC(cpu_v6_do_suspend) 144ENDPROC(cpu_v6_do_suspend)
146 145
147ENTRY(cpu_v6_do_resume) 146ENTRY(cpu_v6_do_resume)
@@ -150,17 +149,19 @@ ENTRY(cpu_v6_do_resume)
150 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache 149 mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache
151 mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache 150 mcr p15, 0, ip, c7, c15, 0 @ clean+invalidate cache
152 mcr p15, 0, ip, c7, c10, 4 @ drain write buffer 151 mcr p15, 0, ip, c7, c10, 4 @ drain write buffer
153 ldmia r0, {r4 - r11} 152 ldmia r0, {r4 - r10}
154 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID 153 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
155 mcr p15, 0, r5, c13, c0, 1 @ Context ID 154 mcr p15, 0, r5, c13, c0, 1 @ Context ID
156 mcr p15, 0, r6, c3, c0, 0 @ Domain ID 155 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
157 mcr p15, 0, r7, c2, c0, 0 @ Translation table base 0 156 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP)
158 mcr p15, 0, r8, c2, c0, 1 @ Translation table base 1 157 ALT_UP(orr r1, r1, #TTB_FLAGS_UP)
159 mcr p15, 0, r9, c1, c0, 1 @ auxiliary control register 158 mcr p15, 0, r1, c2, c0, 0 @ Translation table base 0
160 mcr p15, 0, r10, c1, c0, 2 @ co-processor access control 159 mcr p15, 0, r7, c2, c0, 1 @ Translation table base 1
160 mcr p15, 0, r8, c1, c0, 1 @ auxiliary control register
161 mcr p15, 0, r9, c1, c0, 2 @ co-processor access control
161 mcr p15, 0, ip, c2, c0, 2 @ TTB control register 162 mcr p15, 0, ip, c2, c0, 2 @ TTB control register
162 mcr p15, 0, ip, c7, c5, 4 @ ISB 163 mcr p15, 0, ip, c7, c5, 4 @ ISB
163 mov r0, r11 @ control register 164 mov r0, r10 @ control register
164 b cpu_resume_mmu 165 b cpu_resume_mmu
165ENDPROC(cpu_v6_do_resume) 166ENDPROC(cpu_v6_do_resume)
166#endif 167#endif
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 21d6910d2208..b56004f90d93 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -217,22 +217,21 @@ ENDPROC(cpu_v7_set_pte_ext)
217 217
218/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ 218/* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */
219.globl cpu_v7_suspend_size 219.globl cpu_v7_suspend_size
220.equ cpu_v7_suspend_size, 4 * 9 220.equ cpu_v7_suspend_size, 4 * 8
221#ifdef CONFIG_PM_SLEEP 221#ifdef CONFIG_PM_SLEEP
222ENTRY(cpu_v7_do_suspend) 222ENTRY(cpu_v7_do_suspend)
223 stmfd sp!, {r4 - r11, lr} 223 stmfd sp!, {r4 - r10, lr}
224 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID 224 mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID
225 mrc p15, 0, r5, c13, c0, 1 @ Context ID 225 mrc p15, 0, r5, c13, c0, 1 @ Context ID
226 mrc p15, 0, r6, c13, c0, 3 @ User r/o thread ID 226 mrc p15, 0, r6, c13, c0, 3 @ User r/o thread ID
227 stmia r0!, {r4 - r6} 227 stmia r0!, {r4 - r6}
228 mrc p15, 0, r6, c3, c0, 0 @ Domain ID 228 mrc p15, 0, r6, c3, c0, 0 @ Domain ID
229 mrc p15, 0, r7, c2, c0, 0 @ TTB 0 229 mrc p15, 0, r7, c2, c0, 1 @ TTB 1
230 mrc p15, 0, r8, c2, c0, 1 @ TTB 1 230 mrc p15, 0, r8, c1, c0, 0 @ Control register
231 mrc p15, 0, r9, c1, c0, 0 @ Control register 231 mrc p15, 0, r9, c1, c0, 1 @ Auxiliary control register
232 mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register 232 mrc p15, 0, r10, c1, c0, 2 @ Co-processor access control
233 mrc p15, 0, r11, c1, c0, 2 @ Co-processor access control 233 stmia r0, {r6 - r10}
234 stmia r0, {r6 - r11} 234 ldmfd sp!, {r4 - r10, pc}
235 ldmfd sp!, {r4 - r11, pc}
236ENDPROC(cpu_v7_do_suspend) 235ENDPROC(cpu_v7_do_suspend)
237 236
238ENTRY(cpu_v7_do_resume) 237ENTRY(cpu_v7_do_resume)
@@ -243,22 +242,24 @@ ENTRY(cpu_v7_do_resume)
243 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID 242 mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID
244 mcr p15, 0, r5, c13, c0, 1 @ Context ID 243 mcr p15, 0, r5, c13, c0, 1 @ Context ID
245 mcr p15, 0, r6, c13, c0, 3 @ User r/o thread ID 244 mcr p15, 0, r6, c13, c0, 3 @ User r/o thread ID
246 ldmia r0, {r6 - r11} 245 ldmia r0, {r6 - r10}
247 mcr p15, 0, r6, c3, c0, 0 @ Domain ID 246 mcr p15, 0, r6, c3, c0, 0 @ Domain ID
248 mcr p15, 0, r7, c2, c0, 0 @ TTB 0 247 ALT_SMP(orr r1, r1, #TTB_FLAGS_SMP)
249 mcr p15, 0, r8, c2, c0, 1 @ TTB 1 248 ALT_UP(orr r1, r1, #TTB_FLAGS_UP)
249 mcr p15, 0, r1, c2, c0, 0 @ TTB 0
250 mcr p15, 0, r7, c2, c0, 1 @ TTB 1
250 mcr p15, 0, ip, c2, c0, 2 @ TTB control register 251 mcr p15, 0, ip, c2, c0, 2 @ TTB control register
251 mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register 252 mrc p15, 0, r4, c1, c0, 1 @ Read Auxiliary control register
252 teq r4, r10 @ Is it already set? 253 teq r4, r9 @ Is it already set?
253 mcrne p15, 0, r10, c1, c0, 1 @ No, so write it 254 mcrne p15, 0, r9, c1, c0, 1 @ No, so write it
254 mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control 255 mcr p15, 0, r10, c1, c0, 2 @ Co-processor access control
255 ldr r4, =PRRR @ PRRR 256 ldr r4, =PRRR @ PRRR
256 ldr r5, =NMRR @ NMRR 257 ldr r5, =NMRR @ NMRR
257 mcr p15, 0, r4, c10, c2, 0 @ write PRRR 258 mcr p15, 0, r4, c10, c2, 0 @ write PRRR
258 mcr p15, 0, r5, c10, c2, 1 @ write NMRR 259 mcr p15, 0, r5, c10, c2, 1 @ write NMRR
259 isb 260 isb
260 dsb 261 dsb
261 mov r0, r9 @ control register 262 mov r0, r8 @ control register
262 b cpu_resume_mmu 263 b cpu_resume_mmu
263ENDPROC(cpu_v7_do_resume) 264ENDPROC(cpu_v7_do_resume)
264#endif 265#endif
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S
index efd49492fa4d..abf0507a08ae 100644
--- a/arch/arm/mm/proc-xsc3.S
+++ b/arch/arm/mm/proc-xsc3.S
@@ -406,24 +406,23 @@ ENTRY(cpu_xsc3_set_pte_ext)
406 .align 406 .align
407 407
408.globl cpu_xsc3_suspend_size 408.globl cpu_xsc3_suspend_size
409.equ cpu_xsc3_suspend_size, 4 * 7 409.equ cpu_xsc3_suspend_size, 4 * 6
410#ifdef CONFIG_PM_SLEEP 410#ifdef CONFIG_PM_SLEEP
411ENTRY(cpu_xsc3_do_suspend) 411ENTRY(cpu_xsc3_do_suspend)
412 stmfd sp!, {r4 - r10, lr} 412 stmfd sp!, {r4 - r9, lr}
413 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode 413 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
414 mrc p15, 0, r5, c15, c1, 0 @ CP access reg 414 mrc p15, 0, r5, c15, c1, 0 @ CP access reg
415 mrc p15, 0, r6, c13, c0, 0 @ PID 415 mrc p15, 0, r6, c13, c0, 0 @ PID
416 mrc p15, 0, r7, c3, c0, 0 @ domain ID 416 mrc p15, 0, r7, c3, c0, 0 @ domain ID
417 mrc p15, 0, r8, c2, c0, 0 @ translation table base addr 417 mrc p15, 0, r8, c1, c0, 1 @ auxiliary control reg
418 mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg 418 mrc p15, 0, r9, c1, c0, 0 @ control reg
419 mrc p15, 0, r10, c1, c0, 0 @ control reg
420 bic r4, r4, #2 @ clear frequency change bit 419 bic r4, r4, #2 @ clear frequency change bit
421 stmia r0, {r4 - r10} @ store cp regs 420 stmia r0, {r4 - r9} @ store cp regs
422 ldmia sp!, {r4 - r10, pc} 421 ldmia sp!, {r4 - r9, pc}
423ENDPROC(cpu_xsc3_do_suspend) 422ENDPROC(cpu_xsc3_do_suspend)
424 423
425ENTRY(cpu_xsc3_do_resume) 424ENTRY(cpu_xsc3_do_resume)
426 ldmia r0, {r4 - r10} @ load cp regs 425 ldmia r0, {r4 - r9} @ load cp regs
427 mov ip, #0 426 mov ip, #0
428 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB 427 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
429 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer 428 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer
@@ -433,9 +432,10 @@ ENTRY(cpu_xsc3_do_resume)
433 mcr p15, 0, r5, c15, c1, 0 @ CP access reg 432 mcr p15, 0, r5, c15, c1, 0 @ CP access reg
434 mcr p15, 0, r6, c13, c0, 0 @ PID 433 mcr p15, 0, r6, c13, c0, 0 @ PID
435 mcr p15, 0, r7, c3, c0, 0 @ domain ID 434 mcr p15, 0, r7, c3, c0, 0 @ domain ID
436 mcr p15, 0, r8, c2, c0, 0 @ translation table base addr 435 orr r1, r1, #0x18 @ cache the page table in L2
437 mcr p15, 0, r9, c1, c0, 1 @ auxiliary control reg 436 mcr p15, 0, r1, c2, c0, 0 @ translation table base addr
438 mov r0, r10 @ control register 437 mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
438 mov r0, r9 @ control register
439 b cpu_resume_mmu 439 b cpu_resume_mmu
440ENDPROC(cpu_xsc3_do_resume) 440ENDPROC(cpu_xsc3_do_resume)
441#endif 441#endif
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 37dbadadf7c4..3277904bebaf 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -520,24 +520,23 @@ ENTRY(cpu_xscale_set_pte_ext)
520 .align 520 .align
521 521
522.globl cpu_xscale_suspend_size 522.globl cpu_xscale_suspend_size
523.equ cpu_xscale_suspend_size, 4 * 7 523.equ cpu_xscale_suspend_size, 4 * 6
524#ifdef CONFIG_PM_SLEEP 524#ifdef CONFIG_PM_SLEEP
525ENTRY(cpu_xscale_do_suspend) 525ENTRY(cpu_xscale_do_suspend)
526 stmfd sp!, {r4 - r10, lr} 526 stmfd sp!, {r4 - r9, lr}
527 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode 527 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
528 mrc p15, 0, r5, c15, c1, 0 @ CP access reg 528 mrc p15, 0, r5, c15, c1, 0 @ CP access reg
529 mrc p15, 0, r6, c13, c0, 0 @ PID 529 mrc p15, 0, r6, c13, c0, 0 @ PID
530 mrc p15, 0, r7, c3, c0, 0 @ domain ID 530 mrc p15, 0, r7, c3, c0, 0 @ domain ID
531 mrc p15, 0, r8, c2, c0, 0 @ translation table base addr 531 mrc p15, 0, r8, c1, c1, 0 @ auxiliary control reg
532 mrc p15, 0, r9, c1, c1, 0 @ auxiliary control reg 532 mrc p15, 0, r9, c1, c0, 0 @ control reg
533 mrc p15, 0, r10, c1, c0, 0 @ control reg
534 bic r4, r4, #2 @ clear frequency change bit 533 bic r4, r4, #2 @ clear frequency change bit
535 stmia r0, {r4 - r10} @ store cp regs 534 stmia r0, {r4 - r9} @ store cp regs
536 ldmfd sp!, {r4 - r10, pc} 535 ldmfd sp!, {r4 - r9, pc}
537ENDPROC(cpu_xscale_do_suspend) 536ENDPROC(cpu_xscale_do_suspend)
538 537
539ENTRY(cpu_xscale_do_resume) 538ENTRY(cpu_xscale_do_resume)
540 ldmia r0, {r4 - r10} @ load cp regs 539 ldmia r0, {r4 - r9} @ load cp regs
541 mov ip, #0 540 mov ip, #0
542 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs 541 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
543 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB 542 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
@@ -545,9 +544,9 @@ ENTRY(cpu_xscale_do_resume)
545 mcr p15, 0, r5, c15, c1, 0 @ CP access reg 544 mcr p15, 0, r5, c15, c1, 0 @ CP access reg
546 mcr p15, 0, r6, c13, c0, 0 @ PID 545 mcr p15, 0, r6, c13, c0, 0 @ PID
547 mcr p15, 0, r7, c3, c0, 0 @ domain ID 546 mcr p15, 0, r7, c3, c0, 0 @ domain ID
548 mcr p15, 0, r8, c2, c0, 0 @ translation table base addr 547 mcr p15, 0, r1, c2, c0, 0 @ translation table base addr
549 mcr p15, 0, r9, c1, c1, 0 @ auxiliary control reg 548 mcr p15, 0, r8, c1, c1, 0 @ auxiliary control reg
550 mov r0, r10 @ control register 549 mov r0, r9 @ control register
551 b cpu_resume_mmu 550 b cpu_resume_mmu
552ENDPROC(cpu_xscale_do_resume) 551ENDPROC(cpu_xscale_do_resume)
553#endif 552#endif