diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-06-24 12:49:58 +0200 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2016-06-28 10:26:37 +0800 |
commit | c112d2adc32c90ff39ad39feba8c29dcb6008ff6 (patch) | |
tree | 2967c1db95ff2d8fbf8f41c5ee62d3680e7079d4 /arch/arm/mach-imx/mm-imx3.c | |
parent | c9ee94965dce7b66964c5f0b0db892055757d608 (diff) | |
download | blackbird-obmc-linux-c112d2adc32c90ff39ad39feba8c29dcb6008ff6.tar.gz blackbird-obmc-linux-c112d2adc32c90ff39ad39feba8c29dcb6008ff6.zip |
ARM: imx: deconstruct mx3_idle
The imx31 and imx35 idle functions are almost the same, but we
currently have to check the cpu type every time. This can be
simplified by moving the logic from mx3_cpu_lp_set() into
two separate idle functions, removing the last user of
cpu_is_mx35.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'arch/arm/mach-imx/mm-imx3.c')
-rw-r--r-- | arch/arm/mach-imx/mm-imx3.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 3b135cd4b043..7638a35b3b36 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c @@ -19,6 +19,7 @@ #include <linux/mm.h> #include <linux/init.h> #include <linux/err.h> +#include <linux/io.h> #include <linux/pinctrl/machine.h> #include <asm/pgtable.h> @@ -38,8 +39,6 @@ static void imx3_idle(void) { unsigned long reg = 0; - mx3_cpu_lp_set(MX3_WAIT); - __asm__ __volatile__( /* disable I and D cache */ "mrc p15, 0, %0, c1, c0, 0\n" @@ -135,11 +134,20 @@ void __init mx31_map_io(void) iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc)); } +static void imx31_idle(void) +{ + int reg = imx_readl(mx3_ccm_base + MXC_CCM_CCMR); + reg &= ~MXC_CCM_CCMR_LPM_MASK; + imx_writel(reg, mx3_ccm_base + MXC_CCM_CCMR); + + imx3_idle(); +} + void __init imx31_init_early(void) { mxc_set_cpu_type(MXC_CPU_MX31); arch_ioremap_caller = imx3_ioremap_caller; - arm_pm_idle = imx3_idle; + arm_pm_idle = imx31_idle; mx3_ccm_base = MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR); } @@ -218,11 +226,21 @@ void __init mx35_map_io(void) iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc)); } +static void imx35_idle(void) +{ + int reg = imx_readl(mx3_ccm_base + MXC_CCM_CCMR); + reg &= ~MXC_CCM_CCMR_LPM_MASK; + reg |= MXC_CCM_CCMR_LPM_WAIT_MX35; + imx_writel(reg, mx3_ccm_base + MXC_CCM_CCMR); + + imx3_idle(); +} + void __init imx35_init_early(void) { mxc_set_cpu_type(MXC_CPU_MX35); mxc_iomux_v3_init(MX35_IO_ADDRESS(MX35_IOMUXC_BASE_ADDR)); - arm_pm_idle = imx3_idle; + arm_pm_idle = imx35_idle; arch_ioremap_caller = imx3_ioremap_caller; mx3_ccm_base = MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR); } |