Skip to contentSkip to conversation

mmc: sdhci: Setup HS modes based on HISPD bit

PATCH New Michal Simek 2 participants 3 messages Jul 29, 2020 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: Setup HS modes based on HISPD bit

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>;

---

 drivers/mmc/sdhci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mmc/sdhci.c +4 -1
index 9af4de84dd6b..2119fdbae840 100644
@@ -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) {
Signature · 1 line
2.27.0
#1 lore raw

PATCH 1/1 mmc: sdhci: Setup HS modes based on HISPD bit

Hi,

Quoted 11 lines · Michal Simek

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>;

---

I've already posted this fix here:
https://patchwork.ozlabs.org/project/uboot/patch/20200723041219.2438-1-faiz_abbas at ti.com/

Thanks,
Faiz

#2 lore raw

PATCH 1/1 mmc: sdhci: Setup HS modes based on HISPD bit

Quoted 11 lines · Faiz Abbas

Hi,

Quoted 8 lines · Michal Simek

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>;

Quoted 6 lines
Quoted 3 lines

---

I've already posted this fix here:
https://patchwork.ozlabs.org/project/uboot/patch/20200723041219.2438-1-faiz_abbas at ti.com/

Wonderful. Please ignore this patch and take Faiz one.

Thanks,
Michal