diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2017-03-28 16:11:05 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2018-12-24 01:27:28 +0100 |
commit | c286f6f6696f0ebf64499b1afa474d75e9b25304 (patch) | |
tree | 67419aa41cd78922345e12d8a6fb32c0bcb07562 | |
parent | 908531b042624ea8a8156f0770814e111638322a (diff) |
apalis-imx6: use stopmode for poweroff
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
(cherry picked from commit 051ee1a1c24058db62f10a177b1271daebbd2ebe)
-rw-r--r-- | arch/arm/mach-imx/pm-imx6.c | 22 | ||||
-rw-r--r-- | drivers/power/reset/imx-snvs-poweroff.c | 10 |
2 files changed, 28 insertions, 4 deletions
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 0707b2a47497..5e102e736afa 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -1296,8 +1296,15 @@ void imx6_stop_mode_poweroff(void) u32 val = readl_relaxed(ccm_base + CLPCR); val &= ~BM_CLPCR_LPM; - /* mask the stopped processor, otherwise we will not enter stop mode */ - val |= smp_processor_id() ? BM_CLPCR_MASK_CORE0_WFI : BM_CLPCR_MASK_CORE1_WFI; + /* + * mask all but the currently running processor, + * otherwise we will not enter stop mode + */ + val |= smp_processor_id() != 0 ? BM_CLPCR_MASK_CORE0_WFI : 0; + val |= smp_processor_id() != 1 ? BM_CLPCR_MASK_CORE1_WFI : 0; + val |= smp_processor_id() != 2 ? BM_CLPCR_MASK_CORE2_WFI : 0; + val |= smp_processor_id() != 3 ? BM_CLPCR_MASK_CORE3_WFI : 0; + val |= BM_CLPCR_MASK_SCU_IDLE; val |= 0x2 << BP_CLPCR_LPM; val |= 0x3 << BP_CLPCR_STBY_COUNT; val |= BM_CLPCR_VSTBY; @@ -1317,6 +1324,15 @@ void __init imx6q_pm_init(void) imx6_pm_common_init(&imx6q_lpddr2_pm_data); else imx6_pm_common_init(&imx6q_pm_data); +#ifndef CONFIG_POWER_RESET_GPIO + /* + * if no specific power off function in board file, power off system by + * stop mode + */ + if (!pm_power_off) + if (of_machine_is_compatible("toradex,apalis_imx6q")) + pm_power_off = imx6_stop_mode_poweroff; +#endif } void __init imx6dl_pm_init(void) @@ -1326,7 +1342,7 @@ void __init imx6dl_pm_init(void) #ifndef CONFIG_POWER_RESET_GPIO /* * if no specific power off function in board file, power off system by - * SNVS + * stop mode */ if (!pm_power_off) if (of_machine_is_compatible("toradex,colibri_imx6dl")) diff --git a/drivers/power/reset/imx-snvs-poweroff.c b/drivers/power/reset/imx-snvs-poweroff.c index 03447e08ffc4..525f8cb397a7 100644 --- a/drivers/power/reset/imx-snvs-poweroff.c +++ b/drivers/power/reset/imx-snvs-poweroff.c @@ -41,8 +41,16 @@ static int imx_poweroff_probe(struct platform_device *pdev) return -ENODEV; } - if (!of_machine_is_compatible("toradex,colibri_imx6dl")) + /* + * The Apalis/Colibri iMX6 modules cannot use PMIC_ON_REQ to shutdown + * the PMIC or the module could only be restarted by power cycling + * if the SNVS is supplied by a backup battery. + * compare with pm-imx6.c, imx6_stop_mode_poweroff() + */ + if (!of_machine_is_compatible("toradex,colibri_imx6dl") && + !of_machine_is_compatible("toradex,apalis_imx6q")) pm_power_off = do_imx_poweroff; + return 0; } |