[PATCH 3/3] mmc: sdhci_am654: Fallback to DT-provided itap delay on DDR50 tuning failure
From: Diogo Ivo (Schneider Electric)
Date: Wed Jul 29 2026 - 09:04:15 EST
DDR50 mode is not required to support the tuning command CMD19, meaning
that calibration may fail on cards that do not implement it, in which
case a known-good itap delay value should be programmed into the host
controller.
Do this by reading the (already defined) itap delay DT property for DDR50
and, if tuning fails for this mode, fall back to the DT-provided itap delay
value.
Fixes: 901d16e46296 ("mmc: sdhci_am654: Add retry tuning")
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Diogo Ivo (Schneider Electric) <diogo.ivo@xxxxxxxxxxx>
---
drivers/mmc/host/sdhci_am654.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c
index 806544db0128..a7c64c5ac636 100644
--- a/drivers/mmc/host/sdhci_am654.c
+++ b/drivers/mmc/host/sdhci_am654.c
@@ -126,7 +126,7 @@ static const struct timing_data td[] = {
NULL,
MMC_CAP_UHS_SDR104},
[MMC_TIMING_UHS_DDR50] = {"ti,otap-del-sel-ddr50",
- NULL,
+ "ti,itap-del-sel-ddr50",
MMC_CAP_UHS_DDR50},
[MMC_TIMING_MMC_DDR52] = {"ti,otap-del-sel-ddr52",
"ti,itap-del-sel-ddr52",
@@ -580,9 +580,15 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host,
} while (++sdhci_am654->tuning_loop < RETRY_TUNING_MAX);
if (itapdly < 0) {
- dev_err(dev, "Failed to find itapdly, fail tuning\n");
- /* Explicitly clear ITAPDLY */
- sdhci_am654_write_itapdly(sdhci_am654, 0, 0);
+ if (timing == MMC_TIMING_UHS_DDR50) {
+ sdhci_am654_write_itapdly(sdhci_am654,
+ sdhci_am654->itap_del_sel[timing],
+ sdhci_am654->itap_del_ena[timing]);
+ } else {
+ dev_err(dev, "Failed to find itapdly, fail tuning\n");
+ /* Explicitly clear ITAPDLY */
+ sdhci_am654_write_itapdly(sdhci_am654, 0, 0);
+ }
return -1;
}
--
2.55.0