Skip to contentSkip to conversation

mmc: am654_sdhci: Clear UHS_MODE_SELECT when < MMC_HS_52

PATCH Superseded Judith Mendez 2 participants 3 messages May 20, 2025 – May 21, 2025 MMC, SD and SDIO

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: am654_sdhci: Clear UHS_MODE_SELECT when < MMC_HS_52

This clears UHS_MODE_SELECT for timing modes < MMC_HS_52.

When initializing to HS400 mode, the host controller downgrades to non-uhs modes so clear UHS_MODE_SELECT at modes < MMC_HS_52.

This fixes eMMC writes on j7200 EVM.

Fixes 6067aa66b3bb ("mmc: am654_sdhci: Add am654_sdhci_set_control_reg")
---
 drivers/mmc/am654_sdhci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mmc/am654_sdhci.c +5 -0
index 0df3568f073..d3c8f94dd0c 100644
@@ -527,11 +527,16 @@ static int am654_sdhci_execute_tuning(struct mmc *mmc, u8 opcode)
 void am654_sdhci_set_control_reg(struct sdhci_host *host)
 {
 	struct mmc *mmc = host->mmc;
+	u32 reg;
 
+	reg = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+	reg &= ~SDHCI_CTRL_UHS_MASK;
 	sdhci_set_voltage(host);
 
 	if (mmc->selected_mode > MMC_HS_52)
 		sdhci_set_uhs_timing(host);
+	else
+		sdhci_writew(host, reg, SDHCI_HOST_CONTROL2);
 }
 
 const struct sdhci_ops am654_sdhci_ops = {
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines

Subject: [PATCH] mmc: am654_sdhci: Clear UHS_MODE_SELECT when < MMC_HS_52

This clears UHS_MODE_SELECT for timing modes < MMC_HS_52.

When initializing to HS400 mode, the host controller downgrades to non-uhs modes so clear UHS_MODE_SELECT at modes < MMC_HS_52.

Typo: '<' -> '<='

Quoted 6 lines

This fixes eMMC writes on j7200 EVM.

Fixes 6067aa66b3bb ("mmc: am654_sdhci: Add

am654_sdhci_set_control_reg")

#2 lore raw

Hi Peng,

Quoted 9 lines · Peng Fan
Quoted 7 lines

Subject: [PATCH] mmc: am654_sdhci: Clear UHS_MODE_SELECT when < MMC_HS_52

This clears UHS_MODE_SELECT for timing modes < MMC_HS_52.

When initializing to HS400 mode, the host controller downgrades to non-uhs modes so clear UHS_MODE_SELECT at modes < MMC_HS_52.

Typo: '<' -> '<='

Will fix patch description for v2, thanks.

~ Judith

Quoted 10 lines
Quoted 7 lines

This fixes eMMC writes on j7200 EVM.

Fixes 6067aa66b3bb ("mmc: am654_sdhci: Add

am654_sdhci_set_control_reg")