aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2018-02-05 07:50:18 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2018-03-05 03:00:58 -0500
commit7d33c3581536b8193b9788a63a68e7bfc22cdc31 (patch)
treeea224e2cbeba8632970107ca2991ada4fe3ba3bf
parent9fc2cd76125cab476ec6fd86fac7f9a780e34dcf (diff)
mmc: sdhci-omap: Workaround for Errata i802
Errata i802 in AM572x Sitara Processors Silicon Revision 2.0, 1.1 (SPRZ429K July 2014–Revised March 2017 [1]) mentions DCRC error interrupts (MMCHS_STAT[21] DCRC=0x1) can occur during the tuning procedure and it has to be disabled during the tuning procedure Implement workaround for Errata i802 here.. [1] -> http://www.ti.com/lit/er/sprz429k/sprz429k.pdf Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci-omap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 36e0626d3de2..e24ae903f7ba 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -257,6 +257,7 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
257 u32 start_window = 0, max_window = 0; 257 u32 start_window = 0, max_window = 0;
258 u8 cur_match, prev_match = 0; 258 u8 cur_match, prev_match = 0;
259 u32 length = 0, max_len = 0; 259 u32 length = 0, max_len = 0;
260 u32 ier = host->ier;
260 u32 phase_delay = 0; 261 u32 phase_delay = 0;
261 int ret = 0; 262 int ret = 0;
262 u32 reg; 263 u32 reg;
@@ -277,6 +278,16 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
277 reg |= DLL_SWT; 278 reg |= DLL_SWT;
278 sdhci_omap_writel(omap_host, SDHCI_OMAP_DLL, reg); 279 sdhci_omap_writel(omap_host, SDHCI_OMAP_DLL, reg);
279 280
281 /*
282 * OMAP5/DRA74X/DRA72x Errata i802:
283 * DCRC error interrupts (MMCHS_STAT[21] DCRC=0x1) can occur
284 * during the tuning procedure. So disable it during the
285 * tuning procedure.
286 */
287 ier &= ~SDHCI_INT_DATA_CRC;
288 sdhci_writel(host, ier, SDHCI_INT_ENABLE);
289 sdhci_writel(host, ier, SDHCI_SIGNAL_ENABLE);
290
280 while (phase_delay <= MAX_PHASE_DELAY) { 291 while (phase_delay <= MAX_PHASE_DELAY) {
281 sdhci_omap_set_dll(omap_host, phase_delay); 292 sdhci_omap_set_dll(omap_host, phase_delay);
282 293
@@ -322,6 +333,8 @@ tuning_error:
322 333
323ret: 334ret:
324 sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); 335 sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
336 sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
337 sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
325 return ret; 338 return ret;
326} 339}
327 340