diff options
author | Tom Rini <trini@konsulko.com> | 2023-11-18 10:25:48 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-18 10:25:48 -0500 |
commit | d5ff806cb57359ac5084e2af6a96463c9da772ba (patch) | |
tree | 0965319cc0b312a2eac24430ec7907bdabeaac11 /drivers | |
parent | cc7bc8237abd4beed458d8957a55b2ef46431886 (diff) | |
parent | 70d2c9940e54ada6bf9e1e538c958f13ccc97c38 (diff) | |
download | u-boot-d5ff806cb57359ac5084e2af6a96463c9da772ba.tar.gz u-boot-d5ff806cb57359ac5084e2af6a96463c9da772ba.tar.bz2 u-boot-d5ff806cb57359ac5084e2af6a96463c9da772ba.zip |
Merge branch 'master-mmc-clock' of https://source.denx.de/u-boot/custodians/u-boot-sh
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/renesas-sdhi.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c index 8cd501c5f7..97aaf1e4ec 100644 --- a/drivers/mmc/renesas-sdhi.c +++ b/drivers/mmc/renesas-sdhi.c @@ -318,7 +318,7 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_sd_priv *priv) RENESAS_SDHI_SCC_DTCNTL_TAPNUM_MASK; } -static void renesas_sdhi_reset_tuning(struct tmio_sd_priv *priv) +static void renesas_sdhi_reset_tuning(struct tmio_sd_priv *priv, bool clk_disable) { u32 reg; @@ -350,6 +350,12 @@ static void renesas_sdhi_reset_tuning(struct tmio_sd_priv *priv) reg = tmio_sd_readl(priv, RENESAS_SDHI_SCC_RVSCNTL); reg &= ~RENESAS_SDHI_SCC_RVSCNTL_RVSEN; tmio_sd_writel(priv, reg, RENESAS_SDHI_SCC_RVSCNTL); + + if (clk_disable) { + reg = tmio_sd_readl(priv, TMIO_SD_CLKCTL); + reg &= ~TMIO_SD_CLKCTL_SCLKEN; + tmio_sd_writel(priv, reg, TMIO_SD_CLKCTL); + } } static int renesas_sdhi_hs400(struct udevice *dev) @@ -629,7 +635,7 @@ int renesas_sdhi_execute_tuning(struct udevice *dev, uint opcode) out: if (ret < 0) { dev_warn(dev, "Tuning procedure failed\n"); - renesas_sdhi_reset_tuning(priv); + renesas_sdhi_reset_tuning(priv, true); } return ret; @@ -668,7 +674,7 @@ static int renesas_sdhi_set_ios(struct udevice *dev) (mmc->selected_mode != UHS_SDR104) && (mmc->selected_mode != MMC_HS_200) && (mmc->selected_mode != MMC_HS_400)) { - renesas_sdhi_reset_tuning(priv); + renesas_sdhi_reset_tuning(priv, mmc->clk_disable); } #endif @@ -1095,7 +1101,7 @@ static int renesas_sdhi_probe(struct udevice *dev) CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || \ CONFIG_IS_ENABLED(MMC_HS400_SUPPORT) if (priv->caps & TMIO_SD_CAP_RCAR_UHS) - renesas_sdhi_reset_tuning(priv); + renesas_sdhi_reset_tuning(priv, true); #endif return 0; |