mmc: tmio: sdhi: Clear HS400 settings when resetting SCC
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Wed, 13 Jun 2018 06:02:55 +0000 (08:02 +0200)
committerMarek Vasut <marex@denx.de>
Fri, 2 Nov 2018 15:04:45 +0000 (16:04 +0100)
Make sure to clear HS400 configuration when resetting the SCC block.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
drivers/mmc/renesas-sdhi.c

index 7c92bd92ad6c15a5aa0b4248bf29aac130253f0c..e92bbe5f09649d1443c6912e8f0d56d6f8ce127f 100644 (file)
@@ -34,6 +34,8 @@
 #define   RENESAS_SDHI_SCC_RVSREQ_RVSERR               BIT(2)
 #define RENESAS_SDHI_SCC_SMPCMP                        0x818
 #define RENESAS_SDHI_SCC_TMPPORT2                      0x81c
+#define   RENESAS_SDHI_SCC_TMPPORT2_HS400EN            BIT(31)
+#define   RENESAS_SDHI_SCC_TMPPORT2_HS400OSEL          BIT(4)
 
 #define RENESAS_SDHI_MAX_TAP 3
 
@@ -90,6 +92,11 @@ static void renesas_sdhi_reset_tuning(struct tmio_sd_priv *priv)
        reg &= ~RENESAS_SDHI_SCC_CKSEL_DTSEL;
        tmio_sd_writel(priv, reg, RENESAS_SDHI_SCC_CKSEL);
 
+       reg = tmio_sd_readl(priv, RENESAS_SDHI_SCC_TMPPORT2);
+       reg &= ~(RENESAS_SDHI_SCC_TMPPORT2_HS400EN |
+                RENESAS_SDHI_SCC_TMPPORT2_HS400OSEL);
+       tmio_sd_writel(priv, reg, RENESAS_SDHI_SCC_TMPPORT2);
+
        reg = tmio_sd_readl(priv, TMIO_SD_CLKCTL);
        reg |= TMIO_SD_CLKCTL_SCLKEN;
        tmio_sd_writel(priv, reg, TMIO_SD_CLKCTL);