clk: meson: reset mmc clock on probe
[oweals/u-boot.git] / drivers / clk / meson / g12a.c
index cada80e6b5fc0786b8ff3a3f2224c844a99f2651..c1976aa1efb15644f7611fa709c462e4b8c4b0ca 100644 (file)
@@ -978,6 +978,13 @@ static int meson_clk_probe(struct udevice *dev)
        if (IS_ERR(priv->map))
                return PTR_ERR(priv->map);
 
+       /*
+        * Depending on the boot src, the state of the MMC clock might
+        * be different. Reset it to make sure we won't get stuck
+        */
+       regmap_write(priv->map, HHI_NAND_CLK_CNTL, 0);
+       regmap_write(priv->map, HHI_SD_EMMC_CLK_CNTL, 0);
+
        debug("meson-clk-g12a: probed\n");
 
        return 0;