|
@@ -220,15 +220,18 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg)
|
|
|
|
|
|
static u16 esdhc_readw_le(struct sdhci_host *host, int reg)
|
|
|
{
|
|
|
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
|
|
+ struct pltfm_imx_data *imx_data = pltfm_host->priv;
|
|
|
+
|
|
|
if (unlikely(reg == SDHCI_HOST_VERSION)) {
|
|
|
- u16 val = readw(host->ioaddr + (reg ^ 2));
|
|
|
- /*
|
|
|
- * uSDHC supports SDHCI v3.0, but it's encoded as value
|
|
|
- * 0x3 in host controller version register, which violates
|
|
|
- * SDHCI_SPEC_300 definition. Work it around here.
|
|
|
- */
|
|
|
- if ((val & SDHCI_SPEC_VER_MASK) == 3)
|
|
|
- return --val;
|
|
|
+ reg ^= 2;
|
|
|
+ if (is_imx6q_usdhc(imx_data)) {
|
|
|
+ /*
|
|
|
+ * The usdhc register returns a wrong host version.
|
|
|
+ * Correct it here.
|
|
|
+ */
|
|
|
+ return SDHCI_SPEC_300;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return readw(host->ioaddr + reg);
|