Skip to content

Commit 6e1e9bd

Browse files
Weijun Yangsashalevin
authored andcommitted
mmc: core: enable CMD19 tuning for DDR50 mode
[ Upstream commit 4324f6d ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 8a55af0 commit 6e1e9bd

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
@@ -661,9 +661,25 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
661661
* SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
662662
*/
663663
if (!mmc_host_is_spi(card->host) &&
664-
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
665-
card->sd_bus_speed == UHS_SDR104_BUS_SPEED))
664+
(card->sd_bus_speed == UHS_SDR50_BUS_SPEED ||
665+
card->sd_bus_speed == UHS_DDR50_BUS_SPEED ||
666+
card->sd_bus_speed == UHS_SDR104_BUS_SPEED)) {
666667
err = mmc_execute_tuning(card);
668+
669+
/*
670+
* As SD Specifications Part1 Physical Layer Specification
671+
* Version 3.01 says, CMD19 tuning is available for unlocked
672+
* cards in transfer state of 1.8V signaling mode. The small
673+
* difference between v3.00 and 3.01 spec means that CMD19
674+
* tuning is also available for DDR50 mode.
675+
*/
676+
if (err && card->sd_bus_speed == UHS_DDR50_BUS_SPEED) {
677+
pr_warn("%s: ddr50 tuning failed\n",
678+
mmc_hostname(card->host));
679+
err = 0;
680+
}
681+
}
682+
667683
out:
668684
kfree(status);
669685

0 commit comments

Comments
 (0)