Skip to content

Commit 0359116

Browse files
Sarthak Gargstorulf
authored andcommitted
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: Bao D. Nguyen <[email protected]> Signed-off-by: Sarthak Garg <[email protected]> Acked-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 1dfbe3f commit 0359116

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/mmc/host/sdhci-msm.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ struct sdhci_msm_host {
275275
u32 transfer_mode;
276276
bool updated_ddr_cfg;
277277
bool uses_tassadar_dll;
278+
u32 dll_config;
278279
u32 ddr_config;
279280
};
280281

@@ -617,6 +618,9 @@ static int msm_init_cm_dll(struct sdhci_host *host)
617618
config &= ~CORE_CLK_PWRSAVE;
618619
writel_relaxed(config, host->ioaddr + msm_offset->core_vendor_spec);
619620

621+
config = msm_host->dll_config;
622+
writel_relaxed(config, host->ioaddr + msm_offset->core_dll_config);
623+
620624
if (msm_host->use_14lpp_dll_reset) {
621625
config = readl_relaxed(host->ioaddr +
622626
msm_offset->core_dll_config);
@@ -642,7 +646,9 @@ static int msm_init_cm_dll(struct sdhci_host *host)
642646
config |= CORE_DLL_PDN;
643647
writel_relaxed(config, host->ioaddr +
644648
msm_offset->core_dll_config);
645-
msm_cm_dll_set_freq(host);
649+
650+
if (!msm_host->dll_config)
651+
msm_cm_dll_set_freq(host);
646652

647653
if (msm_host->use_14lpp_dll_reset &&
648654
!IS_ERR_OR_NULL(msm_host->xo_clk)) {
@@ -682,7 +688,8 @@ static int msm_init_cm_dll(struct sdhci_host *host)
682688
msm_offset->core_dll_config);
683689

684690
if (msm_host->use_14lpp_dll_reset) {
685-
msm_cm_dll_set_freq(host);
691+
if (!msm_host->dll_config)
692+
msm_cm_dll_set_freq(host);
686693
config = readl_relaxed(host->ioaddr +
687694
msm_offset->core_dll_config_2);
688695
config &= ~CORE_DLL_CLOCK_DISABLE;
@@ -1944,6 +1951,8 @@ static inline void sdhci_msm_get_of_property(struct platform_device *pdev,
19441951
if (of_property_read_u32(node, "qcom,ddr-config",
19451952
&msm_host->ddr_config))
19461953
msm_host->ddr_config = DDR_CONFIG_POR_VAL;
1954+
1955+
of_property_read_u32(node, "qcom,dll-config", &msm_host->dll_config);
19471956
}
19481957

19491958

0 commit comments

Comments
 (0)