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

mmc: sdhci_am654: Disable HS400 for AM62P SR1.0 and SR1.1

This adds SDHCI_AM654_QUIRK_DISABLE_HS400 quirk which shall be used
to disable HS400 support. AM62P SR1.0 and SR1.1 do not support HS400
due to errata i2458 [0] so disable HS400 for these SoC revisions.

[0] https://www.ti.com/lit/er/sprz574a/sprz574a.pdf
Fixes: 37f28165518f ("arm64: dts: ti: k3-am62p: Add ITAP/OTAP values for MMC")
Cc: stable@vger.kernel.org
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250820193047.4064142-1-jm@ti.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Judith Mendez and committed by
Ulf Hansson
d2d7a96b 99d7ab8d

+18
+18
drivers/mmc/host/sdhci_am654.c
··· 156 156 157 157 #define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0) 158 158 #define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1) 159 + #define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2) 159 160 }; 160 161 161 162 struct window { ··· 766 765 { 767 766 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 768 767 struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host); 768 + struct device *dev = mmc_dev(host->mmc); 769 769 u32 ctl_cfg_2 = 0; 770 770 u32 mask; 771 771 u32 val; ··· 821 819 ret = sdhci_am654_get_otap_delay(host, sdhci_am654); 822 820 if (ret) 823 821 goto err_cleanup_host; 822 + 823 + if (sdhci_am654->quirks & SDHCI_AM654_QUIRK_DISABLE_HS400 && 824 + host->mmc->caps2 & (MMC_CAP2_HS400 | MMC_CAP2_HS400_ES)) { 825 + dev_info(dev, "HS400 mode not supported on this silicon revision, disabling it\n"); 826 + host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES); 827 + } 824 828 825 829 ret = __sdhci_add_host(host); 826 830 if (ret) ··· 890 882 891 883 return 0; 892 884 } 885 + 886 + static const struct soc_device_attribute sdhci_am654_descope_hs400[] = { 887 + { .family = "AM62PX", .revision = "SR1.0" }, 888 + { .family = "AM62PX", .revision = "SR1.1" }, 889 + { /* sentinel */ } 890 + }; 893 891 894 892 static const struct of_device_id sdhci_am654_of_match[] = { 895 893 { ··· 983 969 ret = mmc_of_parse(host->mmc); 984 970 if (ret) 985 971 return dev_err_probe(dev, ret, "parsing dt failed\n"); 972 + 973 + soc = soc_device_match(sdhci_am654_descope_hs400); 974 + if (soc) 975 + sdhci_am654->quirks |= SDHCI_AM654_QUIRK_DISABLE_HS400; 986 976 987 977 host->mmc_host_ops.start_signal_voltage_switch = sdhci_am654_start_signal_voltage_switch; 988 978 host->mmc_host_ops.execute_tuning = sdhci_am654_execute_tuning;