aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Xie <chao.xie@marvell.com>2012-05-06 23:23:58 -0400
committerHaojian Zhuang <haojian.zhuang@gmail.com>2012-05-06 23:42:54 -0400
commit3f5d081957cee794fe2937bb7edafa7ac949044d (patch)
treeeca3454f0e5ab78e540cc39d02b2bd82421a85d5
parent87046f4f3194ac0a795a10f3368ac73c04c633e3 (diff)
ARM: mm: proc-mohawk: add suspend resume for mohawk
When enable ARCH_SUSPEND_POSSIBLE, it need defintion of cpu_mohawk_do_suspend and cpu_mohawk_do_resume Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Haojian Zhuang <<haojian.zhuang@gmail.com>
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/mm/proc-mohawk.S35
2 files changed, 36 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4cf9d4280972..aaa22f89fd23 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2275,7 +2275,7 @@ source "kernel/power/Kconfig"
2275config ARCH_SUSPEND_POSSIBLE 2275config ARCH_SUSPEND_POSSIBLE
2276 depends on !ARCH_S5PC100 2276 depends on !ARCH_S5PC100
2277 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2277 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
2278 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE 2278 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
2279 def_bool y 2279 def_bool y
2280 2280
2281config ARM_CPU_SUSPEND 2281config ARM_CPU_SUSPEND
diff --git a/arch/arm/mm/proc-mohawk.S b/arch/arm/mm/proc-mohawk.S
index cdfedc5b8ad8..6a050b19cdf5 100644
--- a/arch/arm/mm/proc-mohawk.S
+++ b/arch/arm/mm/proc-mohawk.S
@@ -344,6 +344,41 @@ ENTRY(cpu_mohawk_set_pte_ext)
344 mcr p15, 0, r0, c7, c10, 4 @ drain WB 344 mcr p15, 0, r0, c7, c10, 4 @ drain WB
345 mov pc, lr 345 mov pc, lr
346 346
347.globl cpu_mohawk_suspend_size
348.equ cpu_mohawk_suspend_size, 4 * 6
349#ifdef CONFIG_PM_SLEEP
350ENTRY(cpu_mohawk_do_suspend)
351 stmfd sp!, {r4 - r9, lr}
352 mrc p14, 0, r4, c6, c0, 0 @ clock configuration, for turbo mode
353 mrc p15, 0, r5, c15, c1, 0 @ CP access reg
354 mrc p15, 0, r6, c13, c0, 0 @ PID
355 mrc p15, 0, r7, c3, c0, 0 @ domain ID
356 mrc p15, 0, r8, c1, c0, 1 @ auxiliary control reg
357 mrc p15, 0, r9, c1, c0, 0 @ control reg
358 bic r4, r4, #2 @ clear frequency change bit
359 stmia r0, {r4 - r9} @ store cp regs
360 ldmia sp!, {r4 - r9, pc}
361ENDPROC(cpu_mohawk_do_suspend)
362
363ENTRY(cpu_mohawk_do_resume)
364 ldmia r0, {r4 - r9} @ load cp regs
365 mov ip, #0
366 mcr p15, 0, ip, c7, c7, 0 @ invalidate I & D caches, BTB
367 mcr p15, 0, ip, c7, c10, 4 @ drain write (&fill) buffer
368 mcr p15, 0, ip, c7, c5, 4 @ flush prefetch buffer
369 mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs
370 mcr p14, 0, r4, c6, c0, 0 @ clock configuration, turbo mode.
371 mcr p15, 0, r5, c15, c1, 0 @ CP access reg
372 mcr p15, 0, r6, c13, c0, 0 @ PID
373 mcr p15, 0, r7, c3, c0, 0 @ domain ID
374 orr r1, r1, #0x18 @ cache the page table in L2
375 mcr p15, 0, r1, c2, c0, 0 @ translation table base addr
376 mcr p15, 0, r8, c1, c0, 1 @ auxiliary control reg
377 mov r0, r9 @ control register
378 b cpu_resume_mmu
379ENDPROC(cpu_mohawk_do_resume)
380#endif
381
347 __CPUINIT 382 __CPUINIT
348 383
349 .type __mohawk_setup, #function 384 .type __mohawk_setup, #function