Subject: [PATCH 0/3] arm64: dts: rockchip: Enable M.2 B-key slot and fan on Radxa ROCK 3B
Subsystems (2)
cover Subject: [PATCH 0/3] arm64: dts: rockchip: Enable M.2 B-key slot and fan on Radxa ROCK 3B
The Radxa ROCK 3B has an M.2 B-key slot intended for 4G/5G modules and a 2-pin fan header, neither of which is currently described in the mainline device tree.
Patch 1 enables the second USB 2.0 host controller, which serves the USB lines of the B-key slot. Patch 2 describes the power, reset and W_DISABLE# controls of the slot. Patch 3 adds the PWM fan and ties it to the CPU thermal zone.
Pin assignments were checked against the ROCK 3B V1.51 schematic. Tested on a ROCK 3B with a SIMCom SIM7600G-H module and a 5V fan, running Linux 6.12 (OpenWrt) with the same changes applied.
Adam Wermuth (3):
arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
arm64: dts: rockchip: Enable M.2 B-key WWAN slot on Radxa ROCK 3B
arm64: dts: rockchip: Add PWM fan to Radxa ROCK 3B
.../boot/dts/rockchip/rk3568-rock-3b.dts | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+)
base-commit: 23d8f49fcae5d72b77744c7f349c12462c3bb748
Signature · 1 line
2.43.0
PATCH 1/3 arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
The USB 2.0 data lines of the M.2 B-key slot are routed to USB2_HOST3, which is served by usb_host1_ehci/ohci through the host port of usb2phy1. Enable the controllers and the PHY port so that modules in the B-key slot, such as LTE modems, can enumerate.
--- arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +13 -0
@@ -758,6 +758,14 @@ &usb_host0_xhci { status = "okay"; }; +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + &usb_host1_xhci { status = "okay"; };
@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] dts: false 5V VBUS dependency for M.2 WWAN slot --
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dts: false 5V VBUS dependency for M.2 WWAN slot
--
commit 87931f73c3a7da52681aaf73a831d1638bf48ff3
Author: Adam Wermuth <[email protected]>
arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
This commit routes the USB 2.0 data lines of the M.2 B-key slot to USB2_HOST3 by enabling the ehci/ohci controllers and the usb2phy1 host port, allowing LTE modems and other modules to enumerate.
Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +0
-0
[ ... ]
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts &usb2phy1 { · line 792
Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +2
-0@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>;
[Severity: Medium]
Does this create a false 5V VBUS dependency for the M.2 WWAN slot?
The M.2 specification dictates 3.3V power and no VBUS pin. By associating the 5V external Type-A VBUS regulator (vcc5v0_usb_host) with the M.2 slot's PHY here, the PHY core will automatically enable this regulator when initialized.
Will this force the 5V rail to remain active as long as the M.2 LTE modem's USB PHY is active, leading to unnecessary power consumption even when external ports are unused?
Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +3
-0+ status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Re: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
In reply to Adam WermuthHi Adam,
Quoted 4 lines · Adam Wermuth
The USB 2.0 data lines of the M.2 B-key slot are routed to
USB2_HOST3, which is served by usb_host1_ehci/ohci through the host port of usb2phy1. Enable the controllers and the PHY port so that modules in the B-key slot, such as LTE modems, can enumerate.
This and next patch is likely best suited as an dt-overlay.
Regards,
Jonas
Quoted 37 lines
Signed-off-by Adam Wermuth <[email protected]>--- arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +13
-0@@ -758,6 +758,14 @@ &usb_host0_xhci { status = "okay"; }; +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + &usb_host1_xhci { status = "okay"; };@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
Re: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
Hi Jonas,
Quoted 1 line · Jonas Karlman
This and next patch is likely best suited as an dt-overlay.
Thanks for the review. That makes sense, as the B-key slot is not always populated.
For v2 I will move the host1 enablement and the WWAN power, RESET# and W_DISABLE1# handling into a new rk3568-rock-3b-wwan.dtso overlay, and keep only the fan patch in the base DT.
Adam
czw., 24 wrz 2026 o 18:12 Jonas Karlman <[email protected]> napisał(a):
Quoted 52 lines
Hi Adam,
Quoted 4 lines · Adam Wermuth
The USB 2.0 data lines of the M.2 B-key slot are routed to
USB2_HOST3, which is served by usb_host1_ehci/ohci through the host port of usb2phy1. Enable the controllers and the PHY port so that modules in the B-key slot, such as LTE modems, can enumerate.This and next patch is likely best suited as an dt-overlay.
Regards,
JonasQuoted 37 lines
Signed-off-by Adam Wermuth <[email protected]>--- arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +13
-0@@ -758,6 +758,14 @@ &usb_host0_xhci { status = "okay"; }; +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + &usb_host1_xhci { status = "okay"; };@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
Re: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
Hi,
Quoted 9 lines · Adam Wermuth
Quoted 1 line · Jonas Karlman
This and next patch is likely best suited as an dt-overlay.
Thanks for the review. That makes sense, as the B-key slot is not always populated.
For v2 I will move the host1 enablement and the WWAN power, RESET# and W_DISABLE1# handling into a new rk3568-rock-3b-wwan.dtso overlay, and keep only the fan patch in the base DT.
Why would this be better suited as an Overlay? Nothing describes the specific card plugged in as it is auto-discovered via USB. The overlays are mostly required for things that cannot easily be auto-detected. FWIW we don't have M.2 Key M as a DT overlay either.
Something to consider is, that for Key E and Key M there is a proper DT binding now: Documentation/devicetree/bindings/connector/pcie-m2-*.yaml
We probably want the same for Key B.
Greetings,
-- Sebastian
Quoted 56 lines
czw., 24 wrz 2026 o 18:12 Jonas Karlman <[email protected]> napisał(a):
Quoted 52 lines
Hi Adam,
Quoted 4 lines · Adam Wermuth
The USB 2.0 data lines of the M.2 B-key slot are routed to
USB2_HOST3, which is served by usb_host1_ehci/ohci through the host port of usb2phy1. Enable the controllers and the PHY port so that modules in the B-key slot, such as LTE modems, can enumerate.This and next patch is likely best suited as an dt-overlay.
Regards,
JonasQuoted 37 lines
Signed-off-by Adam Wermuth <[email protected]>--- arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +13
-0@@ -758,6 +758,14 @@ &usb_host0_xhci { status = "okay"; }; +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + &usb_host1_xhci { status = "okay"; };@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
Re: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
Hi,
Quoted 4 lines · Sebastian Reichel
Why would this be better suited as an Overlay? Nothing describes the specific card plugged in as it is auto-discovered via USB. The overlays are mostly required for things that cannot easily be auto-detected. FWIW we don't have M.2 Key M as a DT overlay either.
The overlay was Jonas' suggestion, so I'll let him explain his reasoning. My own understanding was that it would avoid powering the slot (always-on supply plus RESET#/W_DISABLE1# hogs) on boards where nothing is plugged in.
That said, I agree that the module itself is auto-discovered via USB, and the Key M slot on this board is described in the base DT as well, so I'm fine with keeping the B-key slot there, as in v1.
Quoted 4 lines
Something to consider is, that for Key E and Key M there is a proper DT binding now:
Documentation/devicetree/bindings/connector/pcie-m2-*.yamlWe probably want the same for Key B.
Thanks for the pointer. As far as I can see, a Key B binding would also need driver support to handle the supply, RESET# and W_DISABLE1#, so it is a larger piece of work. Would it be acceptable to describe the slot in the base DT for now and move to a connector binding once one exists for Key B?
Jonas, Heiko, what do you think?
The fan patch is independent of this, so I could resend it on its own in the meantime.
Adam
pt., 25 wrz 2026 o 15:26 Sebastian Reichel
<[email protected]> napisał(a):
Quoted 85 lines
Hi,
Quoted 9 lines · Adam Wermuth
Quoted 1 line · Jonas Karlman
This and next patch is likely best suited as an dt-overlay.
Thanks for the review. That makes sense, as the B-key slot is not always populated.
For v2 I will move the host1 enablement and the WWAN power, RESET# and W_DISABLE1# handling into a new rk3568-rock-3b-wwan.dtso overlay, and keep only the fan patch in the base DT.
Why would this be better suited as an Overlay? Nothing describes the specific card plugged in as it is auto-discovered via USB. The overlays are mostly required for things that cannot easily be auto-detected. FWIW we don't have M.2 Key M as a DT overlay either.
Something to consider is, that for Key E and Key M there is a proper DT binding now:
Documentation/devicetree/bindings/connector/pcie-m2-*.yamlWe probably want the same for Key B.
Greetings,
-- Sebastian
Quoted 56 lines
czw., 24 wrz 2026 o 18:12 Jonas Karlman <[email protected]> napisał(a):
Quoted 52 lines
Hi Adam,
Quoted 4 lines · Adam Wermuth
The USB 2.0 data lines of the M.2 B-key slot are routed to
USB2_HOST3, which is served by usb_host1_ehci/ohci through the host port of usb2phy1. Enable the controllers and the PHY port so that modules in the B-key slot, such as LTE modems, can enumerate.This and next patch is likely best suited as an dt-overlay.
Regards,
JonasQuoted 37 lines
Signed-off-by Adam Wermuth <[email protected]>--- arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +13
-0@@ -758,6 +758,14 @@ &usb_host0_xhci { status = "okay"; }; +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + &usb_host1_xhci { status = "okay"; };@@ -780,6 +788,11 @@ &usb2phy1 { status = "okay"; }; +&usb2phy1_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + &usb2phy1_otg { phy-supply = <&vcc5v0_usb_host>; status = "okay";
Re: [PATCH 1/3] arm64: dts: rockchip: Enable USB 2.0 host1 on Radxa ROCK 3B
Quoted 21 lines · Adam Wermuth
Hi,
Quoted 4 lines · Sebastian Reichel
Why would this be better suited as an Overlay? Nothing describes the specific card plugged in as it is auto-discovered via USB. The overlays are mostly required for things that cannot easily be auto-detected. FWIW we don't have M.2 Key M as a DT overlay either.
The overlay was Jonas' suggestion, so I'll let him explain his reasoning. My own understanding was that it would avoid powering the slot (always-on supply plus RESET#/W_DISABLE1# hogs) on boards where nothing is plugged in.
That said, I agree that the module itself is auto-discovered via USB, and the Key M slot on this board is described in the base DT as well, so I'm fine with keeping the B-key slot there, as in v1.
Quoted 3 lines
Something to consider is, that for Key E and Key M there is a proper DT binding now:
Documentation/devicetree/bindings/connector/pcie-m2-*.yaml
Quoted 7 lines
Quoted 1 line
We probably want the same for Key B.
Thanks for the pointer. As far as I can see, a Key B binding would also need driver support to handle the supply, RESET# and W_DISABLE1#, so it is a larger piece of work. Would it be acceptable to describe the slot in the base DT for now and move to a connector binding once one exists for Key B?
Key B binding would be somewhat more involved than key E or key M. The spec defines 16 distinct interface mux configurations selected by the four CONFIG_X pins, which neither key M nor key E have (PCIe vs. SATA, USB3 vs. SSIC, different audio configs, different I2C configs, etc.). So it's a bit more than the supply, RESET# and W_DISABLE1#.
See for example [1] where just the PCIe vs. SATA selection is defined. A proper binding will be needed sooner or later, though.
Best regards,
Alexey
PATCH 2/3 arm64: dts: rockchip: Enable M.2 B-key WWAN slot on Radxa ROCK 3B
In reply to Adam WermuthThe M.2 B-key slot on the ROCK 3B is controlled by three GPIOs:
- GPIO0_C6 (4G_PWREN_H) enables the 3.3V supply of the slot, which is generated from vcc5v0_sys by a dedicated buck converter,
- GPIO0_D6 (4G_RESET) drives the RESET# signal of the slot,
- GPIO1_B0 (4G_DISABLE) drives W_DISABLE1#.
Unless the supply is enabled and both active-low signals are deasserted, the module never enumerates on USB. Describe the supply as an always-on fixed regulator and hog RESET# and W_DISABLE1# in their inactive state.
Tested with a SIMCom SIM7600G-H module.
--- .../boot/dts/rockchip/rk3568-rock-3b.dts | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +38 -0
@@ -98,6 +98,20 @@ vcc3v3_sys2: regulator-3v3-vcc-sys2 { vin-supply = <&vcc5v0_sys>; }; + vcc3v3_wwan: regulator-3v3-vcc-wwan { + compatible = "regulator-fixed"; + enable-active-high; + gpios = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&wwan_pwren_h>; + regulator-name = "vcc3v3_wwan"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc5v0_sys>; + }; + vcc5v0_sys: regulator-5v0-vcc-sys { compatible = "regulator-fixed"; regulator-name = "vcc5v0_sys";
@@ -220,6 +234,24 @@ &gmac1m1_rgmii_bus status = "okay"; }; +&gpio0 { + wwan-reset-hog { + gpio-hog; + gpios = <RK_PD6 GPIO_ACTIVE_LOW>; + output-low; + line-name = "wwan-reset"; + }; +}; + +&gpio1 { + wwan-disable-hog { + gpio-hog; + gpios = <RK_PB0 GPIO_ACTIVE_LOW>; + output-low; + line-name = "wwan-w-disable"; + }; +}; + &gpu { mali-supply = <&vdd_gpu>; status = "okay";
@@ -655,6 +687,12 @@ wifi_wake_host_h: wifi-wake-host-h { rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; }; }; + + wwan { + wwan_pwren_h: wwan-pwren-h { + rockchip,pins = <0 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; }; &pmu_io_domains {
Signature · 1 line
2.43.0
PATCH 3/3 arm64: dts: rockchip: Add PWM fan to Radxa ROCK 3B
In reply to Adam WermuthThe ROCK 3B has a 2-pin fan header powered from vcc5v0_sys and switched by a MOSFET driven from PWM8 (pwm8m0 pins). Enable the PWM controller, describe the fan as a pwm-fan cooling device and add active trip points to the CPU thermal zone:
- 50 C: fan at 25%
- 60 C: fan at 50-75%
- 70 C: fan at 100%
each with 5 C hysteresis. The existing passive and critical trip points are left unchanged.
--- .../boot/dts/rockchip/rk3568-rock-3b.dts | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+)
arch/arm64/boot/dts/rockchip/rk3568-rock-3b.dts +51 -0
@@ -24,6 +24,14 @@ chosen { stdout-path = "serial2:1500000n8"; }; + fan: fan { + compatible = "pwm-fan"; + cooling-levels = <0 64 128 192 255>; + fan-supply = <&vcc5v0_sys>; + pwms = <&pwm8 0 10000 0>; + #cooling-cells = <2>; + }; + hdmi-con { compatible = "hdmi-connector"; type = "a";
@@ -200,6 +208,45 @@ &cpu3 { cpu-supply = <&vdd_cpu>; }; +&cpu_thermal { + trips { + cpu_fan0: cpu-fan0 { + hysteresis = <5000>; + temperature = <50000>; + type = "active"; + }; + + cpu_fan1: cpu-fan1 { + hysteresis = <5000>; + temperature = <60000>; + type = "active"; + }; + + cpu_fan2: cpu-fan2 { + hysteresis = <5000>; + temperature = <70000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cpu_fan0>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map2 { + trip = <&cpu_fan1>; + cooling-device = <&fan 2 3>; + }; + + map3 { + trip = <&cpu_fan2>; + cooling-device = <&fan 4 THERMAL_NO_LIMIT>; + }; + }; +}; + &gmac0 { assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>; assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
@@ -708,6 +755,10 @@ &pmu_io_domains { status = "okay"; }; +&pwm8 { + status = "okay"; +}; + &saradc { vref-supply = <&vcca_1v8>; status = "okay";
Signature · 1 line
2.43.0