|
57 | 57 | #define CORE_FLL_CYCLE_CNT BIT(18)
|
58 | 58 | #define CORE_DLL_CLOCK_DISABLE BIT(21)
|
59 | 59 |
|
| 60 | +#define DLL_USR_CTL_POR_VAL 0x10800 |
| 61 | +#define ENABLE_DLL_LOCK_STATUS BIT(26) |
| 62 | +#define FINE_TUNE_MODE_EN BIT(27) |
| 63 | +#define BIAS_OK_SIGNAL BIT(29) |
| 64 | + |
60 | 65 | #define CORE_VENDOR_SPEC_POR_VAL 0xa9c
|
61 | 66 | #define CORE_CLK_PWRSAVE BIT(1)
|
62 | 67 | #define CORE_HC_MCLK_SEL_DFLT (2 << 8)
|
@@ -157,6 +162,7 @@ struct sdhci_msm_offset {
|
157 | 162 | u32 core_dll_config_3;
|
158 | 163 | u32 core_ddr_config_old; /* Applicable to sdcc minor ver < 0x49 */
|
159 | 164 | u32 core_ddr_config;
|
| 165 | + u32 core_dll_usr_ctl; /* Present on SDCC5.1 onwards */ |
160 | 166 | };
|
161 | 167 |
|
162 | 168 | static const struct sdhci_msm_offset sdhci_msm_v5_offset = {
|
@@ -186,6 +192,7 @@ static const struct sdhci_msm_offset sdhci_msm_v5_offset = {
|
186 | 192 | .core_dll_config_2 = 0x254,
|
187 | 193 | .core_dll_config_3 = 0x258,
|
188 | 194 | .core_ddr_config = 0x25c,
|
| 195 | + .core_dll_usr_ctl = 0x388, |
189 | 196 | };
|
190 | 197 |
|
191 | 198 | static const struct sdhci_msm_offset sdhci_msm_mci_offset = {
|
@@ -231,6 +238,7 @@ struct sdhci_msm_variant_ops {
|
231 | 238 | struct sdhci_msm_variant_info {
|
232 | 239 | bool mci_removed;
|
233 | 240 | bool restore_dll_config;
|
| 241 | + bool uses_tassadar_dll; |
234 | 242 | const struct sdhci_msm_variant_ops *var_ops;
|
235 | 243 | const struct sdhci_msm_offset *offset;
|
236 | 244 | };
|
@@ -263,6 +271,7 @@ struct sdhci_msm_host {
|
263 | 271 | bool use_cdr;
|
264 | 272 | u32 transfer_mode;
|
265 | 273 | bool updated_ddr_cfg;
|
| 274 | + bool uses_tassadar_dll; |
266 | 275 | };
|
267 | 276 |
|
268 | 277 | static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
|
@@ -677,6 +686,17 @@ static int msm_init_cm_dll(struct sdhci_host *host)
|
677 | 686 | msm_offset->core_dll_config_2);
|
678 | 687 | }
|
679 | 688 |
|
| 689 | + /* |
| 690 | + * Configure DLL user control register to enable DLL status. |
| 691 | + * This setting is applicable to SDCC v5.1 onwards only. |
| 692 | + */ |
| 693 | + if (msm_host->uses_tassadar_dll) { |
| 694 | + config = DLL_USR_CTL_POR_VAL | FINE_TUNE_MODE_EN | |
| 695 | + ENABLE_DLL_LOCK_STATUS | BIAS_OK_SIGNAL; |
| 696 | + writel_relaxed(config, host->ioaddr + |
| 697 | + msm_offset->core_dll_usr_ctl); |
| 698 | + } |
| 699 | + |
680 | 700 | config = readl_relaxed(host->ioaddr +
|
681 | 701 | msm_offset->core_dll_config);
|
682 | 702 | config |= CORE_DLL_EN;
|
@@ -1861,10 +1881,18 @@ static const struct sdhci_msm_variant_info sdm845_sdhci_var = {
|
1861 | 1881 | .offset = &sdhci_msm_v5_offset,
|
1862 | 1882 | };
|
1863 | 1883 |
|
| 1884 | +static const struct sdhci_msm_variant_info sm8250_sdhci_var = { |
| 1885 | + .mci_removed = true, |
| 1886 | + .uses_tassadar_dll = true, |
| 1887 | + .var_ops = &v5_var_ops, |
| 1888 | + .offset = &sdhci_msm_v5_offset, |
| 1889 | +}; |
| 1890 | + |
1864 | 1891 | static const struct of_device_id sdhci_msm_dt_match[] = {
|
1865 | 1892 | {.compatible = "qcom,sdhci-msm-v4", .data = &sdhci_msm_mci_var},
|
1866 | 1893 | {.compatible = "qcom,sdhci-msm-v5", .data = &sdhci_msm_v5_var},
|
1867 | 1894 | {.compatible = "qcom,sdm845-sdhci", .data = &sdm845_sdhci_var},
|
| 1895 | + {.compatible = "qcom,sm8250-sdhci", .data = &sm8250_sdhci_var}, |
1868 | 1896 | {},
|
1869 | 1897 | };
|
1870 | 1898 |
|
@@ -1930,6 +1958,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
|
1930 | 1958 | msm_host->restore_dll_config = var_info->restore_dll_config;
|
1931 | 1959 | msm_host->var_ops = var_info->var_ops;
|
1932 | 1960 | msm_host->offset = var_info->offset;
|
| 1961 | + msm_host->uses_tassadar_dll = var_info->uses_tassadar_dll; |
1933 | 1962 |
|
1934 | 1963 | msm_offset = msm_host->offset;
|
1935 | 1964 |
|
|
0 commit comments