]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM: imx6: move v7_cpu_resume() into suspend-imx6.S
authorShawn Guo <shawn.guo@linaro.org>
Wed, 26 Feb 2014 11:48:33 +0000 (19:48 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Wed, 5 Mar 2014 02:40:49 +0000 (10:40 +0800)
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>
arch/arm/mach-imx/Makefile
arch/arm/mach-imx/common.h
arch/arm/mach-imx/headsmp.S
arch/arm/mach-imx/suspend-imx6.S

index 979ff84b2385cba0c4ee24fd5664cd079519c30a..b4c19cda67e83c7548afb8766d0fe567afa98946 100644 (file)
@@ -103,9 +103,10 @@ obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o
 obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o
 
 AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
-obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o suspend-imx6.o
+obj-$(CONFIG_SUSPEND) += suspend-imx6.o
+obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o
 # i.MX6SL reuses i.MX6Q code
-obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o suspend-imx6.o
+obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o
 
 # i.MX5 based machines
 obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o
index 91d69ccf7c761365ac38ef4dd5ee1f1234ab167f..b5241ea7670642fd2902f1896ad8c666daea3f4f 100644 (file)
@@ -116,7 +116,6 @@ void imx_enable_cpu(int cpu, bool enable);
 void imx_set_cpu_jump(int cpu, void *jump_addr);
 u32 imx_get_cpu_arg(int cpu);
 void imx_set_cpu_arg(int cpu, u32 arg);
-void v7_cpu_resume(void);
 #ifdef CONFIG_SMP
 void v7_secondary_startup(void);
 void imx_scu_map_io(void);
@@ -145,7 +144,14 @@ void imx6sl_set_wait_clk(bool enter);
 void imx_cpu_die(unsigned int cpu);
 int imx_cpu_kill(unsigned int cpu);
 
+#ifdef CONFIG_SUSPEND
+void v7_cpu_resume(void);
 void imx6_suspend(void __iomem *ocram_vbase);
+#else
+static inline void v7_cpu_resume(void) {}
+static inline void imx6_suspend(void __iomem *ocram_vbase) {}
+#endif
+
 void imx6q_pm_init(void);
 void imx6dl_pm_init(void);
 void imx6sl_pm_init(void);
index 627f16f0e9d1d393d48527e50f25c5e22c81987d..e4b9fed8144d18680f8ddbeee38e68e6207549a5 100644 (file)
@@ -12,8 +12,6 @@
 
 #include <linux/linkage.h>
 #include <linux/init.h>
-#include <asm/asm-offsets.h>
-#include <asm/hardware/cache-l2x0.h>
 
        .section ".text.head", "ax"
 
@@ -35,37 +33,3 @@ ENTRY(v7_secondary_startup)
        b       secondary_startup
 ENDPROC(v7_secondary_startup)
 #endif
-
-#ifdef CONFIG_ARM_CPU_SUSPEND
-/*
- * The following code must assume it is running from physical address
- * where absolute virtual addresses to the data section have to be
- * turned into relative ones.
- */
-
-#ifdef CONFIG_CACHE_L2X0
-       .macro  pl310_resume
-       adr     r0, l2x0_saved_regs_offset
-       ldr     r2, [r0]
-       add     r2, r2, r0
-       ldr     r0, [r2, #L2X0_R_PHY_BASE]      @ get physical base of l2x0
-       ldr     r1, [r2, #L2X0_R_AUX_CTRL]      @ get aux_ctrl value
-       str     r1, [r0, #L2X0_AUX_CTRL]        @ restore aux_ctrl
-       mov     r1, #0x1
-       str     r1, [r0, #L2X0_CTRL]            @ re-enable L2
-       .endm
-
-l2x0_saved_regs_offset:
-       .word   l2x0_saved_regs - .
-
-#else
-       .macro  pl310_resume
-       .endm
-#endif
-
-ENTRY(v7_cpu_resume)
-       bl      v7_invalidate_l1
-       pl310_resume
-       b       cpu_resume
-ENDPROC(v7_cpu_resume)
-#endif
index 81b9d1da2f2127fe34692b750bfab07ad826be9c..20048ff05739dcd41e3595850045ead6a21771d1 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/linkage.h>
+#include <asm/asm-offsets.h>
 #include <asm/hardware/cache-l2x0.h>
 #include "hardware.h"
 
@@ -326,3 +327,35 @@ resume:
 
        mov     pc, lr
 ENDPROC(imx6_suspend)
+
+/*
+ * The following code must assume it is running from physical address
+ * where absolute virtual addresses to the data section have to be
+ * turned into relative ones.
+ */
+
+#ifdef CONFIG_CACHE_L2X0
+       .macro  pl310_resume
+       adr     r0, l2x0_saved_regs_offset
+       ldr     r2, [r0]
+       add     r2, r2, r0
+       ldr     r0, [r2, #L2X0_R_PHY_BASE]      @ get physical base of l2x0
+       ldr     r1, [r2, #L2X0_R_AUX_CTRL]      @ get aux_ctrl value
+       str     r1, [r0, #L2X0_AUX_CTRL]        @ restore aux_ctrl
+       mov     r1, #0x1
+       str     r1, [r0, #L2X0_CTRL]            @ re-enable L2
+       .endm
+
+l2x0_saved_regs_offset:
+       .word   l2x0_saved_regs - .
+
+#else
+       .macro  pl310_resume
+       .endm
+#endif
+
+ENTRY(v7_cpu_resume)
+       bl      v7_invalidate_l1
+       pl310_resume
+       b       cpu_resume
+ENDPROC(v7_cpu_resume)