[PATCH 09/10] mmc: msm_sdhci: Reset clocks before reconfiguration

Varadarajan Narayanan quic_varada at quicinc.com
Mon Feb 26 11:08:06 CET 2024


U-Boot has to reconfigure the clocks that were set in the boot
loaders. However, in IPQ9574, the clocks have to be reset before
they can be reconfigured. Hence add code to do the relevant
resets.

Signed-off-by: Varadarajan Narayanan <quic_varada at quicinc.com>
---

 drivers/mmc/msm_sdhci.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 9285d412fe..2e9d521159 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -16,6 +16,7 @@
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
+#include <reset.h>
 
 /* Non-standard registers needed for SDHCI startup */
 #define SDCC_MCI_POWER   0x0
@@ -122,10 +123,19 @@ static int msm_sdc_probe(struct udevice *dev)
 	struct msm_sdhc *prv = dev_get_priv(dev);
 	const struct msm_sdhc_variant_info *var_info;
 	struct sdhci_host *host = &prv->host;
+	struct reset_ctl bcr_rst;
 	u32 core_version, core_minor, core_major;
 	u32 caps;
 	int ret;
 
+	ret = reset_get_by_name(dev, "bcr_rst", &bcr_rst);
+	if (!ret) {
+		reset_assert(&bcr_rst);
+		mdelay(10);
+		reset_deassert(&bcr_rst);
+		mdelay(10);
+	}
+
 	host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD | SDHCI_QUIRK_BROKEN_R1B;
 
 	host->max_clk = 0;
-- 
2.34.1



More information about the U-Boot mailing list