| From 6fe28fd9d9752c0ed067966ecd6cccc16fdb300a Mon Sep 17 00:00:00 2001 |
| From: Yinbo Zhu <yinbo.zhu@nxp.com> |
| Date: Mon, 11 Mar 2019 02:16:40 +0000 |
| Subject: mmc: sdhci-of-esdhc: add erratum eSDHC-A001 and A-008358 support |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| [ Upstream commit 05cb6b2a66fa7837211a060878e91be5eb10cb07 ] |
| |
| eSDHC-A001: The data timeout counter (SYSCTL[DTOCV]) is not |
| reliable for DTOCV values 0x4(2^17 SD clock), 0x8(2^21 SD clock), |
| and 0xC(2^25 SD clock). The data timeout counter can count from |
| 2^13–2^27, but for values 2^17, 2^21, and 2^25, the timeout |
| counter counts for only 2^13 SD clocks. |
| A-008358: The data timeout counter value loaded into the timeout |
| counter is less than expected and can result into early timeout |
| error in case of eSDHC data transactions. The table below shows |
| the expected vs actual timeout period for different values of |
| SYSCTL[DTOCV]: |
| these two erratum has the same quirk to control it, and set |
| SDHCI_QUIRK_RESET_AFTER_REQUEST to fix above issue. |
| |
| Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com> |
| Acked-by: Adrian Hunter <adrian.hunter@intel.com> |
| Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/mmc/host/sdhci-of-esdhc.c | 4 +++- |
| 1 file changed, 3 insertions(+), 1 deletion(-) |
| |
| diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c |
| index 4fc4d2c7643c5..7e0eae8dafae0 100644 |
| --- a/drivers/mmc/host/sdhci-of-esdhc.c |
| +++ b/drivers/mmc/host/sdhci-of-esdhc.c |
| @@ -1077,8 +1077,10 @@ static int sdhci_esdhc_probe(struct platform_device *pdev) |
| if (esdhc->vendor_ver > VENDOR_V_22) |
| host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ; |
| |
| - if (of_find_compatible_node(NULL, NULL, "fsl,p2020-esdhc")) |
| + if (of_find_compatible_node(NULL, NULL, "fsl,p2020-esdhc")) { |
| host->quirks2 |= SDHCI_QUIRK_RESET_AFTER_REQUEST; |
| + host->quirks2 |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; |
| + } |
| |
| if (of_device_is_compatible(np, "fsl,p5040-esdhc") || |
| of_device_is_compatible(np, "fsl,p5020-esdhc") || |
| -- |
| 2.20.1 |
| |