U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: cv1800b_sdhci: honor 'no-1-8-v' DT property
@ 2026-05-07 23:48 Hiago De Franco
  2026-05-13 11:04 ` Peng Fan
  0 siblings, 1 reply; 2+ messages in thread
From: Hiago De Franco @ 2026-05-07 23:48 UTC (permalink / raw)
  To: u-boot, Peng Fan, Jaehoon Chung, Tom Rini; +Cc: Leo Yu-Chi Liang, Kongyang Liu

CV1800B SDHCI controller does support 1.8V, however, boards like
MilkV-Duo 256M do not have a VCCIO 1.8V regulator (the bus is wired for
3.3V only).

These boards set 'no-1-8-v' in their device tree, and mmc_of_parse()
does respect this property. Later, when sdhci_setup_cfg() is called, it
reads SDHCI_CAPABILITIES_1 from the hardware and unconditionally adds
the UHS caps again based on what the controller advertises. Since the
board cannot switch to 1.8V, the host issues CMD11 (voltage switch
request), the card transitions, but the bus stays at 3.3V. The SD card
stops responding until the next power cycle.

Before calling sdhci_setup_cfg(), set the SDHCI_QUIRK_NO_1_8_V quirk
when 'no-1-8-v' is present. The quirk causes the SDR104/SDR50/DDR50 bits
to be masked out of the caps, allowing the card to initialize properly.

This matches the pattern used by zynq_sdhci.

Fixes: eb36f28ff721 ("mmc: cv1800b: Add sdhci driver support for cv1800b SoC")
Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 drivers/mmc/cv1800b_sdhci.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/cv1800b_sdhci.c b/drivers/mmc/cv1800b_sdhci.c
index 036e798f374..72c5bfc6f35 100644
--- a/drivers/mmc/cv1800b_sdhci.c
+++ b/drivers/mmc/cv1800b_sdhci.c
@@ -94,6 +94,9 @@ static int cv1800b_sdhci_probe(struct udevice *dev)
 	host->ops = &cv1800b_sdhci_sd_ops;
 	host->max_clk = MMC_MAX_CLOCK;
 
+	if (dev_read_bool(dev, "no-1-8-v"))
+		host->quirks |= SDHCI_QUIRK_NO_1_8_V;
+
 	ret = mmc_of_parse(dev, &plat->cfg);
 	if (ret)
 		return ret;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: cv1800b_sdhci: honor 'no-1-8-v' DT property
  2026-05-07 23:48 [PATCH] mmc: cv1800b_sdhci: honor 'no-1-8-v' DT property Hiago De Franco
@ 2026-05-13 11:04 ` Peng Fan
  0 siblings, 0 replies; 2+ messages in thread
From: Peng Fan @ 2026-05-13 11:04 UTC (permalink / raw)
  To: Hiago De Franco
  Cc: u-boot, Peng Fan, Jaehoon Chung, Tom Rini, Leo Yu-Chi Liang,
	Kongyang Liu

On Thu, May 07, 2026 at 08:48:36PM -0300, Hiago De Franco wrote:
>CV1800B SDHCI controller does support 1.8V, however, boards like
>MilkV-Duo 256M do not have a VCCIO 1.8V regulator (the bus is wired for
>3.3V only).
>
>These boards set 'no-1-8-v' in their device tree, and mmc_of_parse()
>does respect this property. Later, when sdhci_setup_cfg() is called, it
>reads SDHCI_CAPABILITIES_1 from the hardware and unconditionally adds
>the UHS caps again based on what the controller advertises. Since the
>board cannot switch to 1.8V, the host issues CMD11 (voltage switch
>request), the card transitions, but the bus stays at 3.3V. The SD card
>stops responding until the next power cycle.
>
>Before calling sdhci_setup_cfg(), set the SDHCI_QUIRK_NO_1_8_V quirk
>when 'no-1-8-v' is present. The quirk causes the SDR104/SDR50/DDR50 bits
>to be masked out of the caps, allowing the card to initialize properly.
>
>This matches the pattern used by zynq_sdhci.
>
>Fixes: eb36f28ff721 ("mmc: cv1800b: Add sdhci driver support for cv1800b SoC")
>Signed-off-by: Hiago De Franco <hfranco@baylibre.com>

Reviewed-by: Peng Fan <peng.fan@nxp.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-13 11:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 23:48 [PATCH] mmc: cv1800b_sdhci: honor 'no-1-8-v' DT property Hiago De Franco
2026-05-13 11:04 ` Peng Fan

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