From: Venkatesh Yadav Abbarapu Date: Tue, 23 Apr 2024 05:30:57 +0000 (+0530) Subject: mmc: Change the frequency to MMC_HS_52 when selecting hs400 X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=efddda8f03f027cf6ed0f1d7e479c87c26247822;p=u-boot.git mmc: Change the frequency to MMC_HS_52 when selecting hs400 Per JESD84-B51 P47, host need to change frequency to <=52MHz after setting HS_TIMING to 0x1, and host need to set the 8-bit DDR buswidth. Currently setting the frequency to 26MHz and trying to switch 8-bit DDR buswidth resulting timeouts. mmc dev 1 0 Select HS400 failed -110 switch to partitions #0, OK mmc1(part 0) is current device Signed-off-by: Venkatesh Yadav Abbarapu --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 0b881f11b4..7e702c3ae8 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -997,8 +997,8 @@ static int mmc_set_card_speed(struct mmc *mmc, enum bus_mode mode, * Extended CSD. Reconfigure the controller to run at HS mode. */ if (hsdowngrade) { - mmc_select_mode(mmc, MMC_HS); - mmc_set_clock(mmc, mmc_mode2freq(mmc, MMC_HS), false); + mmc_select_mode(mmc, MMC_HS_52); + mmc_set_clock(mmc, mmc_mode2freq(mmc, MMC_HS_52), false); } #endif @@ -2077,7 +2077,7 @@ static int mmc_select_hs400(struct mmc *mmc) } /* Set back to HS */ - mmc_set_card_speed(mmc, MMC_HS, true); + mmc_set_card_speed(mmc, MMC_HS_52, true); err = mmc_hs400_prepare_ddr(mmc); if (err)