From: Christoph Stoidner Date: Fri, 31 Oct 2025 14:59:51 +0000 (+0100) Subject: mmc: Fix missing 1 ms delay after mmc power up X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21cdfd199220cd259b5b7d472cee0577b7eb8eca;p=thirdparty%2Fu-boot.git mmc: Fix missing 1 ms delay after mmc power up mmc/sd specification requires a 1 ms delay (stable supply voltage) after vdd was enabled and before issuing first command. For most sdcard/soc combinations, the missing delay seems to be not a problem because the processing time between enabling vdd and the first command is often hundreds of microseconds or more. However, in our specific case, some sdcards were not detected by u-boot: * soc: NXP i.MX 93 * sdcards: SanDisk Ultra, 64GB micro SDXC 1, MediaRange, 8GB, SDHC * measured time between vdd and first command: approx. 784us * symptom: both sdcards did not respond at all to first commands, u-boot mmc subsystem ran into timeout and stops to initialize the cards Signed-off-by: Christoph Stoidner Cc: Peng Fan Cc: Jaehoon Chung Signed-off-by: Peng Fan --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index bf82c515600..71664173016 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2933,11 +2933,18 @@ static int mmc_power_cycle(struct mmc *mmc) return ret; /* - * SD spec recommends at least 1ms of delay. Let's wait for 2ms - * to be on the safer side. + * SD spec recommends at least 1ms of 'power on' delay. + * Let's wait for 2ms to be on the safer side. */ udelay(2000); - return mmc_power_on(mmc); + ret = mmc_power_on(mmc); + + /* + * SD spec recommends at least 1ms of 'stable supply voltage' delay. + * Let's wait for 2ms to be on the safer side. + */ + udelay(2000); + return ret; } int mmc_get_op_cond(struct mmc *mmc, bool quiet)