Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mmc: sdhci_am654: Add sdhci_am654_start_signal_voltage_switch

The sdhci_start_signal_voltage_switch function sets
V1P8_SIGNAL_ENA by default after switching to 1v8 signaling.
V1P8_SIGNAL_ENA determines whether to launch cmd/data on neg
edge or pos edge of clock.

Due to some eMMC and SD failures seen across am62x platform,
do not set V1P8_SIGNAL_ENA by default, only enable the bit
for devices that require this bit in order to switch to 1v8
voltage for uhs modes.

Signed-off-by: Judith Mendez <jm@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20240913185403.1339115-1-jm@ti.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Judith Mendez and committed by
Ulf Hansson
941a7abd cd068d51

+30
+30
drivers/mmc/host/sdhci_am654.c
··· 155 155 u32 tuning_loop; 156 156 157 157 #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0) 158 + #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1) 158 159 }; 159 160 160 161 struct window { ··· 355 354 sdhci_am654->clkbuf_sel); 356 355 357 356 sdhci_set_clock(host, clock); 357 + } 358 + 359 + static int sdhci_am654_start_signal_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) 360 + { 361 + struct sdhci_host *host = mmc_priv(mmc); 362 + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 363 + struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); 364 + int ret; 365 + 366 + if ((sdhci_am654->quirks & SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA) && 367 + ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) { 368 + if (!IS_ERR(mmc->supply.vqmmc)) { 369 + ret = mmc_regulator_set_vqmmc(mmc, ios); 370 + if (ret < 0) { 371 + pr_err("%s: Switching to 1.8V signalling voltage failed,\n", 372 + mmc_hostname(mmc)); 373 + return -EIO; 374 + } 375 + } 376 + return 0; 377 + } 378 + 379 + return sdhci_start_signal_voltage_switch(mmc, ios); 358 380 } 359 381 360 382 static u8 sdhci_am654_write_power_on(struct sdhci_host *host, u8 val, int reg) ··· 868 844 if (device_property_read_bool(dev, "ti,fails-without-test-cd")) 869 845 sdhci_am654->quirks |= SDHCI_AM654_QUIRK_FORCE_CDTEST; 870 846 847 + /* Suppress v1p8 ena for eMMC and SD with vqmmc supply */ 848 + if (!!of_parse_phandle(dev->of_node, "vmmc-supply", 0) == 849 + !!of_parse_phandle(dev->of_node, "vqmmc-supply", 0)) 850 + sdhci_am654->quirks |= SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA; 851 + 871 852 sdhci_get_of_property(pdev); 872 853 873 854 return 0; ··· 969 940 goto err_pltfm_free; 970 941 } 971 942 943 + host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch; 972 944 host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning; 973 945 974 946 pm_runtime_get_noresume(dev);