summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanmay Kathpalia <tanmay.kathpalia@altera.com>2026-05-14 11:54:11 -0700
committerPeng Fan <peng.fan@nxp.com>2026-07-06 14:06:08 +0800
commitaa2561443c88c00abf7a6f1f77f4976392409771 (patch)
tree899edcbbf61294244d3375c9749fd999025b1986
parent780084d7c07f511da4a39b43277c573156ed42e0 (diff)
downloadu-boot-aa2561443c88c00abf7a6f1f77f4976392409771.tar.gz
u-boot-aa2561443c88c00abf7a6f1f77f4976392409771.zip
mmc: sd: fix redundant 1.8V voltage switch on cold boot with UHS card
When a UHS card successfully negotiates 1.8V signaling during normal initialization, the host voltage switch is performed as part of the ACMD41 handshake. Without this fix, the warm-reboot recovery path would fire again immediately after, switching the host voltage a second time unnecessarily. Add a check so the recovery path is only entered when the voltage switch was not already performed during the current initialization session. Fixes: 906ee6785b1c ("mmc: sd: Handle UHS-I voltage signaling without power cycle") Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--drivers/mmc/mmc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index f0e38efb262..2e565560656 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2721,10 +2721,11 @@ static int mmc_startup(struct mmc *mmc)
#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
/*
- * If the card has already switched to 1.8V signaling, then
- * set the signal voltage to 1.8V.
+ * If voltage switch was skipped during ACMD41 but the card is
+ * already at 1.8V (retained from a previous session, e.g. warm
+ * reboot), re-configure the host to match.
*/
- if (mmc_sd_card_using_v18(mmc)) {
+ if (!(mmc->ocr & OCR_S18R) && mmc_sd_card_using_v18(mmc)) {
/*
* During a signal voltage level switch, the clock must be gated
* for 5 ms according to the SD spec.