diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index f8347f0c52..6d7cfdfd45 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -581,6 +581,7 @@ static int dwmci_init(struct mmc *mmc) { struct dwmci_host *host = mmc->priv; uint32_t use_dma; + uint32_t verid; if (host->board_init) host->board_init(host); @@ -595,6 +596,10 @@ static int dwmci_init(struct mmc *mmc) dwmci_writel(host, DWMCI_PWREN, 1); #endif + verid = dwmci_readl(host, DWMCI_VERID) & 0x0000ffff; + if (verid >= DW_MMC_240A) + dwmci_writel(host, DWMCI_CARDTHRCTL, DWMCI_CDTHRCTRL_CONFIG); + if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) { debug("%s[%d] Fail-reset!!\n", __func__, __LINE__); return -EIO; diff --git a/include/dwmmc.h b/include/dwmmc.h index 9e5966d320..ddae2ec639 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -48,6 +48,7 @@ #define DWMCI_IDINTEN 0x090 #define DWMCI_DSCADDR 0x094 #define DWMCI_BUFADDR 0x098 +#define DWMCI_CARDTHRCTL 0x100 #define DWMCI_DATA 0x200 /* Interrupt Mask register */ @@ -141,6 +142,12 @@ */ #define DWMCI_MSIZE 0x6 +/* The DW MMC Controller Version */ +#define DW_MMC_240A 0x240a + +/* sdmmc cardthrctl set */ +#define DWMCI_CDTHRCTRL_CONFIG (1 + (0x200 << 16)) + /** * struct dwmci_host - Information about a designware MMC host *