From patchwork Mon Jan 20 10:20:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 239798 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Mon, 20 Jan 2020 19:20:27 +0900 Subject: [RFC 2/4] mmc: sdhci: add quriks relevant to broken SDMA In-Reply-To: <20200120102029.14264-1-jh80.chung@samsung.com> References: <20200120102029.14264-1-jh80.chung@samsung.com> Message-ID: <20200120102029.14264-3-jh80.chung@samsung.com> 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 --- 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;