Skip to content

Commit 04816e6

Browse files
Sarthak Gargstorulf
authored andcommitted
mmc: sdhci-msm: Update dll_config_3 as per HSR
Update dll_config_3 as per the host clock frequency as specified in the DLL Hardware Reference Guide. 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 5c30f34 commit 04816e6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/mmc/host/sdhci-msm.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
#define FINE_TUNE_MODE_EN BIT(27)
6363
#define BIAS_OK_SIGNAL BIT(29)
6464

65+
#define DLL_CONFIG_3_LOW_FREQ_VAL 0x08
66+
#define DLL_CONFIG_3_HIGH_FREQ_VAL 0x10
67+
6568
#define CORE_VENDOR_SPEC_POR_VAL 0xa9c
6669
#define CORE_CLK_PWRSAVE BIT(1)
6770
#define CORE_HC_MCLK_SEL_DFLT (2 << 8)
@@ -695,6 +698,16 @@ static int msm_init_cm_dll(struct sdhci_host *host)
695698
ENABLE_DLL_LOCK_STATUS | BIAS_OK_SIGNAL;
696699
writel_relaxed(config, host->ioaddr +
697700
msm_offset->core_dll_usr_ctl);
701+
702+
config = readl_relaxed(host->ioaddr +
703+
msm_offset->core_dll_config_3);
704+
config &= ~0xFF;
705+
if (msm_host->clk_rate < 150000000)
706+
config |= DLL_CONFIG_3_LOW_FREQ_VAL;
707+
else
708+
config |= DLL_CONFIG_3_HIGH_FREQ_VAL;
709+
writel_relaxed(config, host->ioaddr +
710+
msm_offset->core_dll_config_3);
698711
}
699712

700713
config = readl_relaxed(host->ioaddr +

0 commit comments

Comments
 (0)