From: Yangbo Lu <yangbo.lu@freescale.com>
To: scottwood@freescale.com, linux-mmc@vger.kernel.org,
ulf.hansson@linaro.org
Cc: X.Xie@freescale.com, LeoLi@freescale.com,
Yangbo Lu <yangbo.lu@freescale.com>
Subject: [v4, 6/6] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0
Date: Mon, 14 Dec 2015 12:24:27 +0800 [thread overview]
Message-ID: <1450067067-44869-7-git-send-email-yangbo.lu@freescale.com> (raw)
In-Reply-To: <1450067067-44869-1-git-send-email-yangbo.lu@freescale.com>
The eSDHC of T4240-R1.0-R2.0 has incorrect vender version and spec version.
Acturally, the right version numbers should be VVN=0x13 and SVN = 0x1.
So, fix it in driver to avoid that incorrect version numbers break down the
ADMA data transfer.
Signed-off-by: Yangbo Lu <yangbo.lu@freescale.com>
---
Changes for v2:
- None
Changes for v3:
- Got SoC version/revision from struct sdhci_esdhc instead of global variables
Changes for v4
- None
---
drivers/mmc/host/sdhci-of-esdhc.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index 9105888..6ab94e7 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -77,6 +77,8 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,
static u16 esdhc_readw_fixup(struct sdhci_host *host,
int spec_reg, u32 value)
{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct sdhci_esdhc *esdhc = pltfm_host->priv;
u16 ret;
int shift = (spec_reg & 0x2) * 8;
@@ -84,6 +86,13 @@ static u16 esdhc_readw_fixup(struct sdhci_host *host,
ret = value & 0xffff;
else
ret = (value >> shift) & 0xffff;
+
+ /* Workaround for T4240-R1.0-R2.0 eSDHC which has incorrect
+ * vendor version and spec version information.
+ */
+ if ((spec_reg == SDHCI_HOST_VERSION) &&
+ (esdhc->soc_ver == SVR_T4240) && (esdhc->soc_rev <= 0x20))
+ ret = (VENDOR_V_23 << SDHCI_VENDOR_VER_SHIFT) | SDHCI_SPEC_200;
return ret;
}
--
2.1.0.27.g96db324
next prev parent reply other threads:[~2015-12-14 4:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 4:24 [v4, 0/6] eSDHC patches introduction Yangbo Lu
2015-12-14 4:24 ` [v4, 1/6] soc: fsl: add GUTS driver for QorIQ platforms Yangbo Lu
2015-12-14 22:07 ` Scott Wood
2015-12-14 4:24 ` [v4, 2/6] dt: move guts devicetree doc out of powerpc directory Yangbo Lu
2015-12-14 22:10 ` Scott Wood
2015-12-14 4:24 ` [v4, 3/6] powerpc/fsl: move mpc85xx.h to include/linux Yangbo Lu
2015-12-14 22:12 ` Scott Wood
2015-12-14 4:24 ` [v4, 4/6] mmc: sdhci-of-esdhc: get SVR from global utilities registers Yangbo Lu
2015-12-14 4:24 ` [v4, 5/6] mmc: kconfig: select FSL_GUTS for MMC_SDHCI_OF_ESDHC Yangbo Lu
2015-12-14 13:08 ` Ulf Hansson
2015-12-14 18:04 ` Scott Wood
2015-12-15 9:46 ` Ulf Hansson
2015-12-16 22:48 ` Scott Wood
2015-12-17 11:25 ` Ulf Hansson
2015-12-28 19:03 ` Scott Wood
2015-12-17 11:30 ` Ulf Hansson
2015-12-28 10:26 ` Yangbo Lu
2015-12-28 12:10 ` Ulf Hansson
2015-12-28 19:10 ` Scott Wood
2016-01-06 6:58 ` Yangbo Lu
[not found] ` <AM3PR04MB530AAF1632EA442F05C95BF91F50@AM3PR04MB530.eurprd04.prod.outlook.com>
[not found] ` <HE1PR04MB0889197B75CA5C8FDB793F87F8F60@HE1PR04MB0889.eurprd04.prod.outlook.com>
2016-01-08 6:34 ` Scott Wood
2016-01-06 7:34 ` Yangbo Lu
2016-01-06 7:23 ` Yangbo Lu
2015-12-28 18:47 ` Scott Wood
2016-01-06 7:18 ` Yangbo Lu
2016-01-14 10:31 ` Ulf Hansson
2016-01-08 6:24 ` Yangbo Lu
2015-12-14 22:14 ` Scott Wood
2015-12-14 4:24 ` Yangbo Lu [this message]
2015-12-14 12:22 ` [v4, 0/6] eSDHC patches introduction Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450067067-44869-7-git-send-email-yangbo.lu@freescale.com \
--to=yangbo.lu@freescale.com \
--cc=LeoLi@freescale.com \
--cc=X.Xie@freescale.com \
--cc=linux-mmc@vger.kernel.org \
--cc=scottwood@freescale.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).