Skip to contentSkip to conversation

ARM: mach-imx: Select ARM_CPU_SUSPEND at ARCH_MXC level

PATCH New Fabio Estevam 2 participants 3 messages Jul 26, 2013 – Jul 30, 2013

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ARM: mach-imx: Select ARM_CPU_SUSPEND at ARCH_MXC level

From: Fabio Estevam <[email protected]>

Instead of selecting ARM_CPU_SUSPEND only for mx6, we can select it for all SoCs from the ARCH_MXC family.

---
 arch/arm/mach-imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/Kconfig +1 -1
index bb1cc9e..1cc219f 100644
@@ -1,5 +1,6 @@
 config ARCH_MXC
 	bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
+	select ARM_CPU_SUSPEND if PM
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_PATCH_PHYS_VIRT
 	select AUTO_ZRELADDR if !ZBOOT_ROM
@@ -786,7 +787,6 @@ config SOC_IMX6Q
 	bool "i.MX6 Quad/DualLite support"
 	select ARCH_HAS_CPUFREQ
 	select ARCH_HAS_OPP
-	select ARM_CPU_SUSPEND if PM
 	select ARM_ERRATA_754322
 	select ARM_ERRATA_764369 if SMP
 	select ARM_ERRATA_775420
Signature · 1 line
1.8.1.2
author reviewer
#1 lore raw

PATCH 2/2 ARM: mx53: Allow suspend/resume

From: Fabio Estevam <[email protected]>

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 at 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 at freescale /$

---
 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(-)
arch/arm/mach-imx/common.h +2 -4
index b96aff7..cdc9288 100644
@@ -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
arch/arm/mach-imx/mm-imx5.c +2 -2
index cf193d8..a8229b7 100644
@@ -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();
 }
arch/arm/mach-imx/pm-imx5.c +1 -6
index 82e79c6..58aeaf5 100644
@@ -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();
-}
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 1/2 ARM: mach-imx: Select ARM_CPU_SUSPEND at ARCH_MXC level

In reply to Fabio Estevam
Quoted 15 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Instead of selecting ARM_CPU_SUSPEND only for mx6, we can select it for all SoCs from the ARCH_MXC family.

---
 arch/arm/mach-imx/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/Kconfig +0 -0
index bb1cc9e..1cc219f 100644

arch/arm/mach-imx/Kconfig line 3

Quoted 3 lines
arch/arm/mach-imx/Kconfig +1 -0
@@ -1,5 +1,6 @@
 config ARCH_MXC
 	bool "Freescale i.MX family" if ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7
+	select ARM_CPU_SUSPEND if PM

This should be put after ARCH_REQUIRE_GPIOLIB line. I fixed it up and applied both patches.

Shawn

Quoted 3 lines
arch/arm/mach-imx/Kconfig +0 -0
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_PATCH_PHYS_VIRT
 	select AUTO_ZRELADDR if !ZBOOT_ROM