mmc: sdhci: add quriks relevant to broken SDMA 25/222825/2
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 20 Jan 2020 09:47:35 +0000 (18:47 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 20 Jan 2020 21:45:52 +0000 (06:45 +0900)
ADd quirks relevant to broken SDMA.
If set to SDHCI_QUIRK_BROKEN_SDMA, it should be run the pio mode.

Change-Id: Iddae84fea4d1de0301b9afd45f9f55d7d3f8de74
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/sdhci.c
include/sdhci.h

index 81f2f35dda601f4ba2c4e591bd48de5a40c62543..bb2bcd47021fe719850b6639c2639c199572e0d5 100644 (file)
@@ -729,16 +729,22 @@ 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)) {
-               printf("%s: Your controller doesn't support SDMA!!\n",
+               debug("%s: Your controller doesn't support SDMA!!\n",
                       __func__);
                return -EINVAL;
        }
index 01addb7a6036585606179a2257dca0233475b67d..9865a9d6c8ad08d334a868fe3b7652842ce01e4c 100644 (file)
 #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;