linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v2, 3/3] mmc: sdhci-of-esdhc: add workaround for T4240 incorrect HOSTVER value
@ 2015-08-27  9:29 Yangbo Lu
  0 siblings, 0 replies; only message in thread
From: Yangbo Lu @ 2015-08-27  9:29 UTC (permalink / raw)
  To: scottwood, linux-mmc, ulf.hansson; +Cc: Yangbo Lu

For T4240-R1.0-R2.0, the HOSTVER register has incorrcet vender
version value and sdhc spec version value. This will break down
the ADMA data transfer. So add workaround to get right value
VVN=0x13, SVN = 0x1.

Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
---
 drivers/mmc/host/sdhci-of-esdhc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 20e0b9a..84496f0 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -70,6 +70,14 @@ static u16 esdhc_readw(struct sdhci_host *host, int reg)
 		ret = in_be32(host->ioaddr + base) & 0xffff;
 	else
 		ret = (in_be32(host->ioaddr + base) >> shift) & 0xffff;
+
+	/* Workaround for T4240-R1.0-R2.0 eSDHC which has incorrect
+	 * vendor version and spec version information.
+	 */
+	if ((reg == SDHCI_HOST_VERSION) &&
+	    (soc_ver == SVR_T4240) && (soc_rev <= 0x20))
+		ret = (VENDOR_V_23 << SDHCI_VENDOR_VER_SHIFT) | SDHCI_SPEC_200;
+
 	return ret;
 }
 
-- 
2.1.0.27.g96db324


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-27  9:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-27  9:29 [v2, 3/3] mmc: sdhci-of-esdhc: add workaround for T4240 incorrect HOSTVER value Yangbo Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).