Skip to contentSkip to conversation

Add Radxa Rock 4D support

PATCH Superseded Detlev Casanova 3 participants 7 messages Feb 13, 2025 – Feb 14, 2025

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add Radxa Rock 4D support

Add the basic support for the board. (Not officially released yet) It is based on the Rockchip rk3576 SoC, so I haven't added the following devices yet:
- VOP/HDMI
- UFS
as the support for those has not been merged yet, but are close to be and I already validated that they work.
It will come with another patch set.

The following devices are supported and working:
- UART
- SD Card
- Ethernet
- USB
- RTC

Changes since v1:
- Add missing dt bindings
- Remove clock-frequency in rtc node
- Add line break in pmic pinctrls

Detlev Casanova (1):
dt-bindings: arm: rockchip: Add Radxa ROCK 4D board

Stephen Chen (1):
arm64: dts: rockchip: Add Radxa ROCK 4D device tree

 .../devicetree/bindings/arm/rockchip.yaml     |   5 +
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../boot/dts/rockchip/rk3576-rock-4d.dts      | 651 ++++++++++++++++++
 3 files changed, 657 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
Signature · 1 line
2.48.1
#1 lore raw

PATCH v2 1/2 dt-bindings: arm: rockchip: Add Radxa ROCK 4D board

The board is based on the Rockchip rk3576 SoC.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index 522a6f0450eae..9ddb20890627f 100644
@@ -862,6 +862,11 @@ properties:
           - const: radxa,rock-4c-plus
           - const: rockchip,rk3399
 
+      - description: Radxa ROCK 4D
+        items:
+          - const: radxa,rock-4d
+          - const: rockchip,rk3576
+
       - description: Radxa ROCK 4SE
         items:
           - const: radxa,rock-4se
Signature · 1 line
2.48.1
#3 lore raw

PATCH v2 2/2 arm64: dts: rockchip: Add Radxa ROCK 4D device tree

In reply to Detlev Casanova

From: Stephen Chen <[email protected]>

The Radxa ROCK 4D board is based on the Rockchip rk3576 SoC.

The device tree adds support for basic devices:
- UART
- SD Card
- Ethernet
- USB
- RTC

It has 4 USB ports but only 3 are usable as the top left one is used for maskrom.

It has a USB-C port that is only used for powering the board.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../boot/dts/rockchip/rk3576-rock-4d.dts      | 651 ++++++++++++++++++
 2 files changed, 652 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index def1222c1907e..a112aeb37948a 100644
@@ -132,6 +132,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-display-vz.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-rock-4d.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3582-radxa-e52c.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-sige7.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-w3.dtb
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +651 -0

651 lines not on this page · raw message

Signature · 1 line
2.48.1
#4 lore raw

Re: [PATCH v2 2/2] arm64: dts: rockchip: Add Radxa ROCK 4D device tree

Hi Detlev,

Quoted 42 lines · Detlev Casanova

From: Stephen Chen <[email protected]>

The Radxa ROCK 4D board is based on the Rockchip rk3576 SoC.

The device tree adds support for basic devices:
- UART
- SD Card
- Ethernet
- USB
- RTC

It has 4 USB ports but only 3 are usable as the top left one is used for maskrom.

It has a USB-C port that is only used for powering the board.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../boot/dts/rockchip/rk3576-rock-4d.dts      | 651 ++++++++++++++++++
 2 files changed, 652 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index def1222c1907e..a112aeb37948a 100644
@@ -132,6 +132,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-display-vz.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-rock-4d.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3582-radxa-e52c.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-sige7.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-w3.dtb
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +0 -0
new file mode 100644
index 0000000000000..f356742f9d643
@@ -0,0 +1,651 @@

[snip]

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 192

Quoted 7 lines

+&gmac0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +6 -0
+	phy-mode = "rgmii-id";
+	clock_in_out = "output";
+
+	snps,reset-gpio = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 20000 100000>;

The snps,reset- props are deprecated and should be changed to reset- props in the phy node.

Quoted 12 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +12 -0
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&eth0m0_miim
+		     &eth0m0_tx_bus2
+		     &eth0m0_rx_bus2
+		     &eth0m0_rgmii_clk
+		     &eth0m0_rgmii_bus
+		     &ethm0_clk0_25m_out>;
+
+	phy-handle = <&rgmii_phy0>;
+	status = "okay";
+};

[snip]

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 587

Quoted 2 lines

+&mdio0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +1 -0
+	rgmii_phy0: phy@1 {

Maybe ethernet-phy@1 ?

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 590

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +3 -0
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+		clocks = <&cru REFCLKO25M_GMAC0_OUT>;

Please add reset- props here.

Changing to use reset- props may cause issue if a RTL8211F PHY is used on the board. Use a ethernet-phy-id compatible or mainline U-Boot to ensure the Ethernet PHY can be discovered during probe.

Regards,
Jonas

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 28

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +3 -0
+	};
+};
+

[snip]

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#5 lore raw

Re: [PATCH v2 2/2] arm64: dts: rockchip: Add Radxa ROCK 4D device tree

Hi Jonas,

Quoted 54 lines · On Thursday, 13 February 2025 10:48:10 EST Jonas Karlman wrote:

Hi Detlev,

Quoted 48 lines · Detlev Casanova

From: Stephen Chen <[email protected]>

The Radxa ROCK 4D board is based on the Rockchip rk3576 SoC.

The device tree adds support for basic devices:
- UART
- SD Card
- Ethernet
- USB
- RTC

It has 4 USB ports but only 3 are usable as the top left one is used for maskrom.

It has a USB-C port that is only used for powering the board.

---

 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../boot/dts/rockchip/rk3576-rock-4d.dts      | 651 ++++++++++++++++++
 2 files changed, 652 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
(quoted diff) +0 -0

b/arch/arm64/boot/dts/rockchip/Makefile index
def1222c1907e..a112aeb37948a 100644

arch/arm64/boot/dts/rockchip/Makefile +0 -0
@@ -132,6 +132,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) +=

rk3568-wolfvision-pf5-display-vz.dtbo>
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb

arch/arm64/boot/dts/rockchip/Makefile +1 -0
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-rock-4d.dtb
 
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3582-radxa-e52c.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-sige7.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-w3.dtb
(quoted diff) +0 -0

b/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file mode 100644 index 0000000000000..f356742f9d643

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +0 -0
@@ -0,0 +1,651 @@

[snip]

Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 192

Quoted 7 lines

+&gmac0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +6 -0
+	phy-mode = "rgmii-id";
+	clock_in_out = "output";
+
+	snps,reset-gpio = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 20000 100000>;

The snps,reset- props are deprecated and should be changed to reset- props in the phy node.

Arg, second time I use deprectated props on new things. Are there plans or ways to make dtbs_check warn about those ?

Quoted 15 lines
Quoted 12 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +12 -0
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&eth0m0_miim
+		     &eth0m0_tx_bus2
+		     &eth0m0_rx_bus2
+		     &eth0m0_rgmii_clk
+		     &eth0m0_rgmii_bus
+		     &ethm0_clk0_25m_out>;
+
+	phy-handle = <&rgmii_phy0>;
+	status = "okay";
+};

[snip]

Quoted 4 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 587

Quoted 2 lines

+&mdio0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +1 -0
+	rgmii_phy0: phy@1 {

Maybe ethernet-phy@1 ?

Indeed.

Quoted 9 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 590

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +3 -0
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+		clocks = <&cru REFCLKO25M_GMAC0_OUT>;

Please add reset- props here.

Changing to use reset- props may cause issue if a RTL8211F PHY is used on the board. Use a ethernet-phy-id compatible or mainline U-Boot to ensure the Ethernet PHY can be discovered during probe.

Using downstream u-boot, with the RTL8211F PHY, linux can still detect the PHY and use it correctly, even with reset-* props at the PHY level.

I guess I can keep those there then, unless the issues you mention are more subtle than that ?

Detlev.

#6 lore raw

Re: [PATCH v2 2/2] arm64: dts: rockchip: Add Radxa ROCK 4D device tree

Hi Detlev,

Quoted 68 lines · Detlev Casanova

Hi Jonas,

Quoted 54 lines · On Thursday, 13 February 2025 10:48:10 EST Jonas Karlman wrote:

Hi Detlev,

Quoted 48 lines · Detlev Casanova

From: Stephen Chen <[email protected]>

The Radxa ROCK 4D board is based on the Rockchip rk3576 SoC.

The device tree adds support for basic devices:
- UART
- SD Card
- Ethernet
- USB
- RTC

It has 4 USB ports but only 3 are usable as the top left one is used for maskrom.

It has a USB-C port that is only used for powering the board.

---

 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../boot/dts/rockchip/rk3576-rock-4d.dts      | 651 ++++++++++++++++++
 2 files changed, 652 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
(quoted diff) +0 -0

b/arch/arm64/boot/dts/rockchip/Makefile index
def1222c1907e..a112aeb37948a 100644

arch/arm64/boot/dts/rockchip/Makefile +0 -0
@@ -132,6 +132,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) +=

rk3568-wolfvision-pf5-display-vz.dtbo>
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb

arch/arm64/boot/dts/rockchip/Makefile +1 -0
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-rock-4d.dtb
 
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3582-radxa-e52c.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-sige7.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-armsom-w3.dtb
(quoted diff) +0 -0

b/arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file mode 100644 index 0000000000000..f356742f9d643

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +0 -0
@@ -0,0 +1,651 @@

[snip]

Quoted 10 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 192

Quoted 7 lines

+&gmac0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +6 -0
+	phy-mode = "rgmii-id";
+	clock_in_out = "output";
+
+	snps,reset-gpio = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 20000 100000>;

The snps,reset- props are deprecated and should be changed to reset- props in the phy node.

Quoted 2 lines

Arg, second time I use deprectated props on new things. Are there plans or ways to make dtbs_check warn about those ?

Agree, would be nice if dtbs_check could be a little bit more verbose about use of deprecated props :-)

Quoted 33 lines
Quoted 16 lines
Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +12 -0
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&eth0m0_miim
+		     &eth0m0_tx_bus2
+		     &eth0m0_rx_bus2
+		     &eth0m0_rgmii_clk
+		     &eth0m0_rgmii_bus
+		     &ethm0_clk0_25m_out>;
+
+	phy-handle = <&rgmii_phy0>;
+	status = "okay";
+};

[snip]

Quoted 4 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 587

Quoted 2 lines

+&mdio0 {

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +1 -0
+	rgmii_phy0: phy@1 {

Maybe ethernet-phy@1 ?

Indeed.

Quoted 9 lines

arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts line 590

Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +3 -0
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+		clocks = <&cru REFCLKO25M_GMAC0_OUT>;

Please add reset- props here.

Changing to use reset- props may cause issue if a RTL8211F PHY is used on the board. Use a ethernet-phy-id compatible or mainline U-Boot to ensure the Ethernet PHY can be discovered during probe.

Quoted 6 lines

Using downstream u-boot, with the RTL8211F PHY, linux can still detect the PHY and use it correctly, even with reset-* props at the PHY level.

I guess I can keep those there then, unless the issues you mention are more subtle than that ?

Ohh, typically there has been issues for Linux to find the Ethernet PHY unless it has first been reset by boot firmware. Something like:

rk_gmac-dwmac fe010000.ethernet eth0: no phy at addr -1
rk_gmac-dwmac fe010000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)

There was a chicken-and-egg issue related to detecting ethernet phy:
- phy needs to be reset or phy_id read back as 0xffffffff on mdio bus
- phy device is not created because a valid phy_id is not read back
- phy device needs to be created before it can be reset

See [1] for more details on the ethernet phy issue that typically have affected multiple Rockchip boards with RTL8211F PHYs. Maybe it has been fixed in v6.13+.

[1] https://lore.kernel.org/all/[email protected]/

Regards,
Jonas

Quoted 5 lines

Detlev.