diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2011-01-23 11:07:03 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-03-10 15:23:12 -0500 |
commit | 46f557cb453b9f3b6dc36b8179c2c36932a2ea64 (patch) | |
tree | b7db81ebf5aebfead54bbdede102a5980121108f /arch/arm/mach-omap2/sleep34xx.S | |
parent | c9749a352383d4d2d25eb28062afd1a7eee115b7 (diff) |
OMAP3: PM: Remove un-necessary cp15 registers form low power cpu context
The current code saves few un-necessary registers which are read-only or
write-only, unused CP15 registers.
Remove them and keep only necessary CP15 registers part of
low power context save/restore.
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/sleep34xx.S')
-rw-r--r-- | arch/arm/mach-omap2/sleep34xx.S | 156 |
1 files changed, 40 insertions, 116 deletions
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S index f75a166f0a21..99e43cc5a503 100644 --- a/arch/arm/mach-omap2/sleep34xx.S +++ b/arch/arm/mach-omap2/sleep34xx.S | |||
@@ -214,66 +214,29 @@ save_context_wfi: | |||
214 | beq clean_caches | 214 | beq clean_caches |
215 | 215 | ||
216 | l1_logic_lost: | 216 | l1_logic_lost: |
217 | /* Store sp and spsr to SDRAM */ | 217 | mov r4, sp @ Store sp |
218 | mov r4, sp | 218 | mrs r5, spsr @ Store spsr |
219 | mrs r5, spsr | 219 | mov r6, lr @ Store lr |
220 | mov r6, lr | ||
221 | stmia r8!, {r4-r6} | 220 | stmia r8!, {r4-r6} |
222 | /* Save all ARM registers */ | 221 | |
223 | /* Coprocessor access control register */ | 222 | mrc p15, 0, r4, c1, c0, 2 @ Coprocessor access control register |
224 | mrc p15, 0, r6, c1, c0, 2 | 223 | mrc p15, 0, r5, c2, c0, 0 @ TTBR0 |
225 | stmia r8!, {r6} | 224 | mrc p15, 0, r6, c2, c0, 1 @ TTBR1 |
226 | /* TTBR0, TTBR1 and Translation table base control */ | 225 | mrc p15, 0, r7, c2, c0, 2 @ TTBCR |
227 | mrc p15, 0, r4, c2, c0, 0 | ||
228 | mrc p15, 0, r5, c2, c0, 1 | ||
229 | mrc p15, 0, r6, c2, c0, 2 | ||
230 | stmia r8!, {r4-r6} | ||
231 | /* | ||
232 | * Domain access control register, data fault status register, | ||
233 | * and instruction fault status register | ||
234 | */ | ||
235 | mrc p15, 0, r4, c3, c0, 0 | ||
236 | mrc p15, 0, r5, c5, c0, 0 | ||
237 | mrc p15, 0, r6, c5, c0, 1 | ||
238 | stmia r8!, {r4-r6} | ||
239 | /* | ||
240 | * Data aux fault status register, instruction aux fault status, | ||
241 | * data fault address register and instruction fault address register | ||
242 | */ | ||
243 | mrc p15, 0, r4, c5, c1, 0 | ||
244 | mrc p15, 0, r5, c5, c1, 1 | ||
245 | mrc p15, 0, r6, c6, c0, 0 | ||
246 | mrc p15, 0, r7, c6, c0, 2 | ||
247 | stmia r8!, {r4-r7} | ||
248 | /* | ||
249 | * user r/w thread and process ID, user r/o thread and process ID, | ||
250 | * priv only thread and process ID, cache size selection | ||
251 | */ | ||
252 | mrc p15, 0, r4, c13, c0, 2 | ||
253 | mrc p15, 0, r5, c13, c0, 3 | ||
254 | mrc p15, 0, r6, c13, c0, 4 | ||
255 | mrc p15, 2, r7, c0, c0, 0 | ||
256 | stmia r8!, {r4-r7} | 226 | stmia r8!, {r4-r7} |
257 | /* Data TLB lockdown, instruction TLB lockdown registers */ | ||
258 | mrc p15, 0, r5, c10, c0, 0 | ||
259 | mrc p15, 0, r6, c10, c0, 1 | ||
260 | stmia r8!, {r5-r6} | ||
261 | /* Secure or non secure vector base address, FCSE PID, Context PID*/ | ||
262 | mrc p15, 0, r4, c12, c0, 0 | ||
263 | mrc p15, 0, r5, c13, c0, 0 | ||
264 | mrc p15, 0, r6, c13, c0, 1 | ||
265 | stmia r8!, {r4-r6} | ||
266 | /* Primary remap, normal remap registers */ | ||
267 | mrc p15, 0, r4, c10, c2, 0 | ||
268 | mrc p15, 0, r5, c10, c2, 1 | ||
269 | stmia r8!,{r4-r5} | ||
270 | 227 | ||
271 | /* Store current cpsr*/ | 228 | mrc p15, 0, r4, c3, c0, 0 @ Domain access Control Register |
272 | mrs r2, cpsr | 229 | mrc p15, 0, r5, c10, c2, 0 @ PRRR |
273 | stmia r8!, {r2} | 230 | mrc p15, 0, r6, c10, c2, 1 @ NMRR |
231 | stmia r8!,{r4-r6} | ||
232 | |||
233 | mrc p15, 0, r4, c13, c0, 1 @ Context ID | ||
234 | mrc p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID | ||
235 | mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address | ||
236 | mrs r7, cpsr @ Store current cpsr | ||
237 | stmia r8!, {r4-r7} | ||
274 | 238 | ||
275 | mrc p15, 0, r4, c1, c0, 0 | 239 | mrc p15, 0, r4, c1, c0, 0 @ save control register |
276 | /* save control register */ | ||
277 | stmia r8!, {r4} | 240 | stmia r8!, {r4} |
278 | 241 | ||
279 | clean_caches: | 242 | clean_caches: |
@@ -489,68 +452,29 @@ skipl2reen: | |||
489 | ldr r4, scratchpad_base | 452 | ldr r4, scratchpad_base |
490 | ldr r3, [r4,#0xBC] | 453 | ldr r3, [r4,#0xBC] |
491 | adds r3, r3, #16 | 454 | adds r3, r3, #16 |
455 | |||
492 | ldmia r3!, {r4-r6} | 456 | ldmia r3!, {r4-r6} |
493 | mov sp, r4 | 457 | mov sp, r4 @ Restore sp |
494 | msr spsr_cxsf, r5 | 458 | msr spsr_cxsf, r5 @ Restore spsr |
495 | mov lr, r6 | 459 | mov lr, r6 @ Restore lr |
496 | |||
497 | ldmia r3!, {r4-r9} | ||
498 | /* Coprocessor access Control Register */ | ||
499 | mcr p15, 0, r4, c1, c0, 2 | ||
500 | |||
501 | /* TTBR0 */ | ||
502 | MCR p15, 0, r5, c2, c0, 0 | ||
503 | /* TTBR1 */ | ||
504 | MCR p15, 0, r6, c2, c0, 1 | ||
505 | /* Translation table base control register */ | ||
506 | MCR p15, 0, r7, c2, c0, 2 | ||
507 | /* Domain access Control Register */ | ||
508 | MCR p15, 0, r8, c3, c0, 0 | ||
509 | /* Data fault status Register */ | ||
510 | MCR p15, 0, r9, c5, c0, 0 | ||
511 | |||
512 | ldmia r3!,{r4-r8} | ||
513 | /* Instruction fault status Register */ | ||
514 | MCR p15, 0, r4, c5, c0, 1 | ||
515 | /* Data Auxiliary Fault Status Register */ | ||
516 | MCR p15, 0, r5, c5, c1, 0 | ||
517 | /* Instruction Auxiliary Fault Status Register*/ | ||
518 | MCR p15, 0, r6, c5, c1, 1 | ||
519 | /* Data Fault Address Register */ | ||
520 | MCR p15, 0, r7, c6, c0, 0 | ||
521 | /* Instruction Fault Address Register*/ | ||
522 | MCR p15, 0, r8, c6, c0, 2 | ||
523 | ldmia r3!,{r4-r7} | ||
524 | 460 | ||
525 | /* User r/w thread and process ID */ | 461 | ldmia r3!, {r4-r7} |
526 | MCR p15, 0, r4, c13, c0, 2 | 462 | mcr p15, 0, r4, c1, c0, 2 @ Coprocessor access Control Register |
527 | /* User ro thread and process ID */ | 463 | mcr p15, 0, r5, c2, c0, 0 @ TTBR0 |
528 | MCR p15, 0, r5, c13, c0, 3 | 464 | mcr p15, 0, r6, c2, c0, 1 @ TTBR1 |
529 | /* Privileged only thread and process ID */ | 465 | mcr p15, 0, r7, c2, c0, 2 @ TTBCR |
530 | MCR p15, 0, r6, c13, c0, 4 | 466 | |
531 | /* Cache size selection */ | 467 | ldmia r3!,{r4-r6} |
532 | MCR p15, 2, r7, c0, c0, 0 | 468 | mcr p15, 0, r4, c3, c0, 0 @ Domain access Control Register |
533 | ldmia r3!,{r4-r8} | 469 | mcr p15, 0, r5, c10, c2, 0 @ PRRR |
534 | /* Data TLB lockdown registers */ | 470 | mcr p15, 0, r6, c10, c2, 1 @ NMRR |
535 | MCR p15, 0, r4, c10, c0, 0 | 471 | |
536 | /* Instruction TLB lockdown registers */ | 472 | |
537 | MCR p15, 0, r5, c10, c0, 1 | 473 | ldmia r3!,{r4-r7} |
538 | /* Secure or Nonsecure Vector Base Address */ | 474 | mcr p15, 0, r4, c13, c0, 1 @ Context ID |
539 | MCR p15, 0, r6, c12, c0, 0 | 475 | mcr p15, 0, r5, c13, c0, 2 @ User r/w thread and process ID |
540 | /* FCSE PID */ | 476 | mrc p15, 0, r6, c12, c0, 0 @ Secure or NS vector base address |
541 | MCR p15, 0, r7, c13, c0, 0 | 477 | msr cpsr, r7 @ store cpsr |
542 | /* Context PID */ | ||
543 | MCR p15, 0, r8, c13, c0, 1 | ||
544 | |||
545 | ldmia r3!,{r4-r5} | ||
546 | /* Primary memory remap register */ | ||
547 | MCR p15, 0, r4, c10, c2, 0 | ||
548 | /* Normal memory remap register */ | ||
549 | MCR p15, 0, r5, c10, c2, 1 | ||
550 | |||
551 | /* Restore cpsr */ | ||
552 | ldmia r3!,{r4} @ load CPSR from SDRAM | ||
553 | msr cpsr, r4 @ store cpsr | ||
554 | 478 | ||
555 | /* Enabling MMU here */ | 479 | /* Enabling MMU here */ |
556 | mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl | 480 | mrc p15, 0, r7, c2, c0, 2 @ Read TTBRControl |