* [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards
@ 2026-11-01 19:28 Coia Prant
2026-11-01 19:28 ` [PATCH 1/5] arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4 Coia Prant
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant
This series fixes two classes of board-level issues found while
bringing up several RK3568 boards.
The first four patches address GMAC clock parents. On these boards the
DTS lists SCLK_GMACx in assigned-clocks but only provides a parent for
SCLK_GMACx_RX_TX, so SCLK_GMACx keeps whatever parent the bootloader or
the hardware reset left. Add CLK_MACx_2TOP explicitly so the GMAC main
clock always comes from the internal source. BPI-R2 Pro additionally
describes clock_in_out wrongly ("input" while the port is a fixed-link
with no external 125 MHz clock); switch it to "output" to match the
hardware. On RK3568 clock_in_out does not change the hardware clock
routing today, so that part is a description fix.
The last patch fixes USB OTG power on the Ariaboard Photonicat. On
battery power the USB port is dead because usb2phy0_otg is fed from a
regulator that only exists when the DC input is present. Add a boost
regulator gated by the existing vcc5v0_usb30_otg0 rail and switch the
PHY supply to it, restoring USB host functionality on battery.
---
Coia Prant (5):
arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4
arm64: dts: rockchip: fix GMAC clock parents on Graperain G3568 v2
arm64: dts: rockchip: fix GMAC clock setup on BPI-R2 Pro
arm64: dts: rockchip: fix GMAC clock parent on Photonicat
arm64: dts: rockchip: fix USB OTG power on Photonicat in battery mode
.../dts/rockchip/rk3568-9tripod-x3568-v4.dts | 4 ++--
.../boot/dts/rockchip/rk3568-bpi-r2-pro.dts | 4 +++-
.../rockchip/rk3568-graperain-g3568-v2.dts | 4 ++--
.../boot/dts/rockchip/rk3568-photonicat.dts | 21 +++++++++++++++++--
4 files changed, 26 insertions(+), 7 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
@ 2026-11-01 19:28 ` Coia Prant
2026-11-01 19:28 ` [PATCH 2/5] arm64: dts: rockchip: fix GMAC clock parents on Graperain G3568 v2 Coia Prant
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant
Both GMAC nodes list SCLK_GMACx in assigned-clocks, but only
SCLK_GMACx_RX_TX gets a parent in assigned-clock-parents. SCLK_GMACx
therefore keeps whatever parent the bootloader or the hardware reset
left, which may or may not be the internal CLK_MACx_2TOP.
Add CLK_MACx_2TOP as the parent of SCLK_GMACx explicitly, so the GMAC
main clock always comes from the internal clock source and does not
depend on the bootloader state. The rate assignment is unchanged:
SCLK_GMACx_RX_TX stays at 0 (managed at runtime by
rk_set_clk_tx_rate()), SCLK_GMACx stays at 125 MHz.
Fixes: 156a530ed5ed ("arm64: dts: rockchip: Add devicetree for the 9Tripod X3568 v4")
Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3568-9tripod-x3568-v4.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-9tripod-x3568-v4.dts b/arch/arm64/boot/dts/rockchip/rk3568-9tripod-x3568-v4.dts
index 4903e32d0ead0..d94bc34a31e67 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-9tripod-x3568-v4.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-9tripod-x3568-v4.dts
@@ -268,7 +268,7 @@ &cpu3 {
&gmac0 {
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
- assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
pinctrl-names = "default";
@@ -284,7 +284,7 @@ &gmac0_rgmii_clk
&gmac1 {
assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
- assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
pinctrl-names = "default";
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] arm64: dts: rockchip: fix GMAC clock parents on Graperain G3568 v2
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
2026-11-01 19:28 ` [PATCH 1/5] arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4 Coia Prant
@ 2026-11-01 19:28 ` Coia Prant
2026-11-01 19:28 ` [PATCH 3/5] arm64: dts: rockchip: fix GMAC clock setup on BPI-R2 Pro Coia Prant
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant
Both GMAC nodes list SCLK_GMACx in assigned-clocks, but only
SCLK_GMACx_RX_TX gets a parent in assigned-clock-parents. SCLK_GMACx
therefore keeps whatever parent the bootloader or the hardware reset
left, which may or may not be the internal CLK_MACx_2TOP.
Add CLK_MACx_2TOP as the parent of SCLK_GMACx explicitly, so the GMAC
main clock always comes from the internal clock source and does not
depend on the bootloader state. The rate assignment is unchanged:
SCLK_GMACx_RX_TX stays at 0 (managed at runtime by
rk_set_clk_tx_rate()), SCLK_GMACx stays at 125 MHz.
Fixes: f296bb503a24 ("arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2")
Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts b/arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts
index 4c55c7d211599..07cfc68b5f91b 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts
@@ -280,7 +280,7 @@ &cpu3 {
&gmac0 {
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
- assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
+ assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
pinctrl-names = "default";
@@ -296,7 +296,7 @@ &gmac0_rgmii_clk
&gmac1 {
assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
- assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
pinctrl-names = "default";
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] arm64: dts: rockchip: fix GMAC clock setup on BPI-R2 Pro
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
2026-11-01 19:28 ` [PATCH 1/5] arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4 Coia Prant
2026-11-01 19:28 ` [PATCH 2/5] arm64: dts: rockchip: fix GMAC clock parents on Graperain G3568 v2 Coia Prant
@ 2026-11-01 19:28 ` Coia Prant
2026-11-01 19:28 ` [PATCH 4/5] arm64: dts: rockchip: fix GMAC clock parent on Photonicat Coia Prant
2026-11-01 19:28 ` [PATCH 5/5] arm64: dts: rockchip: fix USB OTG power on Photonicat in battery mode Coia Prant
4 siblings, 0 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant
Both GMAC nodes rely on the internal 125 MHz GMAC main clock, but
neither pins its rate explicitly. Add assigned-clock-rates = <0>,
<125000000> so SCLK_GMACx is fixed at 125 MHz instead of whatever the
bootloader or the hardware reset left. The RGMII speed clock
(SCLK_GMACx_RX_TX) stays at 0, since it is managed at runtime by
rk_set_clk_tx_rate().
For gmac0, also switch clock_in_out from "input" to "output". The port
uses a fixed-link, and there is no external 125 MHz clock feeding the
MAC, so "input" described a clock source that is not wired up. Note
that on RK3568 clock_in_out does not change the hardware clock routing
today (rk3568_ops has no io_clksel masks), so this corrects the
description rather than the behaviour.
Fixes: f901aaadaa2a ("arm64: dts: rockchip: Add Bananapi R2 Pro")
Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
index 4d3ebe50b90ba..677b6261a3a1e 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-bpi-r2-pro.dts
@@ -206,7 +206,8 @@ &combphy2 {
&gmac0 {
assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>, <&cru CLK_MAC0_2TOP>;
- clock_in_out = "input";
+ assigned-clock-rates = <0>, <125000000>;
+ clock_in_out = "output";
phy-mode = "rgmii";
pinctrl-names = "default";
pinctrl-0 = <&gmac0_miim
@@ -232,6 +233,7 @@ fixed-link {
&gmac1 {
assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
+ assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
phy-handle = <&rgmii_phy1>;
phy-mode = "rgmii";
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] arm64: dts: rockchip: fix GMAC clock parent on Photonicat
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
` (2 preceding siblings ...)
2026-11-01 19:28 ` [PATCH 3/5] arm64: dts: rockchip: fix GMAC clock setup on BPI-R2 Pro Coia Prant
@ 2026-11-01 19:28 ` Coia Prant
2026-11-01 19:28 ` [PATCH 5/5] arm64: dts: rockchip: fix USB OTG power on Photonicat in battery mode Coia Prant
4 siblings, 0 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant
The RGMII WAN port on the Ariaboard Photonicat uses SCLK_GMAC1 as the
GMAC main clock and SCLK_GMAC1_RX_TX as the RGMII speed clock. Only the
parent of SCLK_GMAC1_RX_TX is set, so SCLK_GMAC1 keeps whatever parent
the bootloader or the hardware reset left.
Set the parent of SCLK_GMAC1 to CLK_MAC1_2TOP explicitly, so the GMAC
main clock always uses the internal source and does not depend on the
bootloader state. The rate assignment is unchanged: SCLK_GMAC1_RX_TX
keeps its rate unset, SCLK_GMAC1 stays at 125 MHz.
Fixes: ba124e06ce7b ("arm64: dts: rockchip: add dts for Ariaboard Photonicat RK3568")
Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
index b719d5b661c43..7e0a2ab829209 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
@@ -285,7 +285,7 @@ &gmac0 {
/* Motorcomm YT8521SC WAN port */
&gmac1 {
assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
- assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+ assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
assigned-clock-rates = <0>, <125000000>;
clock_in_out = "output";
phy-handle = <&rgmii_phy>;
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] arm64: dts: rockchip: fix USB OTG power on Photonicat in battery mode
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
` (3 preceding siblings ...)
2026-11-01 19:28 ` [PATCH 4/5] arm64: dts: rockchip: fix GMAC clock parent on Photonicat Coia Prant
@ 2026-11-01 19:28 ` Coia Prant
4 siblings, 0 replies; 6+ messages in thread
From: Coia Prant @ 2026-11-01 19:28 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Andrew Lunn,
Frank Wunderlich, Peter Geis, Junhao Xie, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Coia Prant,
stable
When the Ariaboard Photonicat runs on battery, the USB port has no power
output and attached devices are not detected. With the external supply
connected, the same port works fine. The root cause is that the
regulator feeding usb2phy0_otg (vcc5v0_usb30_otg0) is only available
from the external DC input, and there is no 5V rail for the USB PHY
when the board is powered from the battery.
Add a vcc5v0_usb30_otg0_boost regulator, gated by vcc5v0_usb30_otg0,
and switch usb2phy0_otg to use it as its phy-supply. The boost converter
is enabled through GPIO4_D2 and generates the 5V USB VBUS from the
vccin_5v rail. Note that vccin_5v is the actual energy source, while
vcc5v0_usb30_otg0 gates the path; vin-supply is modelled on the gate so
the regulator core enables it before the boost.
This restores USB host functionality on battery power, matching the
vendor firmware behaviour.
Link: https://github.com/immortalwrt/immortalwrt/issues/1534
Fixes: ba124e06ce7b ("arm64: dts: rockchip: add dts for Ariaboard Photonicat RK3568")
Cc: stable@vger.kernel.org
Signed-off-by: Coia Prant <coiaprant@gmail.com>
---
.../boot/dts/rockchip/rk3568-photonicat.dts | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
index 7e0a2ab829209..bcdfe76000c46 100644
--- a/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3568-photonicat.dts
@@ -151,6 +151,19 @@ vcc5v0_usb30_otg0: regulator-vcc5v0-usb30-otg0 {
vin-supply = <&vccin_5v>;
};
+ /* actually fed by vccin_5v, dependent on vcc5v0_usb30_otg0 */
+ vcc5v0_usb30_otg0_boost: regulator-vcc5v0-boost {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vcc5v0_boost_en>;
+ regulator-name = "vcc5v0_boost";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&vcc5v0_usb30_otg0>;
+ };
+
vccin_5v: regulator-vccin-5v {
compatible = "regulator-fixed";
regulator-name = "vccin_5v";
@@ -460,6 +473,10 @@ rf_pwr_en: rf-pwr-en {
usb_host_pwren_h: usb-host-pwren-h {
rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
};
+
+ vcc5v0_boost_en: vcc5v0-boost-en {
+ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
};
wifi {
@@ -617,7 +634,7 @@ &usb2phy0_host {
};
&usb2phy0_otg {
- phy-supply = <&vcc5v0_usb30_otg0>;
+ phy-supply = <&vcc5v0_usb30_otg0_boost>;
status = "okay";
};
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-11-01 19:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-01 19:28 [PATCH 0/5] arm64: dts: rockchip: fix GMAC clocks and USB OTG power on RK3568 boards Coia Prant
2026-11-01 19:28 ` [PATCH 1/5] arm64: dts: rockchip: fix GMAC clock parents on 9Tripod X3568 v4 Coia Prant
2026-11-01 19:28 ` [PATCH 2/5] arm64: dts: rockchip: fix GMAC clock parents on Graperain G3568 v2 Coia Prant
2026-11-01 19:28 ` [PATCH 3/5] arm64: dts: rockchip: fix GMAC clock setup on BPI-R2 Pro Coia Prant
2026-11-01 19:28 ` [PATCH 4/5] arm64: dts: rockchip: fix GMAC clock parent on Photonicat Coia Prant
2026-11-01 19:28 ` [PATCH 5/5] arm64: dts: rockchip: fix USB OTG power on Photonicat in battery mode Coia Prant
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox