[RFC PATCH 1/1] arm64: dts: rockchip: add Radxa CM5 and IO board
Heiko Stübner
heiko at sntech.de
Thu May 15 01:43:11 PDT 2025
Hi Joseph,
Am Mittwoch, 14. Mai 2025, 19:38:56 Mitteleuropäische Sommerzeit schrieb Joseph Kogut:
> Add initial support for the Radxa CM5 and the accompanying IO board,
> including ethernet, USB 2.0/3.0, PCIe 2.0, HDMI output, UART2 console,
> SD/eMMC, PMIC.
>
> Signed-off-by: Joseph Kogut <joseph.kogut at gmail.com>
> Reviewed-by: Steve deRosier <derosier at cal-sierra.com>
please don't add "offline" reviews to initial patch submissions.
Review should happen in public, so I'd expect an actual mail from Steve
as a reply to this patch, stating his Reviewed-by tag.
After that, you'd add it to a possible v2.
> ---
> This is my first attempt at submitting a new device tree upstream.
> Feedback is welcome on DT conventions, naming, or anything I may have
> missed.
>
> This is largely reversed from the Radxa kernel sources as a reference.
>
> arch/arm64/boot/dts/rockchip/Makefile | 1 +
> .../dts/rockchip/rk3588s-radxa-cm5-io.dts | 448 ++++++++++++++++++
> .../boot/dts/rockchip/rk3588s-radxa-cm5.dtsi | 151 ++++++
You'll need a 2nd patch to add the board compatible to the binding in
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/arm/rockchip.yaml
You can take a look at the CM3-variant for how to do system-on-module
plus baseboard variants.
> 3 files changed, 600 insertions(+)
> create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5-io.dts
> create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5.dtsi
>
> diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
> index 3e8771ef69ba..6bbd506808a3 100644
> --- a/arch/arm64/boot/dts/rockchip/Makefile
> +++ b/arch/arm64/boot/dts/rockchip/Makefile
> @@ -175,6 +175,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-khadas-edge2.dtb
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6s.dtb
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-nanopi-r6c.dtb
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-odroid-m2.dtb
> +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-radxa-cm5-io.dtb
please sort alphabetically
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-orangepi-5.dtb
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-orangepi-5b.dtb
> dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-rock-5a.dtb
[...]
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5-io.dts b/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5-io.dts
> new file mode 100644
> index 000000000000..e3c2e00d0fa6
> --- /dev/null
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5-io.dts
> @@ -0,0 +1,448 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +
> +/dts-v1/;
some authorship / copyright thingy here maybe?
> +&i2c6 {
> + status = "okay";
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2c6m3_xfer>;
status as last property - aka here
> +&pinctrl {
> + fusb302 {
> + vbus5v0_typec_en: vbus5v0-typec-en {
> + rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
> + };
> +
> + usbc0_int: usbc0-int {
> + rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
> + };
> + };
> +
> + usb {
> + vcc5v0_host_en: vcc5v0-host-en {
> + rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
> + };
> + };
> +};
> +
> +
double empty line
> +&sdhci {
> + status = "okay";
> +};
> +
> +&u2phy0 {
> + status = "okay";
> +};
> +
> +&u2phy0_otg {
> + rockchip,typec-vbus-det;
I don't think this property exists in mainline ;-) .
Please run something like
make ARCH=arm64 CHECK_DTBS=y rockchip/rk3588s-radxa-cm5-io.dtb
to make sure
> + status = "okay";
> +};
> +
> +&u2phy2 {
> + status = "okay";
> +};
> +
> +&u2phy2_host {
> + status = "okay";
> +};
> +
> +&u2phy3 {
> + status = "okay";
> +};
> +
> +&u2phy3_host {
> + status = "okay";
> +};
> +
> +&uart2 {
> + status = "okay";
> + pinctrl-names = "default";
> + pinctrl-0 = <&uart2m0_xfer>;
status here please
> +};
> +
> +&usb_host0_ehci {
> + status = "okay";
> +};
> +
> +&usb_host0_ohci {
> + status = "okay";
> +};
> +
> +&usb_host0_xhci {
> + dr_mode = "otg";
> + usb-role-switch;
> + status = "okay";
> +
> + port {
> + usb_host0_xhci_role_switch: endpoint {
> + remote-endpoint = <&usbc0_role_switch>;
> + };
> + };
> +};
> +
> +&usb_host1_ehci {
> + status = "okay";
> +};
> +
> +&usb_host1_ohci {
> + status = "okay";
> +};
> +
> +&usbdp_phy0 {
> + status = "okay";
> + mode-switch;
> + orientation-switch;
> + sbu1-dc-gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
> + sbu2-dc-gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>;
> +
> + port {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + usbdp_phy0_orientation_switch: endpoint at 0 {
> + reg = <0>;
> + remote-endpoint = <&usbc0_orientation_switch>;
> + };
> +
> + usbdp_phy0_dp_altmode_mux: endpoint at 1 {
> + reg = <1>;
> + remote-endpoint = <&usbc0_dp_altmode_mux>;
> + };
> + };
> +};
> +
> +&vop {
> + status = "okay";
> +};
> +
> +&vop_mmu {
> + status = "okay";
> +};
> +
> +&vp0 {
> + vp0_out_hdmi0: endpoint at ROCKCHIP_VOP2_EP_HDMI0 {
> + reg = <ROCKCHIP_VOP2_EP_HDMI0>;
> + remote-endpoint = <&hdmi0_in_vp0>;
> + };
> +};
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5.dtsi
> new file mode 100644
> index 000000000000..ca208fa42347
> --- /dev/null
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s-radxa-cm5.dtsi
> @@ -0,0 +1,151 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
again copyright/authorship thingy?
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/leds/common.h>
> +#include <dt-bindings/soc/rockchip,vop2.h>
> +#include <dt-bindings/usb/pd.h>
> +
> +/ {
> + compatible = "radxa,cm5", "rockchip,rk3588s";
> +
> + aliases {
> + mmc0 = &sdmmc;
> + mmc1 = &sdhci;
> + mmc2 = &sdio;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> + pinctrl-names = "default";
> +
> + led_sys: led-0 {
> + color = <LED_COLOR_ID_BLUE>;
> + default-state = "on";
> + function = LED_FUNCTION_HEARTBEAT;
> + gpios = <&gpio4 RK_PB4 GPIO_ACTIVE_HIGH>;
> + linux,default-trigger = "heartbeat";
> + };
> + };
> +};
> +
> +
> +&gmac1 {
> + clock_in_out = "output";
> + phy-handle = <&rgmii_phy1>;
> + phy-mode = "rgmii-id";
> + phy-supply = <&vcc_3v3_s0>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&gmac1_miim
> + &gmac1_tx_bus2
> + &gmac1_rx_bus2
> + &gmac1_rgmii_clk
> + &gmac1_rgmii_bus
> + &gmac1_clkinout>;
> + tx_delay = <0x41>;
> + rx_delay = <0x3a>;
doing rgmii-id should not need those delays
> + status = "okay";
> +};
> +
> +&gpu {
> + mali-supply = <&vdd_gpu_s0>;
> + status = "okay";
> +};
> +
> +&hdmi0 {
> + status = "okay";
> +};
> +
Heiko
More information about the Linux-rockchip
mailing list