platform: msm_shared: Disable dynamic DLL phase shift
CDR (clock-data recovery) enable automatically adjusts
the sampling point based on voltage/temperature variations.
This must be enabled for only read and disabled for write.
CRs-Fixed: 691777
Change-Id: Ic26fb13c1eeb3b2f9ef6ebfe69e83697ca9f0fc1
diff --git a/platform/msm_shared/sdhci_msm.c b/platform/msm_shared/sdhci_msm.c
index 25b47e4..7554016 100644
--- a/platform/msm_shared/sdhci_msm.c
+++ b/platform/msm_shared/sdhci_msm.c
@@ -301,6 +301,24 @@
return 0;
}
+void sdhci_msm_toggle_cdr(struct sdhci_host *host, bool enable)
+{
+ uint32_t core_cfg;
+
+ core_cfg = REG_READ32(host, SDCC_DLL_CONFIG_REG);
+
+ if (enable)
+ {
+ core_cfg |= SDCC_DLL_CDR_EN;
+ }
+ else
+ {
+ core_cfg &= ~SDCC_DLL_CDR_EN;
+ }
+
+ REG_WRITE32(host, core_cfg, SDCC_DLL_CONFIG_REG);
+}
+
/* Configure DLL with delay value based on 'phase' */
static uint32_t sdhci_msm_config_dll(struct sdhci_host *host, uint32_t phase)
{