diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2014-02-26 06:48:33 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2014-03-04 21:40:49 -0500 |
commit | c356bdb407baf23b202a6b4d2234114db6ae55bd (patch) | |
tree | 4dd40d43e54d0e8c0bcb61d1bd3eea24e78015ba | |
parent | 7ea653efa98d8144345227576fc084ed7a356cf8 (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>
-rw-r--r-- | arch/arm/mach-imx/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-imx/headsmp.S | 36 | ||||
-rw-r--r-- | arch/arm/mach-imx/suspend-imx6.S | 33 |
4 files changed, 43 insertions, 39 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 979ff84b2385..b4c19cda67e8 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -103,9 +103,10 @@ obj-$(CONFIG_SOC_IMX6Q) += clk-imx6q.o mach-imx6q.o | |||
103 | obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o | 103 | obj-$(CONFIG_SOC_IMX6SL) += clk-imx6sl.o mach-imx6sl.o |
104 | 104 | ||
105 | AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a | 105 | AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a |
106 | obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o suspend-imx6.o | 106 | obj-$(CONFIG_SUSPEND) += suspend-imx6.o |
107 | obj-$(CONFIG_SOC_IMX6Q) += pm-imx6q.o headsmp.o | ||
107 | # i.MX6SL reuses i.MX6Q code | 108 | # i.MX6SL reuses i.MX6Q code |
108 | obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o suspend-imx6.o | 109 | obj-$(CONFIG_SOC_IMX6SL) += pm-imx6q.o headsmp.o |
109 | 110 | ||
110 | # i.MX5 based machines | 111 | # i.MX5 based machines |
111 | obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o | 112 | obj-$(CONFIG_MACH_MX51_BABBAGE) += mach-mx51_babbage.o |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 91d69ccf7c76..b5241ea76706 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -116,7 +116,6 @@ void imx_enable_cpu(int cpu, bool enable); | |||
116 | void imx_set_cpu_jump(int cpu, void *jump_addr); | 116 | void imx_set_cpu_jump(int cpu, void *jump_addr); |
117 | u32 imx_get_cpu_arg(int cpu); | 117 | u32 imx_get_cpu_arg(int cpu); |
118 | void imx_set_cpu_arg(int cpu, u32 arg); | 118 | void imx_set_cpu_arg(int cpu, u32 arg); |
119 | void v7_cpu_resume(void); | ||
120 | #ifdef CONFIG_SMP | 119 | #ifdef CONFIG_SMP |
121 | void v7_secondary_startup(void); | 120 | void v7_secondary_startup(void); |
122 | void imx_scu_map_io(void); | 121 | void imx_scu_map_io(void); |
@@ -145,7 +144,14 @@ void imx6sl_set_wait_clk(bool enter); | |||
145 | void imx_cpu_die(unsigned int cpu); | 144 | void imx_cpu_die(unsigned int cpu); |
146 | int imx_cpu_kill(unsigned int cpu); | 145 | int imx_cpu_kill(unsigned int cpu); |
147 | 146 | ||
147 | #ifdef CONFIG_SUSPEND | ||
148 | void v7_cpu_resume(void); | ||
148 | void imx6_suspend(void __iomem *ocram_vbase); | 149 | void imx6_suspend(void __iomem *ocram_vbase); |
150 | #else | ||
151 | static inline void v7_cpu_resume(void) {} | ||
152 | static inline void imx6_suspend(void __iomem *ocram_vbase) {} | ||
153 | #endif | ||
154 | |||
149 | void imx6q_pm_init(void); | 155 | void imx6q_pm_init(void); |
150 | void imx6dl_pm_init(void); | 156 | void imx6dl_pm_init(void); |
151 | void imx6sl_pm_init(void); | 157 | void imx6sl_pm_init(void); |
diff --git a/arch/arm/mach-imx/headsmp.S b/arch/arm/mach-imx/headsmp.S index 627f16f0e9d1..e4b9fed8144d 100644 --- a/arch/arm/mach-imx/headsmp.S +++ b/arch/arm/mach-imx/headsmp.S | |||
@@ -12,8 +12,6 @@ | |||
12 | 12 | ||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <asm/asm-offsets.h> | ||
16 | #include <asm/hardware/cache-l2x0.h> | ||
17 | 15 | ||
18 | .section ".text.head", "ax" | 16 | .section ".text.head", "ax" |
19 | 17 | ||
@@ -35,37 +33,3 @@ ENTRY(v7_secondary_startup) | |||
35 | b secondary_startup | 33 | b secondary_startup |
36 | ENDPROC(v7_secondary_startup) | 34 | ENDPROC(v7_secondary_startup) |
37 | #endif | 35 | #endif |
38 | |||
39 | #ifdef CONFIG_ARM_CPU_SUSPEND | ||
40 | /* | ||
41 | * The following code must assume it is running from physical address | ||
42 | * where absolute virtual addresses to the data section have to be | ||
43 | * turned into relative ones. | ||
44 | */ | ||
45 | |||
46 | #ifdef CONFIG_CACHE_L2X0 | ||
47 | .macro pl310_resume | ||
48 | adr r0, l2x0_saved_regs_offset | ||
49 | ldr r2, [r0] | ||
50 | add r2, r2, r0 | ||
51 | ldr r0, [r2, #L2X0_R_PHY_BASE] @ get physical base of l2x0 | ||
52 | ldr r1, [r2, #L2X0_R_AUX_CTRL] @ get aux_ctrl value | ||
53 | str r1, [r0, #L2X0_AUX_CTRL] @ restore aux_ctrl | ||
54 | mov r1, #0x1 | ||
55 | str r1, [r0, #L2X0_CTRL] @ re-enable L2 | ||
56 | .endm | ||
57 | |||
58 | l2x0_saved_regs_offset: | ||
59 | .word l2x0_saved_regs - . | ||
60 | |||
61 | #else | ||
62 | .macro pl310_resume | ||
63 | .endm | ||
64 | #endif | ||
65 | |||
66 | ENTRY(v7_cpu_resume) | ||
67 | bl v7_invalidate_l1 | ||
68 | pl310_resume | ||
69 | b cpu_resume | ||
70 | ENDPROC(v7_cpu_resume) | ||
71 | #endif | ||
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 |
328 | ENDPROC(imx6_suspend) | 329 | ENDPROC(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 | |||
349 | l2x0_saved_regs_offset: | ||
350 | .word l2x0_saved_regs - . | ||
351 | |||
352 | #else | ||
353 | .macro pl310_resume | ||
354 | .endm | ||
355 | #endif | ||
356 | |||
357 | ENTRY(v7_cpu_resume) | ||
358 | bl v7_invalidate_l1 | ||
359 | pl310_resume | ||
360 | b cpu_resume | ||
361 | ENDPROC(v7_cpu_resume) | ||