[PATCH] mmc: sdhci: Setup HS modes based on HISPD bit

Michal Simek michal.simek at xilinx.com
Wed Jul 29 16:57:36 CEST 2020


There is no reason to setup HS modes by default without checking bit in
capability register.
Setting up HS mode by default breaks option to disable HS mode via
sdhci-caps-mask DT property.

Disabling HS mode can be done via DT as:
sdhci-caps-mask = <0 0x200000>;

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

 drivers/mmc/sdhci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 9af4de84dd6b..2119fdbae840 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -844,7 +844,10 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 	if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
 		cfg->voltages |= host->voltages;
 
-	cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
+	if (caps & SDHCI_CAN_DO_HISPD)
+		cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
+
+	cfg->host_caps |= MMC_MODE_4BIT;
 
 	/* Since Host Controller Version3.0 */
 	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
-- 
2.27.0



More information about the U-Boot mailing list