Skip to content

Commit 1809443

Browse files
Dong Aishengstorulf
authored andcommitted
mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix
The uSDHC has an ADMA Length Mismatch errata ERR004536 which may cause ADMA work abnormally. The errata has already been fixed for i.MX6Q TO1.2 and i.MX6DL TO1.1 by enable the bit 7 in 0x6c register. Unfortunately this fix is not included in i.MX6SL. So we disable ADMA for i.MX6SL and use SDMA instead. Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent b732104 commit 1809443

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@
112112
#define ESDHC_FLAG_STD_TUNING BIT(5)
113113
/* The IP has SDHCI_CAPABILITIES_1 register */
114114
#define ESDHC_FLAG_HAVE_CAP1 BIT(6)
115+
/*
116+
* The IP has errata ERR004536
117+
* uSDHC: ADMA Length Mismatch Error occurs if the AHB read access is slow,
118+
* when reading data from the card
119+
*/
120+
#define ESDHC_FLAG_ERR004536 BIT(7)
115121

116122
struct esdhc_soc_data {
117123
u32 flags;
@@ -139,7 +145,7 @@ static struct esdhc_soc_data usdhc_imx6q_data = {
139145

140146
static struct esdhc_soc_data usdhc_imx6sl_data = {
141147
.flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
142-
| ESDHC_FLAG_HAVE_CAP1,
148+
| ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536,
143149
};
144150

145151
struct pltfm_imx_data {
@@ -991,6 +997,13 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
991997
writel(0x08100810, host->ioaddr + ESDHC_WTMK_LVL);
992998
host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN;
993999
host->mmc->caps |= MMC_CAP_1_8V_DDR;
1000+
1001+
/*
1002+
* errata ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
1003+
* TO1.1, it's harmless for MX6SL
1004+
*/
1005+
writel(readl(host->ioaddr + 0x6c) | BIT(7),
1006+
host->ioaddr + 0x6c);
9941007
}
9951008

9961009
if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
@@ -1002,6 +1015,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
10021015
ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP,
10031016
host->ioaddr + ESDHC_TUNING_CTRL);
10041017

1018+
if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
1019+
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
1020+
10051021
boarddata = &imx_data->boarddata;
10061022
if (sdhci_esdhc_imx_probe_dt(pdev, host, boarddata) < 0) {
10071023
if (!host->mmc->parent->platform_data) {

0 commit comments

Comments
 (0)