Skip to contentSkip to conversation

Add Radxa Rock 4D support

PATCH Superseded Detlev Casanova 2 participants 4 messages Feb 14, 2025

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 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 v2:
- Move and rename snps,reset-* props to the PHY node
- Rename phy@1 to phy-ethernet@1

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      | 650 ++++++++++++++++++
 3 files changed, 656 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts
Signature · 1 line
2.48.1
#1 lore raw

PATCH v3 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
#2 lore raw

PATCH v3 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      | 650 ++++++++++++++++++
 2 files changed, 651 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 +650 -0

650 lines not on this page · raw message

Signature · 1 line
2.48.1
maintainer
#3 lore raw

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

Hi Detlev,

all the style nitpick I'd changed myself, but the cpu-supplies did throw me off, see below.

Am Freitag, 14. Februar 2025, 16:19:34 MEZ schrieb Detlev Casanova:

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

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +4 -0
new file mode 100644
index 0000000000000..822abb82fae40
@@ -0,0 +1,650 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Radxa Computer (Shenzhen) Co., Ltd.
+ *

empty comment line can probably go away

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

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +10 -0
+	vcc_12v0_dcin: regulator-vcc-12v0-dcin {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_12v0_dcin";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <12000000>;
+		regulator-max-microvolt = <12000000>;
+	};
+
+	vcc_5v0_sys: regulator-vcc-5v0-sys {

alphabetical sorting, by node-name please, so regulator-vcc-3v3* comes before regulator-vcc-5v0* etc

Goes for all regulator-* nodes of course.

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +13 -0
+	vcc_3v3_pcie: regulator-vcc-3v3-pcie {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_pcie";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		enable-active-high;
+		gpio = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+		startup-delay-us = <5000>;
+		vin-supply = <&vcc_5v0_sys>;
+	};
+
+	vcc_5v0_host: regulator-vcc-5v0-host {
+		compatible = "regulator-fixed";

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

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +10 -0
+		regulator-name = "vcc5v0_host";
+		regulator-boot-on;
+		regulator-always-on;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		enable-active-high;
+		gpio = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&vcc_5v0_device>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb_host_pwren>;

both of the above, alphabetical sorting of properties please

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

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +6 -0
+	};
+};
+
+&cpu_l0 {
+	cpu-supply = <&vdd_cpu_lit_s0>;
+};

What happened to the supplies of the other cores? cpu_l1 - cpu_l3 probably need the same reference as above.

Who is powering the cpu_b* cores?

Quoted 26 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +26 -0
+&i2c1 {
+	status = "okay";
+
+	pmic@23 {
+		compatible = "rockchip,rk806";
+		reg = <0x23>;
+
+		interrupt-parent = <&gpio0>;
+		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmic_pins
+			     &rk806_dvs1_null
+			     &rk806_dvs2_null
+			     &rk806_dvs3_null>;
+
+		system-power-controller;
+
+		vcc1-supply = <&vcc_5v0_sys>;
+		vcc2-supply = <&vcc_5v0_sys>;
+		vcc3-supply = <&vcc_5v0_sys>;
+		vcc4-supply = <&vcc_5v0_sys>;
+		vcc5-supply = <&vcc_5v0_sys>;
+		vcc6-supply = <&vcc_5v0_sys>;
+		vcc7-supply = <&vcc_5v0_sys>;
+		vcc8-supply = <&vcc_5v0_sys>;

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

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +10 -0
+		vcc9-supply = <&vcc_5v0_sys>;
+		vcc10-supply = <&vcc_5v0_sys>;
+		vcc11-supply = <&vcc_2v0_pldo_s3>;
+		vcc12-supply = <&vcc_5v0_sys>;
+		vcc13-supply = <&vcc_1v1_nldo_s3>;
+		vcc14-supply = <&vcc_1v1_nldo_s3>;
+		vcca-supply = <&vcc_5v0_sys>;
+
+		gpio-controller;
+		#gpio-cells = <2>;

alphabetical sorting ... gpio* farther up please.

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

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +8 -0
+&uart0 {
+	pinctrl-0 = <&uart0m0_xfer>;
+	status = "okay";
+};
+
+&combphy1_psu {
+	status = "okay";
+};

phandles also sorted alphabetical please

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

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3576-rock-4d.dts new file +13 -0
+
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy1 {
+	status = "okay";
+};
+
+&usb_drd1_dwc3 {
+	dr_mode = "host";
+	status = "okay";
+};

Thanks a lot
Heiko