[RFC 2/4] mmc: sdhci: add quriks relevant to broken SDMA

Jaehoon Chung jh80.chung at samsung.com
Mon Jan 20 11:20:27 CET 2020


ADd quirks relevant to broken SDMA.
If set to SDHCI_QUIRK_BROKEN_SDMA, it should be run the pio mode.

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
---
 drivers/mmc/sdhci.c | 10 ++++++++--
 include/sdhci.h     |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 01fa5a9d4d..acda997fbc 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -728,12 +728,18 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 
 #ifdef CONFIG_MMC_SDHCI_SDMA
 	if (!(caps & SDHCI_CAN_DO_SDMA)) {
-		printf("%s: Your controller doesn't support SDMA!!\n",
+		if (host->quirks & SDHCI_QUIRK_BROKEN_SDMA) {
+			caps &= ~SDHCI_CAN_DO_SDMA;
+			goto skip;
+		} else {
+			printf("%s: Your controller doesn't support SDMA!!\n",
 		       __func__);
-		return -EINVAL;
+			return -EINVAL;
+		}
 	}
 
 	host->flags |= USE_SDMA;
+skip:
 #endif
 #if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
 	if (!(caps & SDHCI_CAN_DO_ADMA2)) {
diff --git a/include/sdhci.h b/include/sdhci.h
index 01addb7a60..9865a9d6c8 100644
--- a/include/sdhci.h
+++ b/include/sdhci.h
@@ -243,6 +243,7 @@
 #define SDHCI_QUIRK_WAIT_SEND_CMD	(1 << 6)
 #define SDHCI_QUIRK_USE_WIDE8		(1 << 8)
 #define SDHCI_QUIRK_NO_1_8_V		(1 << 9)
+#define SDHCI_QUIRK_BROKEN_SDMA		(1 << 10)
 
 /* to make gcc happy */
 struct sdhci_host;
-- 
2.25.0



More information about the U-Boot mailing list