summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2015-12-12 10:07:31 +0100
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-01-27 11:03:29 +0200
commit478ca48af680aed84b53205d3926e4e830895500 (patch)
treec6b0c70ccba1fe737a33243bffa9d33f6fa10487 /arch/arm/mach-imx
parentb8e3f80727633845438f3df4ed17381c4088f295 (diff)
pm-imx6.c: fix power off by stop mode
With the 3.14.28 release of the kernel imx6_stop_mode_poweroff() does not enter stop mode. Thus the function does not switch of power but returns. This seems to be caused by the second processor which has been stopped. Set the WFI event mask for the stopped processor works around the issue. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry-picked from commit 2acff0eaece38533e85e08431e7ae9f3027c677a) (cherry picked from commit 894914718e9e563eb601e0090e1ae2ddadf426a9) (cherry picked from commit 8f6f5d08f22518078a41b1d87db7d4aecfc2d275)
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r--arch/arm/mach-imx/pm-imx6.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index c67aa5183165..91e7b4aee115 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -1277,7 +1277,22 @@ void __init imx6_pm_ccm_init(const char *ccm_compat)
void imx6_stop_mode_poweroff(void)
{
- imx6_set_lpm(STOP_POWER_OFF);
+ /* compare with imx6q_set_lpm */
+ 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;
+ val |= 0x2 << BP_CLPCR_LPM;
+ val |= 0x3 << BP_CLPCR_STBY_COUNT;
+ val |= BM_CLPCR_VSTBY;
+ val |= BM_CLPCR_SBYOS;
+ val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
+
+ imx_gpc_hwirq_unmask(0);
+ writel_relaxed(val, ccm_base + CLPCR);
+ imx_gpc_hwirq_mask(0);
+ imx_gpc_mask_all();
cpu_do_idle();
}