Skip to content

Commit 124a5b1

Browse files
fix:[components][drivers][sdio] fix the sequence of switching to emmc high-speed ddr mode
- corrected the sequence of entering emmc high-speed ddr mode Signed-off-by: Fan YANG <[email protected]>
1 parent e4dce1d commit 124a5b1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

components/drivers/sdio/dev_mmc.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Date Author Notes
88
* 2015-06-15 hichard first version
99
* 2024-05-25 HPMicro add HS400 support
10+
* 2025-12-11 HPMicro correct the sequence of switching to high-speed ddr mode
1011
*/
1112

1213
#include <drivers/dev_mmcsd_core.h>
@@ -403,13 +404,6 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd)
403404
}
404405
}
405406

406-
if (!err && ddr)
407-
{
408-
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
409-
EXT_CSD_BUS_WIDTH,
410-
ext_csd_bits[idx][1]);
411-
}
412-
413407
if (!err)
414408
{
415409
if (card->flags & (CARD_FLAG_HIGHSPEED | CARD_FLAG_HIGHSPEED_DDR))
@@ -421,6 +415,13 @@ static int mmc_select_bus_width(struct rt_mmcsd_card *card, rt_uint8_t *ext_csd)
421415
}
422416
}
423417

418+
if (!err && ddr)
419+
{
420+
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
421+
EXT_CSD_BUS_WIDTH,
422+
ext_csd_bits[idx][1]);
423+
}
424+
424425
return err;
425426
}
426427

0 commit comments

Comments
 (0)