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-xsc3.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-xsc3.S')
-rw-r--r-- | arch/arm/mm/proc-xsc3.S | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/arm/mm/proc-xsc3.S b/arch/arm/mm/proc-xsc3.S index ec26355cb7c2..63d8b2044e84 100644 --- a/arch/arm/mm/proc-xsc3.S +++ b/arch/arm/mm/proc-xsc3.S | |||
@@ -413,9 +413,52 @@ ENTRY(cpu_xsc3_set_pte_ext) | |||
413 | mov pc, lr | 413 | mov pc, lr |
414 | 414 | ||
415 | .ltorg | 415 | .ltorg |
416 | |||
417 | .align | 416 | .align |
418 | 417 | ||
418 | .globl cpu_xsc3_suspend_size | ||
419 | .equ cpu_xsc3_suspend_size, 4 * 8 | ||
420 | #ifdef CONFIG_PM | ||
421 | ENTRY(cpu_xsc3_do_suspend) | ||
422 | stmfd sp!, {r4 - r10, lr} | ||
423 | mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode | ||
424 | mrc p15, 0, r5, c15, c1, 0 @ CP access reg | ||
425 | mrc p15, 0, r6, c13, c0, 0 @ PID | ||
426 | mrc p15, 0, r7, c3, c0, 0 @ domain ID | ||
427 | mrc p15, 0, r8, c2, c0, 0 @ translation table base addr | ||
428 | mrc p15, 0, r9, c1, c0, 1 @ auxiliary control reg | ||
429 | mrc p15, 0, r10, c1, c0, 0 @ control reg | ||
430 | bic r4, r4, #2 @ clear frequency change bit | ||
431 | stmia r0, {r1, r4 - r10} @ store v:p offset + cp regs | ||
432 | ldmia sp!, {r4 - r10, pc} | ||
433 | ENDPROC(cpu_xsc3_do_suspend) | ||
434 | |||
435 | ENTRY(cpu_xsc3_do_resume) | ||
436 | ldmia r0, {r1, r4 - r10} @ load v:p offset + cp regs | ||
437 | mov ip, #0 | ||
438 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB | ||
439 | mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer | ||
440 | mcr p15, 0, ip, c7, c5, 4 @ flush prefetch buffer | ||
441 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | ||
442 | mcr p14, 0, r4, c6, c0, 0 @ clock configuration, turbo mode. | ||
443 | mcr p15, 0, r5, c15, c1, 0 @ CP access reg | ||
444 | mcr p15, 0, r6, c13, c0, 0 @ PID | ||
445 | mcr p15, 0, r7, c3, c0, 0 @ domain ID | ||
446 | mcr p15, 0, r8, c2, c0, 0 @ translation table base addr | ||
447 | mcr p15, 0, r9, c1, c0, 1 @ auxiliary control reg | ||
448 | |||
449 | @ temporarily map resume_turn_on_mmu into the page table, | ||
450 | @ otherwise prefetch abort occurs after MMU is turned on | ||
451 | mov r0, r10 @ control register | ||
452 | mov r2, r8, lsr #14 @ get TTB0 base | ||
453 | mov r2, r2, lsl #14 | ||
454 | ldr r3, =0x542e @ section flags | ||
455 | b cpu_resume_mmu | ||
456 | ENDPROC(cpu_xsc3_do_resume) | ||
457 | #else | ||
458 | #define cpu_xsc3_do_suspend 0 | ||
459 | #define cpu_xsc3_do_resume 0 | ||
460 | #endif | ||
461 | |||
419 | __CPUINIT | 462 | __CPUINIT |
420 | 463 | ||
421 | .type __xsc3_setup, #function | 464 | .type __xsc3_setup, #function |
@@ -476,6 +519,9 @@ ENTRY(xsc3_processor_functions) | |||
476 | .word cpu_xsc3_dcache_clean_area | 519 | .word cpu_xsc3_dcache_clean_area |
477 | .word cpu_xsc3_switch_mm | 520 | .word cpu_xsc3_switch_mm |
478 | .word cpu_xsc3_set_pte_ext | 521 | .word cpu_xsc3_set_pte_ext |
522 | .word cpu_xsc3_suspend_size | ||
523 | .word cpu_xsc3_do_suspend | ||
524 | .word cpu_xsc3_do_resume | ||
479 | .size xsc3_processor_functions, . - xsc3_processor_functions | 525 | .size xsc3_processor_functions, . - xsc3_processor_functions |
480 | 526 | ||
481 | .section ".rodata" | 527 | .section ".rodata" |