Commit 03591160 authored by Sarthak Garg's avatar Sarthak Garg Committed by Ulf Hansson

mmc: sdhci-msm: Read and use DLL Config property from device tree file

Certain platforms require different settings in the
SDCC_HC_REG_DLL_CONFIG register. This setting can change from platform
to platform. So the driver should check whether a particular platform
require a different setting by reading the DT file and use it.

Also use msm_cm_dll_set_freq only when DLL not supplied.
Signed-off-by: default avatarBao D. Nguyen <nguyenb@codeaurora.org>
Signed-off-by: default avatarSarthak Garg <sartgarg@codeaurora.org>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1590139950-7288-7-git-send-email-sartgarg@codeaurora.orgSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 1dfbe3ff
...@@ -275,6 +275,7 @@ struct sdhci_msm_host { ...@@ -275,6 +275,7 @@ struct sdhci_msm_host {
u32 transfer_mode; u32 transfer_mode;
bool updated_ddr_cfg; bool updated_ddr_cfg;
bool uses_tassadar_dll; bool uses_tassadar_dll;
u32 dll_config;
u32 ddr_config; u32 ddr_config;
}; };
...@@ -617,6 +618,9 @@ static int msm_init_cm_dll(struct sdhci_host *host) ...@@ -617,6 +618,9 @@ static int msm_init_cm_dll(struct sdhci_host *host)
config &= ~CORE_CLK_PWRSAVE; config &= ~CORE_CLK_PWRSAVE;
writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec); writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec);
config = msm_host->dll_config;
writel_relaxed(config, host->ioaddr + msm_offset->core_dll_config);
if (msm_host->use_14lpp_dll_reset) { if (msm_host->use_14lpp_dll_reset) {
config = readl_relaxed(host->ioaddr + config = readl_relaxed(host->ioaddr +
msm_offset->core_dll_config); msm_offset->core_dll_config);
...@@ -642,6 +646,8 @@ static int msm_init_cm_dll(struct sdhci_host *host) ...@@ -642,6 +646,8 @@ static int msm_init_cm_dll(struct sdhci_host *host)
config |= CORE_DLL_PDN; config |= CORE_DLL_PDN;
writel_relaxed(config, host->ioaddr + writel_relaxed(config, host->ioaddr +
msm_offset->core_dll_config); msm_offset->core_dll_config);
if (!msm_host->dll_config)
msm_cm_dll_set_freq(host); msm_cm_dll_set_freq(host);
if (msm_host->use_14lpp_dll_reset && if (msm_host->use_14lpp_dll_reset &&
...@@ -682,6 +688,7 @@ static int msm_init_cm_dll(struct sdhci_host *host) ...@@ -682,6 +688,7 @@ static int msm_init_cm_dll(struct sdhci_host *host)
msm_offset->core_dll_config); msm_offset->core_dll_config);
if (msm_host->use_14lpp_dll_reset) { if (msm_host->use_14lpp_dll_reset) {
if (!msm_host->dll_config)
msm_cm_dll_set_freq(host); msm_cm_dll_set_freq(host);
config = readl_relaxed(host->ioaddr + config = readl_relaxed(host->ioaddr +
msm_offset->core_dll_config_2); msm_offset->core_dll_config_2);
...@@ -1944,6 +1951,8 @@ static inline void sdhci_msm_get_of_property(struct platform_device *pdev, ...@@ -1944,6 +1951,8 @@ static inline void sdhci_msm_get_of_property(struct platform_device *pdev,
if (of_property_read_u32(node, "qcom,ddr-config", if (of_property_read_u32(node, "qcom,ddr-config",
&msm_host->ddr_config)) &msm_host->ddr_config))
msm_host->ddr_config = DDR_CONFIG_POR_VAL; msm_host->ddr_config = DDR_CONFIG_POR_VAL;
of_property_read_u32(node, "qcom,dll-config", &msm_host->dll_config);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment