[U-Boot] [PATCH] mmc: sdhci: Read capabilities register before updating host caps

Прокопенко Тимур Низамович tprokopenko at elvees.com
Thu Apr 25 09:05:22 UTC 2019


From: Timur Prokopenko <tprokopenko at elvees.com>

Date: Thu, 4 Apr 2019 11:05:05 +0300

Subject: [U-Boot] [PATCH] mmc: sdhci: Read capabilities register and update host caps

U-Boot doesn't analyze SDHCI capabilities register while choosing
speed mode and sets HS mode unconditionally which is incorrect.
This patch checks the capabilities register and sets the host caps
accordingly.

Signed-off-by: Timur Prokopenko <tprokopenko at elvees.com>
---
drivers/mmc/sdhci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index cdeba914f9..66a752add0 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -628,7 +628,9 @@ 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;
+ cfg->host_caps |= MMC_MODE_4BIT;
+ if (caps & SDHCI_CAN_DO_HISPD)
+ cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;

/* Since Host Controller Version3.0 */
if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {


More information about the U-Boot mailing list