]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: Set clock when reverting to safe bus mode
authorValentine Barshak <valentine.barshak@cogentembedded.com>
Sat, 10 Jun 2023 11:22:33 +0000 (13:22 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 18 Jul 2023 00:17:29 +0000 (09:17 +0900)
Set MMC clock when reverting to safe bus mode and speed
in case current MMC mode fails. Otherwise, trying out
the other modes may fail as well.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Valentine Barshak <valentine.barshak@cogentembedded.com>
[hp: fallback to legacy_speed]
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/mmc.c

index de3f569da1251ad32bb979c1fe052232ae5890fe..31cfda288587119cf65de3e483be69d6437bcedc 100644 (file)
@@ -2240,6 +2240,7 @@ error:
                        mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL,
                                   EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_1);
                        mmc_select_mode(mmc, MMC_LEGACY);
+                       mmc_set_clock(mmc, mmc->legacy_speed, MMC_CLK_ENABLE);
                        mmc_set_bus_width(mmc, 1);
                }
        }