[PATCH 0/4] mmc: dw_mmc: Allow use of in-spec voltage range for vqmmc-supply

Jonas Karlman jonas at kwiboo.se
Sun Jun 28 12:25:22 CEST 2026


The Rockchip RK3399 SoC SDMMC IO domain supports 1.8V and 3.0V mode, so
vqmmc-supply for SD-cards is typically limited to max 3.0V to avoid
damage to the SoC.

The SD Standards allow for an operating voltage range of 1.70V-1.95V and
2.7V-3.6V, meaning the 3.0V mode follows spec.

The commit 0b75109b6aaf ("mmc: dw_mmc: return error for invalid voltage
setting") help enforce strict 1.8V and 3.3V when setting vqmmc-supply
making mmc_set_signal_voltage() possible fail for MMC_SIGNAL_VOLTAGE_330
and can lead to an improper switch to MMC_SIGNAL_VOLTAGE_180.

This series adds a regulator_set_value_clamp() helper set voltage value
within a requested voltage range instead of an exact value, and changes
dw_mmc to use this helper to set a voltage within in-spec range to fix
use of SD-cards with 3.3V signal voltage on Rockchip RK3399 boards using
MMC_IO_VOLTAGE=y.

Jonas Karlman (4):
  power: regulator: Add helper to set voltage within an acceptable range
  test: dm: regulator: Add regulator_set_value_clamp() tests
  mmc: dw_mmc: Allow use of in-spec voltage range for vqmmc-supply
  mmc: sdhci: Use CONFIG_IS_ENABLED for MMC_IO_VOLTAGE

 arch/sandbox/dts/sandbox_pmic.dtsi         |  6 ++++
 doc/usage/cmd/dm.rst                       |  3 +-
 drivers/mmc/dw_mmc.c                       |  6 ++--
 drivers/mmc/sdhci.c                        |  2 +-
 drivers/power/regulator/regulator-uclass.c | 27 +++++++++++++++
 drivers/power/regulator/sandbox.c          | 11 ++++---
 include/power/regulator.h                  | 12 +++++++
 include/power/sandbox_pmic.h               | 15 +++++++--
 test/dm/regulator.c                        | 38 ++++++++++++++++++++++
 9 files changed, 109 insertions(+), 11 deletions(-)

-- 
2.54.0



More information about the U-Boot mailing list