Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399
@ 2026-09-22  5:50 Yaozhong Li
  2026-11-01 15:44 ` Yaozhong Li
  2026-11-01 16:10 ` Shawn Lin
  0 siblings, 2 replies; 4+ messages in thread
From: Yaozhong Li @ 2026-09-22  5:50 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: Rob Herring, linux-arm-kernel, linux-rockchip, Yaozhong Li

The SD slot on this board stays at 50 MHz with 3.3V signalling. The
sdmmc node lacks both a UHS capability and its vqmmc-supply, so the
kernel never attempts the CMD11 signal voltage switch. The vendor
shipping firmware device tree declares sd-uhs-sdr104 here and points
vqmmc-supply at RK808 LDO4 (vcc_sdio), which can switch between 1.8V
and 3.0V.

Declaring those two properties alone is not enough. vcc_sdio is also
listed as the vmmc-supply of the WiFi SDIO node, and that consumer keeps
the rail from being taken down:

  vcc_sdio: Restricting voltage, 3000000-1950000uV
  mmc1: error -110 whilst initialising SD card

Using the same regulator for the WiFi card's power and for the SD card's
IO voltage is inconsistent with UHS-I operation on this board. The
vendor device tree reads it the second way: there vcc_sdio is referenced
only by the SD slot's vqmmc-supply and by the io-domains sdmmc-supply,
while the WiFi SDIO node declares no vmmc-supply at all. The WiFi module
also remained operational with the rail at 1.8V. Its own IO rail is
described separately and is left alone:

  vqmmc-supply = <&vcc1v8_s3>;	/* IO line */

That property had no effect for several years: it was added without the
brackets that make it a phandle, so it was an inert string until that
was corrected.

Drop it and declare the two properties the SD slot needs.

Tested on a Firefly-RK3399 running an Armbian 6.18.45 kernel with the
board-local device tree blob. With sd-uhs-sdr104 and the sdmmc
vqmmc-supply in place, toggling only the sdio0 vmmc-supply property, in
both directions:

  with it:    mmc1: error -110 whilst initialising SD card, then
              sd high-speed, signal voltage 3.30 V, 50 MHz
  without it: sd uhs SDR104, signal voltage 1.80 V, 148.5 MHz

Sequential read goes from 22 MB/s to 60 MB/s with a 64GB SDXC card. WiFi
remained associated at 5 GHz, -50 dBm, with no kernel errors.

Assisted-by: LLM
Signed-off-by: Yaozhong Li <yaozhonguwl@gmail.com>
---
Notes on testing, which does not belong in the permanent log:

The DTB built from the unmodified mainline DTS was not runtime-tested
with a matching mainline kernel. Built from mainline DTS and booted with
the Armbian kernel available on this board, it hangs in early boot,
before MMC initialisation, so nothing could be measured from it and no
claim is made that the patched artifact itself was boot-tested. That
baseline failure happens without this change applied and is independent
of it. The DTS was compiled and the resulting DTB inspected.

I have no schematic for this board. The claim about what LDO4 feeds
rests on the vendor firmware device tree plus the measurements above.

The analysis and the commit message were drafted with the help of an
LLM-based assistant (Claude Code), cross-reviewed with a second one
(OpenAI Codex). The device tree change, the measurements and the final
wording are mine.

 arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
index 0568dfa..7cabbc1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
@@ -777,7 +777,6 @@ &sdio0 {
 
 	/* Power supply */
 	vqmmc-supply = <&vcc1v8_s3>;	/* IO line */
-	vmmc-supply = <&vcc_sdio>;	/* card's power */
 
 	#address-cells = <1>;
 	#size-cells = <0>;
@@ -804,6 +803,8 @@ &sdmmc {
 	max-frequency = <150000000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
+	sd-uhs-sdr104;
+	vqmmc-supply = <&vcc_sdio>;
 	status = "okay";
 };
 

base-commit: 940de590b839f71d6dc846160534bf202401b8b7
-- 
2.55.0.windows.3



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

* Re: [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399
  2026-09-22  5:50 [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399 Yaozhong Li
@ 2026-11-01 15:44 ` Yaozhong Li
  2026-11-01 16:10 ` Shawn Lin
  1 sibling, 0 replies; 4+ messages in thread
From: Yaozhong Li @ 2026-11-01 15:44 UTC (permalink / raw)
  To: Heiko Stuebner; +Cc: Rob Herring, linux-arm-kernel, linux-rockchip, Yaozhong Li

Hi Heiko,

Gentle ping on this one. It still applies cleanly to current mainline.
Please let me know if you would like anything changed.

Thanks,
Yaozhong


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

* Re: [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399
  2026-09-22  5:50 [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399 Yaozhong Li
  2026-11-01 15:44 ` Yaozhong Li
@ 2026-11-01 16:10 ` Shawn Lin
  2026-11-01 17:55   ` Heiko Stuebner
  1 sibling, 1 reply; 4+ messages in thread
From: Shawn Lin @ 2026-11-01 16:10 UTC (permalink / raw)
  To: Yaozhong Li, Heiko Stuebner
  Cc: shawn.lin, Rob Herring, linux-arm-kernel, linux-rockchip

在 2026/09/22 星期二 13:50, Yaozhong Li 写道:
> The SD slot on this board stays at 50 MHz with 3.3V signalling. The

...

> 
> I have no schematic for this board. The claim about what LDO4 feeds
> rests on the vendor firmware device tree plus the measurements above.
> 

It's easy to find one:
https://github.com/armbian/armbian.github.io/blob/main/board-schematics/firefly-rk3399.pdf

Too bad it was designed this way! What if sdio-wifi is working on UHS
modebut people insert a HighSpeed only sd card?

> The analysis and the commit message were drafted with the help of an
> LLM-based assistant (Claude Code), cross-reviewed with a second one
> (OpenAI Codex). The device tree change, the measurements and the final
> wording are mine.
> 
>   arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> index 0568dfa..7cabbc1 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> @@ -777,7 +777,6 @@ &sdio0 {
>   
>   	/* Power supply */
>   	vqmmc-supply = <&vcc1v8_s3>;	/* IO line */
> -	vmmc-supply = <&vcc_sdio>;	/* card's power */
>   
>   	#address-cells = <1>;
>   	#size-cells = <0>;
> @@ -804,6 +803,8 @@ &sdmmc {
>   	max-frequency = <150000000>;
>   	pinctrl-names = "default";
>   	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
> +	sd-uhs-sdr104;
> +	vqmmc-supply = <&vcc_sdio>;
>   	status = "okay";
>   };
>   
> 
> base-commit: 940de590b839f71d6dc846160534bf202401b8b7



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

* Re: [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399
  2026-11-01 16:10 ` Shawn Lin
@ 2026-11-01 17:55   ` Heiko Stuebner
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2026-11-01 17:55 UTC (permalink / raw)
  To: Yaozhong Li, Shawn Lin
  Cc: shawn.lin, Rob Herring, linux-arm-kernel, linux-rockchip

Am Sonntag, 1. November 2026, 17:10:04 Mitteleuropäische Normalzeit schrieb Shawn Lin:
> 在 2026/09/22 星期二 13:50, Yaozhong Li 写道:
> > The SD slot on this board stays at 50 MHz with 3.3V signalling. The
> 
> ...
> 
> > 
> > I have no schematic for this board. The claim about what LDO4 feeds
> > rests on the vendor firmware device tree plus the measurements above.
> > 
> 
> It's easy to find one:
> https://github.com/armbian/armbian.github.io/blob/main/board-schematics/firefly-rk3399.pdf
> 
> Too bad it was designed this way! What if sdio-wifi is working on UHS
> modebut people insert a HighSpeed only sd card?

Hmm, when I read the schematics correctly, all parts of the sdio + wifi
supplied by vcc_1v8 (both APIO3_VDD_1V8 and also vddio of the wifi module
itself), while vcc_sdio only supplies SDMMC0_VDD?


Yaozhong Li: please trim that commit message down a lot, it doesn't
have to be novel size please.


Heiko

> 
> > The analysis and the commit message were drafted with the help of an
> > LLM-based assistant (Claude Code), cross-reviewed with a second one
> > (OpenAI Codex). The device tree change, the measurements and the final
> > wording are mine.
> > 
> >   arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> > index 0568dfa..7cabbc1 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> > +++ b/arch/arm64/boot/dts/rockchip/rk3399-firefly.dts
> > @@ -777,7 +777,6 @@ &sdio0 {
> >   
> >   	/* Power supply */
> >   	vqmmc-supply = <&vcc1v8_s3>;	/* IO line */
> > -	vmmc-supply = <&vcc_sdio>;	/* card's power */
> >   
> >   	#address-cells = <1>;
> >   	#size-cells = <0>;
> > @@ -804,6 +803,8 @@ &sdmmc {
> >   	max-frequency = <150000000>;
> >   	pinctrl-names = "default";
> >   	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
> > +	sd-uhs-sdr104;
> > +	vqmmc-supply = <&vcc_sdio>;
> >   	status = "okay";
> >   };
> >   
> > 
> > base-commit: 940de590b839f71d6dc846160534bf202401b8b7
> 
> 






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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-22  5:50 [PATCH] arm64: dts: rockchip: enable SD UHS-I on Firefly-RK3399 Yaozhong Li
2026-11-01 15:44 ` Yaozhong Li
2026-11-01 16:10 ` Shawn Lin
2026-11-01 17:55   ` Heiko Stuebner

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