From e6a07569611daf4190c0fd2c2bb1e2189c0cb479 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Mon, 8 Jul 2013 21:45:20 +0800 Subject: ARM: imx: let L2 initialization be a common function Move imx6q L2 initialization function imx6q_init_l2cache() into system.c, and rename it imx_init_l2cache(), so that other platforms other than imx6q can also use the function. Signed-off-by: Shawn Guo Acked-by: Dirk Behme --- arch/arm/mach-imx/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-imx/common.h') diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index cb6c838b63e..b96aff7476e 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -161,6 +161,12 @@ extern int mx51_neon_fixup(void); static inline int mx51_neon_fixup(void) { return 0; } #endif +#ifdef CONFIG_CACHE_L2X0 +extern void imx_init_l2cache(void); +#else +static inline void imx_init_l2cache(void) {} +#endif + extern struct smp_operations imx_smp_ops; #endif -- cgit v1.2.3-70-g09d2 From 547dd1e089db9927ad95cfb525152fec5153cfeb Mon Sep 17 00:00:00 2001 From: Fabio Estevam Date: Fri, 26 Jul 2013 00:17:36 -0300 Subject: ARM: mx53: Allow suspend/resume Current imx53_pm_init() implementation is incomplete as it lacks calling suspend_set_ops(). Use a single imx5_pm_init() function to handle both mx51 and mx53. This allows mx53 to enter in low-power mode. Tested on a mx53qsb: root@freescale /$ echo mem > /sys/power/state PM: Syncing filesystems ... done. mmc0: card e624 removed Freezing user space processes ... (elapsed 0.001 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. Suspending console(s) (use no_console_suspend to debug) ... (Press Power button) PM: suspend of devices complete after 17.067 msecs PM: suspend devices took 0.020 seconds PM: late suspend of devices complete after 0.954 msecs PM: noirq suspend of devices complete after 1.288 msecs Disabling non-boot CPUs ... PM: noirq resume of devices complete after 0.680 msecs PM: early resume of devices complete after 0.914 msecs PM: resume of devices complete after 44.955 msecs PM: resume devices took 0.050 seconds Restarting tasks ... done. mmc0: host does not support reading read-only switch. assuming write-enable. mmc0: new SDHC card at address e624 mmcblk0: mmc0:e624 SU04G 3.69 GiB mmcblk0: p1 p2 p3 libphy: 63fec000.etherne:00 - Link is Down libphy: 63fec000.etherne:00 - Link is Up - 100/Full root@freescale /$ Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo --- arch/arm/mach-imx/common.h | 6 ++---- arch/arm/mach-imx/mm-imx5.c | 4 ++-- arch/arm/mach-imx/pm-imx5.c | 7 +------ 3 files changed, 5 insertions(+), 12 deletions(-) (limited to 'arch/arm/mach-imx/common.h') diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index b96aff7476e..cdc9288ac48 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -147,12 +147,10 @@ extern int imx_cpu_kill(unsigned int cpu); #ifdef CONFIG_PM extern void imx6q_pm_init(void); -extern void imx51_pm_init(void); -extern void imx53_pm_init(void); +extern void imx5_pm_init(void); #else static inline void imx6q_pm_init(void) {} -static inline void imx51_pm_init(void) {} -static inline void imx53_pm_init(void) {} +static inline void imx5_pm_init(void) {} #endif #ifdef CONFIG_NEON diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c index cf193d87274..a8229b7f10b 100644 --- a/arch/arm/mach-imx/mm-imx5.c +++ b/arch/arm/mach-imx/mm-imx5.c @@ -153,10 +153,10 @@ void __init imx51_soc_init(void) void __init imx51_init_late(void) { mx51_neon_fixup(); - imx51_pm_init(); + imx5_pm_init(); } void __init imx53_init_late(void) { - imx53_pm_init(); + imx5_pm_init(); } diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c index 82e79c658eb..58aeaf5baaf 100644 --- a/arch/arm/mach-imx/pm-imx5.c +++ b/arch/arm/mach-imx/pm-imx5.c @@ -169,14 +169,9 @@ static int __init imx5_pm_common_init(void) return imx5_cpuidle_init(); } -void __init imx51_pm_init(void) +void __init imx5_pm_init(void) { int ret = imx5_pm_common_init(); if (!ret) suspend_set_ops(&mx5_suspend_ops); } - -void __init imx53_pm_init(void) -{ - imx5_pm_common_init(); -} -- cgit v1.2.3-70-g09d2 From ddcb9aa65a759112ea3548c2adc473f0086a031e Mon Sep 17 00:00:00 2001 From: Peter Chen Date: Wed, 14 Aug 2013 11:40:56 +0800 Subject: ARM: imx: Move anatop related from board file to anatop driver Move anatop related (For USB) from board file to anatop driver Signed-off-by: Peter Chen Signed-off-by: Shawn Guo --- arch/arm/mach-imx/anatop.c | 4 +++- arch/arm/mach-imx/common.h | 1 - arch/arm/mach-imx/mach-imx6q.c | 5 ----- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'arch/arm/mach-imx/common.h') diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index 0cfa07dd9aa..ad3b755abb7 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c @@ -66,7 +66,7 @@ void imx_anatop_post_resume(void) imx_anatop_enable_weak2p5(false); } -void imx_anatop_usb_chrg_detect_disable(void) +static void imx_anatop_usb_chrg_detect_disable(void) { regmap_write(anatop, ANADIG_USB1_CHRG_DETECT, BM_ANADIG_USB_CHRG_DETECT_EN_B @@ -100,4 +100,6 @@ void __init imx_anatop_init(void) pr_err("%s: failed to find imx6q-anatop regmap!\n", __func__); return; } + + imx_anatop_usb_chrg_detect_disable(); } diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index cdc9288ac48..4517fd760bf 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -137,7 +137,6 @@ extern void imx_gpc_restore_all(void); extern void imx_anatop_init(void); extern void imx_anatop_pre_suspend(void); extern void imx_anatop_post_resume(void); -extern void imx_anatop_usb_chrg_detect_disable(void); extern u32 imx_anatop_get_digprog(void); extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode); extern void imx6q_set_chicken_bit(void); diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 9f06cc8789c..c730af67308 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -249,10 +249,6 @@ static void __init imx6q_1588_init(void) pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n"); } -static void __init imx6q_usb_init(void) -{ - imx_anatop_usb_chrg_detect_disable(); -} static void __init imx6q_init_machine(void) { @@ -268,7 +264,6 @@ static void __init imx6q_init_machine(void) imx_anatop_init(); imx6q_pm_init(); - imx6q_usb_init(); imx6q_1588_init(); } -- cgit v1.2.3-70-g09d2