aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/suspend-imx6.S
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2014-02-26 06:48:33 -0500
committerShawn Guo <shawn.guo@linaro.org>2014-03-04 21:40:49 -0500
commitc356bdb407baf23b202a6b4d2234114db6ae55bd (patch)
tree4dd40d43e54d0e8c0bcb61d1bd3eea24e78015ba /arch/arm/mach-imx/suspend-imx6.S
parent7ea653efa98d8144345227576fc084ed7a356cf8 (diff)
ARM: imx6: move v7_cpu_resume() into suspend-imx6.S
The suspend-imx6.S is introduced recently for suspend low-level assembly code. Since function v7_cpu_resume() is only used by suspend support, it makes sense to move the function into suspend-imx6.S, and control the build of the file with CONFIG_SUSPEND option. Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/suspend-imx6.S')
-rw-r--r--arch/arm/mach-imx/suspend-imx6.S33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S
index 81b9d1da2f21..20048ff05739 100644
--- a/arch/arm/mach-imx/suspend-imx6.S
+++ b/arch/arm/mach-imx/suspend-imx6.S
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/asm-offsets.h>
13#include <asm/hardware/cache-l2x0.h> 14#include <asm/hardware/cache-l2x0.h>
14#include "hardware.h" 15#include "hardware.h"
15 16
@@ -326,3 +327,35 @@ resume:
326 327
327 mov pc, lr 328 mov pc, lr
328ENDPROC(imx6_suspend) 329ENDPROC(imx6_suspend)
330
331/*
332 * The following code must assume it is running from physical address
333 * where absolute virtual addresses to the data section have to be
334 * turned into relative ones.
335 */
336
337#ifdef CONFIG_CACHE_L2X0
338 .macro pl310_resume
339 adr r0, l2x0_saved_regs_offset
340 ldr r2, [r0]
341 add r2, r2, r0
342 ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0
343 ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value
344 str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl
345 mov r1, #0x1
346 str r1, [r0, #L2X0_CTRL] @ re-enable L2
347 .endm
348
349l2x0_saved_regs_offset:
350 .word l2x0_saved_regs - .
351
352#else
353 .macro pl310_resume
354 .endm
355#endif
356
357ENTRY(v7_cpu_resume)
358 bl v7_invalidate_l1
359 pl310_resume
360 b cpu_resume
361ENDPROC(v7_cpu_resume)