Skip to content

Commit

Permalink
MLK-12861-2 ARM: imx: enable necessary clock for RDC resume on i.mx7d
Browse files Browse the repository at this point in the history
When Mega/Fast Mix off in DSM mode, RDC recovery needs PCIe/PXP/EIM
clock to be enabled, otherwise, with M4 enabled, DSM resume will fail.

We only enable them before entering DSM and hardware will disable
them when DSM is entered and they will be re-enabled after resume,
then in low level resume phase, we will disable them again.

Signed-off-by: Anson Huang <[email protected]>
  • Loading branch information
Anson-Huang committed May 30, 2016
1 parent 02a2e8d commit e28ae27
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion arch/arm/mach-imx/pm-imx7.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

#define CCM_LPCG_START 0x4040
#define CCM_LPCG_STEP 0x10
#define CCM_EIM_LPCG 0x4160
#define CCM_PXP_LPCG 0x44c0
#define CCM_PCIE_LPCG 0x4600

#define BM_CCM_ROOT_POST_PODF 0x3f
Expand Down Expand Up @@ -715,11 +717,15 @@ static int imx7_pm_enter(suspend_state_t state)
imx_gpcv2_pre_suspend(true);
if (imx_gpcv2_is_mf_mix_off()) {
/*
* per design requirement, EXSC for PCIe/EIM
* per design requirement, EXSC for PCIe/EIM/PXP
* will need clock to recover RDC setting on
* resume, so enable PCIe/EIM LPCG for RDC
* recovery when M/F mix off
*/
writel_relaxed(0x3, pm_info->ccm_base.vbase +
CCM_EIM_LPCG);
writel_relaxed(0x3, pm_info->ccm_base.vbase +
CCM_PXP_LPCG);
writel_relaxed(0x3, pm_info->ccm_base.vbase +
CCM_PCIE_LPCG);
/* stop m4 if mix will also be shutdown */
Expand Down Expand Up @@ -759,6 +765,10 @@ static int imx7_pm_enter(suspend_state_t state)
}
if (imx_gpcv2_is_mf_mix_off() ||
imx7_pm_is_resume_from_lpsr()) {
writel_relaxed(0x0, pm_info->ccm_base.vbase +
CCM_EIM_LPCG);
writel_relaxed(0x0, pm_info->ccm_base.vbase +
CCM_PXP_LPCG);
writel_relaxed(0x0, pm_info->ccm_base.vbase +
CCM_PCIE_LPCG);
memcpy(ocram_base, ocram_saved_in_ddr, ocram_size);
Expand Down

0 comments on commit e28ae27

Please sign in to comment.