ARM: 8013/1: PJ4B: Add cpu_suspend/cpu_resume hooks for PJ4B
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Fri, 28 Mar 2014 11:21:16 +0000 (12:21 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 23 Apr 2014 00:24:35 +0000 (01:24 +0100)
PJ4B needs extra instructions for suspend and resume, so instead of
using the armv7 version, this commit introduces specific versions for
PJ4B.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/proc-v7.S

index 195731d3813bb5c0ecba68c5c82ead71b4fbe532..b74ea60891d501333f745b10d4f7a4d40353c513 100644 (file)
@@ -169,9 +169,31 @@ ENDPROC(cpu_pj4b_do_idle)
        globl_equ       cpu_pj4b_do_idle,       cpu_v7_do_idle
 #endif
        globl_equ       cpu_pj4b_dcache_clean_area,     cpu_v7_dcache_clean_area
-       globl_equ       cpu_pj4b_do_suspend,    cpu_v7_do_suspend
-       globl_equ       cpu_pj4b_do_resume,     cpu_v7_do_resume
-       globl_equ       cpu_pj4b_suspend_size,  cpu_v7_suspend_size
+#ifdef CONFIG_ARM_CPU_SUSPEND
+ENTRY(cpu_pj4b_do_suspend)
+       stmfd   sp!, {r6 - r10}
+       mrc     p15, 1, r6, c15, c1, 0  @ save CP15 - extra features
+       mrc     p15, 1, r7, c15, c2, 0  @ save CP15 - Aux Func Modes Ctrl 0
+       mrc     p15, 1, r8, c15, c1, 2  @ save CP15 - Aux Debug Modes Ctrl 2
+       mrc     p15, 1, r9, c15, c1, 1  @ save CP15 - Aux Debug Modes Ctrl 1
+       mrc     p15, 0, r10, c9, c14, 0  @ save CP15 - PMC
+       stmia   r0!, {r6 - r10}
+       ldmfd   sp!, {r6 - r10}
+       b cpu_v7_do_suspend
+ENDPROC(cpu_pj4b_do_suspend)
+
+ENTRY(cpu_pj4b_do_resume)
+       ldmia   r0!, {r6 - r10}
+       mcr     p15, 1, r6, c15, c1, 0  @ save CP15 - extra features
+       mcr     p15, 1, r7, c15, c2, 0  @ save CP15 - Aux Func Modes Ctrl 0
+       mcr     p15, 1, r8, c15, c1, 2  @ save CP15 - Aux Debug Modes Ctrl 2
+       mcr     p15, 1, r9, c15, c1, 1  @ save CP15 - Aux Debug Modes Ctrl 1
+       mcr     p15, 0, r10, c9, c14, 0  @ save CP15 - PMC
+       b cpu_v7_do_resume
+ENDPROC(cpu_pj4b_do_resume)
+#endif
+.globl cpu_pj4b_suspend_size
+.equ   cpu_pj4b_suspend_size, 4 * 14
 
 #endif