Skip to content

Commit

Permalink
rockchip: add Radxa CM3 IO support
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerr committed Jan 19, 2024
1 parent 1898385 commit 0ccc01f
Show file tree
Hide file tree
Showing 12 changed files with 1,074 additions and 1 deletion.
9 changes: 8 additions & 1 deletion package/boot/rkbin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ define Trusted-Firmware-A/Default
BUILD_TARGET:=rockchip
endef

define Trusted-Firmware-A/rk3568
define Trusted-Firmware-A/rk3566
BUILD_SUBTARGET:=armv8
ATF:=rk35/rk3568_bl31_v1.43.elf
TPL:=rk35/rk3566_ddr_1056MHz_v1.18.bin
endef

define Trusted-Firmware-A/rk3568
BUILD_SUBTARGET:=armv8
ATF:=rk35/rk3568_bl31_ultra_v2.13.elf
TPL:=rk35/rk3568_ddr_1560MHz_v1.18.bin
endef

TFA_TARGETS:= \
rk3566 \
rk3568

define Build/Compile
Expand Down
17 changes: 17 additions & 0 deletions package/boot/uboot-rockchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ define U-Boot/rockpro64-rk3399
endef


# RK3566 boards

define U-Boot/rk3566/Default
BUILD_SUBTARGET:=armv8
DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3568
ATF:=rk3568_bl31_ultra_v2.13.elf
TPL:=rk3566_ddr_1056MHz_v1.18.bin
endef

define U-Boot/radxa-cm3-io
$(U-Boot/rk3566/Default)
NAME:=CM3 IO
BUILD_DEVICES:= \
radxa_cm3-io
endef

# RK3568 boards

define U-Boot/rk3568/Default
Expand Down Expand Up @@ -153,6 +169,7 @@ UBOOT_TARGETS := \
roc-cc-rk3328 \
rock64-rk3328 \
rock-pi-e-rk3328 \
cm3-io-3566 \
nanopi-r5c-rk3568 \
nanopi-r5s-rk3568

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set_interface_core() {
case "$(board_name)" in
friendlyarm,nanopi-r2c|\
friendlyarm,nanopi-r2s|\
radxa,cm3-io|\
xunlong,orangepi-r1-plus|\
xunlong,orangepi-r1-plus-lts)
set_interface_core 2 "eth0"
Expand Down
9 changes: 9 additions & 0 deletions target/linux/rockchip/image/armv8.mk
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ define Device/pine64_rockpro64
endef
TARGET_DEVICES += pine64_rockpro64

define Device/radxa_cm3-io
DEVICE_VENDOR := Radxa
DEVICE_MODEL := CM3 IO
SOC := rk3566
DEVICE_DTS := rockchip/rk3566-radxa-cm3-io
UBOOT_DEVICE_NAME := radxa-cm3-io-3566
endef
TARGET_DEVICES += radxa_cm3-io

define Device/radxa_rock-pi-4a
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK Pi 4A
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
From 096ebfb74b19f2d4bdcbc33ae02e857ff4b3e0a0 Mon Sep 17 00:00:00 2001
From: Jagan Teki <[email protected]>
Date: Thu, 12 Jan 2023 16:29:02 +0530
Subject: [PATCH] arm64: dts: rockchip: Add Radxa Compute Module 3 IO board

Radxa Compute Module 3(CM3) IO board is an application board from Radxa
and is compatible with Raspberry Pi CM4 IO form factor.

Specification:
- 1x HDMI,
- 2x MIPI DSI
- 2x MIPI CSI2
- 1x eDP
- 1x PCIe card
- 2x SATA
- 2x USB 2.0 Host
- 1x USB 3.0
- 1x USB 2.0 OTG
- Phone jack
- microSD slot
- 40-pin GPIO expansion header
- 12V DC

Radxa CM3 needs to mount on top of this IO board in order to create
complete Radxa CM3 IO board platform.

Add support for Radxa CM3 IO Board.

Co-developed-by: FUKAUMI Naoki <[email protected]>
Signed-off-by: FUKAUMI Naoki <[email protected]>
Co-developed-by: Manoj Sai <[email protected]>
Signed-off-by: Manoj Sai <[email protected]>
Signed-off-by: Jagan Teki <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Heiko Stuebner <[email protected]>
---
arch/arm64/boot/dts/rockchip/Makefile | 1 +
.../boot/dts/rockchip/rk3566-radxa-cm3-io.dts | 179 ++++++++++++++++++
2 files changed, 180 insertions(+)
create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3-io.dts

diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile
index 77e598e2d34c50..99a44c400d6a8a 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -74,6 +74,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.1.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.2.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-a.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-b.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-radxa-cm3-io.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-roc-pc.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-blade.dtb
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-cm4.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3-io.dts b/arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3-io.dts
new file mode 100644
index 00000000000000..3e6578f27ec0cb
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3-io.dts
@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2022 Radxa Limited
+ * Copyright (c) 2022 Amarula Solutions(India)
+ */
+
+/dts-v1/;
+#include <dt-bindings/soc/rockchip,vop2.h>
+#include "rk3566.dtsi"
+#include "rk3566-radxa-cm3.dtsi"
+
+/ {
+ model = "Radxa Compute Module 3(CM3) IO Board";
+ compatible = "radxa,radxa-cm3-io", "radxa,radxa-cm3", "rockchip,rk3566";
+
+ aliases {
+ mmc1 = &sdmmc0;
+ };
+
+ chosen: chosen {
+ stdout-path = "serial2:1500000n8";
+ };
+
+ hdmi-con {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-1 {
+ gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_LOW>;
+ color = <LED_COLOR_ID_GREEN>;
+ function = LED_FUNCTION_ACTIVITY;
+ linux,default-trigger = "heartbeat";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pi_nled_activity>;
+ };
+ };
+
+ vcc5v0_usb30: vcc5v0-usb30-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc5v0_usb30";
+ enable-active-high;
+ gpio = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vcc5v0_usb30_en_h>;
+ regulator-always-on;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ vin-supply = <&vcc_sys>;
+ };
+
+ vcca1v8_image: vcca1v8-image-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcca1v8_image";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc_1v8_p>;
+ };
+
+ vdda0v9_image: vdda0v9-image-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcca0v9_image";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ vin-supply = <&vdda_0v9>;
+ };
+};
+
+&combphy1 {
+ status = "okay";
+};
+
+&hdmi {
+ avdd-0v9-supply = <&vdda0v9_image>;
+ avdd-1v8-supply = <&vcca1v8_image>;
+ status = "okay";
+};
+
+&hdmi_in {
+ hdmi_in_vp0: endpoint {
+ remote-endpoint = <&vp0_out_hdmi>;
+ };
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&hdmi_sound {
+ status = "okay";
+};
+
+&pinctrl {
+ leds {
+ pi_nled_activity: pi-nled-activity {
+ rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ sdcard {
+ sdmmc_pwren: sdmmc-pwren {
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
+ usb {
+ vcc5v0_usb30_en_h: vcc5v0-host-en-h {
+ rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+};
+
+&sdmmc0 {
+ bus-width = <4>;
+ cap-mmc-highspeed;
+ cap-sd-highspeed;
+ disable-wp;
+ vqmmc-supply = <&vccio_sd>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_pwren>;
+ status = "okay";
+};
+
+&uart2 {
+ status = "okay";
+};
+
+&usb2phy0_host {
+ phy-supply = <&vcc5v0_usb30>;
+ status = "okay";
+};
+
+&usb2phy1_host {
+ status = "okay";
+};
+
+&usb2phy1_otg {
+ status = "okay";
+};
+
+&usb_host0_ehci {
+ status = "okay";
+};
+
+&usb_host1_xhci {
+ status = "okay";
+};
+
+&vop {
+ assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+ assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+ status = "okay";
+};
+
+&vop_mmu {
+ status = "okay";
+};
+
+&vp0 {
+ vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+ reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+ remote-endpoint = <&hdmi_in_vp0>;
+ };
+};
Loading

0 comments on commit 0ccc01f

Please sign in to comment.