mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mci: am654-sdhci: Clear SDHCI_CTRL_HISPD bit for some speed modes
@ 2025-05-15 14:32 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2025-05-15 14:32 UTC (permalink / raw)
  To: Barebox List; +Cc: Lars Schmidt

Normally we would set the SDHCI_CTRL_HISPD bit for MMC_TIMING_SD_HS and
MMC_TIMING_MMC_HS. This however doesn't seem to work on AM62x and AM62L
SoCs.

Based on U-Boot commit 27a87c834fd ("mmc: am654_sdhci: Fix HISPD bit
configuration in some lower speed modes") clear the SDHCI_CTRL_HISPD bit
in these modes. Unfortunately I can't find the information in the data
sheet referenced in that commit, so I can't verify it, but it seems
to be necessary not only on AM6548, but on other SoCs as well.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/am654-sdhci.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/mci/am654-sdhci.c b/drivers/mci/am654-sdhci.c
index 2c1fa5d804..8d6fa9c999 100644
--- a/drivers/mci/am654-sdhci.c
+++ b/drivers/mci/am654-sdhci.c
@@ -520,10 +520,20 @@ static void am654_sdhci_set_ios(struct mci_host *mci, struct mci_ios *ios)
 
 	val = sdhci_read8(&plat->sdhci, SDHCI_HOST_CONTROL);
 
-	if (ios->clock > 26000000)
-		val |= SDHCI_CTRL_HISPD;
-	else
+	switch (ios->timing) {
+	/*
+	 * According to the data manual, HISPD bit
+	 * should not be set in these speed modes.
+	 */
+	case MMC_TIMING_SD_HS:
+	case MMC_TIMING_MMC_HS:
+	case MMC_TIMING_LEGACY:
 		val &= ~SDHCI_CTRL_HISPD;
+		break;
+	default:
+		val |= SDHCI_CTRL_HISPD;
+		break;
+	}
 
 	sdhci_write8(&plat->sdhci, SDHCI_HOST_CONTROL, val);
 
-- 
2.39.5




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-05-15 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-15 14:32 [PATCH] mci: am654-sdhci: Clear SDHCI_CTRL_HISPD bit for some speed modes Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox