Skip to content

Commit 4324f6d

Browse files
Weijun Yangstorulf
authored andcommitted
mmc: core: enable CMD19 tuning for DDR50 mode
As SD Specifications Part1 Physical Layer Specification Version 3.01 says, CMD19 tuning is available for unlocked cards in transfer state of 1.8V signaling mode. The small difference between v3.00 and 3.01 spec means that CMD19 tuning is also available for DDR50 mode. Signed-off-by: Weijun Yang <[email protected]> Signed-off-by: Barry Song <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent b093410 commit 4324f6d

File tree

1 file changed

+18
-2
lines changed
  • drivers/mmc/core

1 file changed

+18
-2
lines changed

drivers/mmc/core/sd.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,25 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
626626
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
627627
*/
628628
if (!mmc_host_is_spi(card->host) &&
629-
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
630-
card->sd_bus_speed == UHS_SDR104_BUS_SPEED))
629+
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
630+
card->sd_bus_speed == UHS_DDR50_BUS_SPEED ||
631+
card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
631632
err = mmc_execute_tuning(card);
633+
634+
/*
635+
* As SD Specifications Part1 Physical Layer Specification
636+
* Version 3.01 says, CMD19 tuning is available for unlocked
637+
* cards in transfer state of 1.8V signaling mode. The small
638+
* difference between v3.00 and 3.01 spec means that CMD19
639+
* tuning is also available for DDR50 mode.
640+
*/
641+
if (err && card->sd_bus_speed == UHS_DDR50_BUS_SPEED) {
642+
pr_warn("%s: ddr50 tuning failed\n",
643+
mmc_hostname(card->host));
644+
err = 0;
645+
}
646+
}
647+
632648
out:
633649
kfree(status);
634650

0 commit comments

Comments
 (0)