Skip to content

Commit 219c02c

Browse files
Ritesh HarjaniUlf Hansson
authored andcommitted
mmc: sdhci-msm: Don't enable PWRSAVE_DLL for certain sdhc hosts
SDHC core with new 14lpp and later tech DLL should not enable PWRSAVE_DLL since such controller's internal gating cannot meet following MCLK requirement: When MCLK is gated OFF, it is not gated for less than 0.5us and MCLK must be switched on for at-least 1us before DATA starts coming. Adding support for this requirement. Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org> Reviewed-by: Can Guo <cang@codeaurora.org> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1581077075-26011-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 2a2b821 commit 219c02c

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

‎drivers/mmc/host/sdhci-msm.c‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -977,9 +977,21 @@ static int sdhci_msm_cm_dll_sdc4_calibration(struct sdhci_host *host)
977977
goto out;
978978
}
979979

980-
config = readl_relaxed(host->ioaddr + msm_offset->core_vendor_spec3);
981-
config |= CORE_PWRSAVE_DLL;
982-
writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec3);
980+
/*
981+
* Set CORE_PWRSAVE_DLL bit in CORE_VENDOR_SPEC3.
982+
* When MCLK is gated OFF, it is not gated for less than 0.5us
983+
* and MCLK must be switched on for at-least 1us before DATA
984+
* starts coming. Controllers with 14lpp and later tech DLL cannot
985+
* guarantee above requirement. So PWRSAVE_DLL should not be
986+
* turned on for host controllers using this DLL.
987+
*/
988+
if (!msm_host->use_14lpp_dll_reset) {
989+
config = readl_relaxed(host->ioaddr +
990+
msm_offset->core_vendor_spec3);
991+
config |= CORE_PWRSAVE_DLL;
992+
writel_relaxed(config, host->ioaddr +
993+
msm_offset->core_vendor_spec3);
994+
}
983995

984996
/*
985997
* Drain writebuffer to ensure above DLL calibration

0 commit comments

Comments
 (0)