From: Valentine Barshak Date: Sat, 10 Jun 2023 11:22:33 +0000 (+0200) Subject: mmc: Set clock when reverting to safe bus mode X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=50dee4f3610331cc31f1f02f9d4116b716907011;p=u-boot.git mmc: Set clock when reverting to safe bus mode 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 Signed-off-by: Valentine Barshak [hp: fallback to legacy_speed] Signed-off-by: Hai Pham Reviewed-by: Peng Fan --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index de3f569da1..31cfda2885 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -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); } }