]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mmc: renesas_sdhi: enforce manual correction for Gen3
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 17 Dec 2019 11:40:33 +0000 (12:40 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Mar 2020 13:35:38 +0000 (14:35 +0100)
HW engineers say that automatic tap correction cannot be used for HS400
in all R-Car Gen3 SoCs. So, check for that SDHI variant and disable it
when HS400 is about to be enabled.

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20191217114034.13290-5-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi_core.c

index e5db96fd0a69b82375eedfb158ba1cca475bc870..04f502345b918789dc048dbfb73bb09de898e808 100644 (file)
@@ -348,6 +348,12 @@ static void renesas_sdhi_hs400_complete(struct tmio_mmc_host *host)
        sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF,
                       priv->scc_tappos_hs400);
 
+       /* Gen3 can't do automatic tap correction with HS400, so disable it */
+       if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN3_SDMMC)
+               sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL,
+                              ~SH_MOBILE_SDHI_SCC_RVSCNTL_RVSEN &
+                              sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL));
+
        sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2,
                       (SH_MOBILE_SDHI_SCC_TMPPORT2_HS400EN |
                        SH_MOBILE_SDHI_SCC_TMPPORT2_HS400OSEL) |