diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-09-19 10:48:45 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2016-09-19 10:48:45 -0400 |
commit | 1c90e170fef7df71f09be837e65641cf5c687dce (patch) | |
tree | 3c1fe713862dfd27e1d451331155284224b0b3af /arch/arm/mach-imx | |
parent | 4a5c99462ab5cdc111007625b76e349076f18a29 (diff) | |
parent | d64299daf44c7ff57120a379ceb4907f19bbf041 (diff) |
Merge tag 'imx-soc-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc
Pull "i.MX SoC updates for 4.9" from Shawn Guo:
- Set INT_MEM_CLK_LPM bit to get proper WAIT mode support on i.MX6SX.
This is a workaround for i.MX6SX WAIT mode hardware issue.
- Enable cpuidle support with 3 low-power states (WFI, WAIT, POWER-OFF)
for i.MX6UL.
* tag 'imx-soc-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
ARM: imx: build cpuidle-imx6sx.o for imx6ul
ARM: imx: add cpuidle support for i.mx6ul
ARM: imx: enable WAIT mode hardware workaround for imx6sx
ARM: imx: rename imx6q_set_int_mem_clk_lpm() function
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6q.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6sx.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx6ul.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/pm-imx6.c | 8 |
6 files changed, 21 insertions, 6 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile index 9f5fffd62702..574e5b8c6a65 100644 --- a/arch/arm/mach-imx/Makefile +++ b/arch/arm/mach-imx/Makefile | |||
@@ -28,6 +28,7 @@ obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o | |||
28 | obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o | 28 | obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o |
29 | obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o | 29 | obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o |
30 | obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6sx.o | 30 | obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6sx.o |
31 | obj-$(CONFIG_SOC_IMX6UL) += cpuidle-imx6sx.o | ||
31 | endif | 32 | endif |
32 | 33 | ||
33 | ifdef CONFIG_SND_IMX_SOC | 34 | ifdef CONFIG_SND_IMX_SOC |
diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index a8f469333027..fb644304446c 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h | |||
@@ -109,7 +109,7 @@ void imx_anatop_init(void); | |||
109 | void imx_anatop_pre_suspend(void); | 109 | void imx_anatop_pre_suspend(void); |
110 | void imx_anatop_post_resume(void); | 110 | void imx_anatop_post_resume(void); |
111 | int imx6_set_lpm(enum mxc_cpu_pwr_mode mode); | 111 | int imx6_set_lpm(enum mxc_cpu_pwr_mode mode); |
112 | void imx6q_set_int_mem_clk_lpm(bool enable); | 112 | void imx6_set_int_mem_clk_lpm(bool enable); |
113 | void imx6sl_set_wait_clk(bool enter); | 113 | void imx6sl_set_wait_clk(bool enter); |
114 | int imx_mmdc_get_ddr_type(void); | 114 | int imx_mmdc_get_ddr_type(void); |
115 | 115 | ||
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c index db0f48c4b17e..bfeb25aaf9a2 100644 --- a/arch/arm/mach-imx/cpuidle-imx6q.c +++ b/arch/arm/mach-imx/cpuidle-imx6q.c | |||
@@ -85,7 +85,7 @@ EXPORT_SYMBOL_GPL(imx6q_cpuidle_fec_irqs_unused); | |||
85 | int __init imx6q_cpuidle_init(void) | 85 | int __init imx6q_cpuidle_init(void) |
86 | { | 86 | { |
87 | /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ | 87 | /* Set INT_MEM_CLK_LPM bit to get a reliable WAIT mode support */ |
88 | imx6q_set_int_mem_clk_lpm(true); | 88 | imx6_set_int_mem_clk_lpm(true); |
89 | 89 | ||
90 | return cpuidle_register(&imx6q_cpuidle_driver, NULL); | 90 | return cpuidle_register(&imx6q_cpuidle_driver, NULL); |
91 | } | 91 | } |
diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c index 3c6672b3796b..c5a5c3a70ab1 100644 --- a/arch/arm/mach-imx/cpuidle-imx6sx.c +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/cpuidle.h> | 9 | #include <linux/cpuidle.h> |
10 | #include <linux/cpu_pm.h> | 10 | #include <linux/cpu_pm.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <asm/cacheflush.h> | ||
12 | #include <asm/cpuidle.h> | 13 | #include <asm/cpuidle.h> |
13 | #include <asm/suspend.h> | 14 | #include <asm/suspend.h> |
14 | 15 | ||
@@ -17,6 +18,15 @@ | |||
17 | 18 | ||
18 | static int imx6sx_idle_finish(unsigned long val) | 19 | static int imx6sx_idle_finish(unsigned long val) |
19 | { | 20 | { |
21 | /* | ||
22 | * for Cortex-A7 which has an internal L2 | ||
23 | * cache, need to flush it before powering | ||
24 | * down ARM platform, since flushing L1 cache | ||
25 | * here again has very small overhead, compared | ||
26 | * to adding conditional code for L2 cache type, | ||
27 | * just call flush_cache_all() is fine. | ||
28 | */ | ||
29 | flush_cache_all(); | ||
20 | cpu_do_idle(); | 30 | cpu_do_idle(); |
21 | 31 | ||
22 | return 0; | 32 | return 0; |
@@ -90,6 +100,7 @@ static struct cpuidle_driver imx6sx_cpuidle_driver = { | |||
90 | 100 | ||
91 | int __init imx6sx_cpuidle_init(void) | 101 | int __init imx6sx_cpuidle_init(void) |
92 | { | 102 | { |
103 | imx6_set_int_mem_clk_lpm(true); | ||
93 | imx6_enable_rbc(false); | 104 | imx6_enable_rbc(false); |
94 | /* | 105 | /* |
95 | * set ARM power up/down timing to the fastest, | 106 | * set ARM power up/down timing to the fastest, |
diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index 5d9bfab279dd..08308a127ff7 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
17 | 17 | ||
18 | #include "common.h" | 18 | #include "common.h" |
19 | #include "cpuidle.h" | ||
19 | 20 | ||
20 | static void __init imx6ul_enet_clk_init(void) | 21 | static void __init imx6ul_enet_clk_init(void) |
21 | { | 22 | { |
@@ -79,6 +80,8 @@ static void __init imx6ul_init_irq(void) | |||
79 | 80 | ||
80 | static void __init imx6ul_init_late(void) | 81 | static void __init imx6ul_init_late(void) |
81 | { | 82 | { |
83 | imx6sx_cpuidle_init(); | ||
84 | |||
82 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) | 85 | if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) |
83 | platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); | 86 | platform_device_register_simple("imx6q-cpufreq", -1, NULL, 0); |
84 | } | 87 | } |
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 58924b3844df..549648309deb 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c | |||
@@ -217,7 +217,7 @@ struct imx6_cpu_pm_info { | |||
217 | u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */ | 217 | u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */ |
218 | } __aligned(8); | 218 | } __aligned(8); |
219 | 219 | ||
220 | void imx6q_set_int_mem_clk_lpm(bool enable) | 220 | void imx6_set_int_mem_clk_lpm(bool enable) |
221 | { | 221 | { |
222 | u32 val = readl_relaxed(ccm_base + CGPR); | 222 | u32 val = readl_relaxed(ccm_base + CGPR); |
223 | 223 | ||
@@ -367,7 +367,7 @@ static int imx6q_pm_enter(suspend_state_t state) | |||
367 | switch (state) { | 367 | switch (state) { |
368 | case PM_SUSPEND_STANDBY: | 368 | case PM_SUSPEND_STANDBY: |
369 | imx6_set_lpm(STOP_POWER_ON); | 369 | imx6_set_lpm(STOP_POWER_ON); |
370 | imx6q_set_int_mem_clk_lpm(true); | 370 | imx6_set_int_mem_clk_lpm(true); |
371 | imx_gpc_pre_suspend(false); | 371 | imx_gpc_pre_suspend(false); |
372 | if (cpu_is_imx6sl()) | 372 | if (cpu_is_imx6sl()) |
373 | imx6sl_set_wait_clk(true); | 373 | imx6sl_set_wait_clk(true); |
@@ -380,7 +380,7 @@ static int imx6q_pm_enter(suspend_state_t state) | |||
380 | break; | 380 | break; |
381 | case PM_SUSPEND_MEM: | 381 | case PM_SUSPEND_MEM: |
382 | imx6_set_lpm(STOP_POWER_OFF); | 382 | imx6_set_lpm(STOP_POWER_OFF); |
383 | imx6q_set_int_mem_clk_lpm(false); | 383 | imx6_set_int_mem_clk_lpm(false); |
384 | imx6q_enable_wb(true); | 384 | imx6q_enable_wb(true); |
385 | /* | 385 | /* |
386 | * For suspend into ocram, asm code already take care of | 386 | * For suspend into ocram, asm code already take care of |
@@ -398,7 +398,7 @@ static int imx6q_pm_enter(suspend_state_t state) | |||
398 | imx_gpc_post_resume(); | 398 | imx_gpc_post_resume(); |
399 | imx6_enable_rbc(false); | 399 | imx6_enable_rbc(false); |
400 | imx6q_enable_wb(false); | 400 | imx6q_enable_wb(false); |
401 | imx6q_set_int_mem_clk_lpm(true); | 401 | imx6_set_int_mem_clk_lpm(true); |
402 | imx6_set_lpm(WAIT_CLOCKED); | 402 | imx6_set_lpm(WAIT_CLOCKED); |
403 | break; | 403 | break; |
404 | default: | 404 | default: |