diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-01-30 18:04:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-02-03 09:16:10 +0100 |
commit | afe89f86c70cde193e1fa989301900ce07aac9d9 (patch) | |
tree | bd046a70ef47b8930a1e6d648fad581c2b6b8ad1 | |
parent | 88d2f57064e46854ceecede4093fc504597f3c9d (diff) | |
download | barebox-afe89f86c70cde193e1fa989301900ce07aac9d9.tar.gz barebox-afe89f86c70cde193e1fa989301900ce07aac9d9.tar.xz |
mci: stm32_sdmmc2: compare ios ->bus_width with correct constants
MMC_BUS_WIDTH_4 != 4 && MMC_BUS_WIDTH_8 != 8.
This enables driver support for 4-bit SD-Cards and 8-bit MMCs,
which before was disabled because of CRC errors:
ERROR: error SDMMC_STA_DCRCFAIL (0x81042) for cmd 18
ERROR: stm32_sdmmc2_end_cmd: error SDMMC_STA_CTIMEOUT (0x4) for cmd 12
These happened because the card was correctly instructed to use the new
bus width, but the controller wasn't.
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Fixes: ce99d0c86b32ec ("mci: add support for stm32mp sd/mmc controller")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mci/stm32_sdmmc2.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c index 7f22a90668..fdd0e7858f 100644 --- a/drivers/mci/stm32_sdmmc2.c +++ b/drivers/mci/stm32_sdmmc2.c @@ -574,9 +574,9 @@ static void stm32_sdmmc2_set_ios(struct mci_host *mci, struct mci_ios *ios) clk = SDMMC_CLKCR_CLKDIV_MAX; } - if (mci->bus_width == 4) + if (mci->bus_width == MMC_BUS_WIDTH_4) clk |= SDMMC_CLKCR_WIDBUS_4; - if (mci->bus_width == 8) + if (mci->bus_width == MMC_BUS_WIDTH_8) clk |= SDMMC_CLKCR_WIDBUS_8; writel(clk | priv->clk_reg_msk | SDMMC_CLKCR_HWFC_EN, @@ -631,11 +631,6 @@ static int stm32_sdmmc2_probe(struct amba_device *adev, mci_of_parse(&priv->mci); - if (mci->host_caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) { - dev_notice(dev, "Fixing bus-width to 1 due to driver limitation\n"); - mci->host_caps &= ~(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA); - } - return mci_register(&priv->mci); priv_free: |