Skip to contentSkip to conversation

rockchip: add support for Theobroma Systems SOM-RK3588-Q7 Tiger module

PATCH In review Quentin Schulz 3 participants 12 messages Jun 10, 2024 – Jun 14, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover rockchip: add support for Theobroma Systems SOM-RK3588-Q7 Tiger module

This has a dependency on https://lore.kernel.org/u-boot/[email protected]/

Changes in v3:
- rebased on top of next,
- changed patch series dependency from DRAM ATAGS (merged) to RK3588
upstream DTS cherry-picks from 6.10-rc1 (USB nodes),
- cherry-picked kernel DTS commits for Tiger between v6.9 and v6.10-rc2,
note that the "arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards" commit triggered some git auto-merging while cherry-picking,
- support for Q7 USB P1 (micro-USB OTG) has been dropped, it requires
extcon USB GPIO driver that isn't supported in U-Boot (yet?),
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- removed uart controller muxing patch as not necessary until we get open-source DRAM init,
- disabled DEBUG_UART_BOARD_INIT as it's only used for muxing the UART controller and it's not necessary since DDR bin does this for us
already,
- added missing uart2 mux bootph in U-Boot dtsi (though not required
yet),
- switched to USB_DWC3_GENERIC from USB_XHCI_DWC3 as requested by Jonas,
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Heiko Stuebner (6):
arm64: dts: rockchip: enable gpu on rk3588-tiger
arm64: dts: rockchip: move uart2 pinmux to dtsi on rk3588-tiger
arm64: dts: rockchip: fix pcie-refclk frequency on rk3588 tiger
arm64: dts: rockchip: fix comment for upper usb3 port
arm64: dts: rockchip: add usb-id extcon on rk3588 tiger
arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

Jing Luo (1):
arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards

Quentin Schulz (1):
rockchip: add support for Theobroma Systems SOM-RK3588-Q7 Tiger module

 arch/arm/dts/rk3588-tiger-haikou-u-boot.dtsi       |  37 +++++++
 arch/arm/mach-rockchip/rk3588/Kconfig              |  31 ++++++
 board/theobroma-systems/tiger_rk3588/Kconfig       |  16 +++
 board/theobroma-systems/tiger_rk3588/MAINTAINERS   |  13 +++
 board/theobroma-systems/tiger_rk3588/Makefile      |  10 ++
 .../theobroma-systems/tiger_rk3588/tiger_rk3588.c  |  53 ++++++++++
 configs/tiger-rk3588_defconfig                     | 113 +++++++++++++++++++++
 doc/board/rockchip/rockchip.rst                    |   1 +
 doc/board/theobroma-systems/index.rst              |   1 +
 doc/board/theobroma-systems/tiger_rk3588.rst       | 102 +++++++++++++++++++
 .../src/arm64/rockchip/rk3588-coolpi-cm5.dtsi      |   2 +-
 .../rockchip/rk3588-edgeble-neu6a-common.dtsi      |   2 +-
 dts/upstream/src/arm64/rockchip/rk3588-jaguar.dts  |   2 +-
 .../src/arm64/rockchip/rk3588-tiger-haikou.dts     |  65 +++++++++++-
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi  |  29 +++++-
 .../src/arm64/rockchip/rk3588-turing-rk1.dtsi      |   2 +-
 .../src/arm64/rockchip/rk3588s-coolpi-4b.dts       |   2 +-
 .../src/arm64/rockchip/rk3588s-indiedroid-nova.dts |   2 +-
 .../src/arm64/rockchip/rk3588s-orangepi-5.dts      |   2 +-
 .../src/arm64/rockchip/rk3588s-rock-5a.dts         |   2 +-
 include/configs/tiger_rk3588.h                     |  15 +++
 21 files changed, 488 insertions(+), 14 deletions(-)

---
base-commit: b9bc39042dbc5d9e3bc84c0d63a54a4f6f5819d4
change-id: 20240418-tiger-d1531308c9a0

Best regards,

Signature · 1 line
Quentin Schulz <[email protected]>
#1 lore raw

PATCH v3 1/8 arm64: dts: rockchip: enable gpu on rk3588-tiger

From: Heiko Stuebner <[email protected]>

Enable the mali gpu node and add the som-specific supply-regulator.

[ upstream commit: f5256f8ed4b729c3ab9d9cd7d406313773484b59 ]

(cherry picked from commit 27350b241eafea37dc94743cd9c5dd83295faca9)

---
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +5 -0
index 1eb2543a5fd..72fe696b003 100644
@@ -139,6 +139,11 @@
 	snps,reset-delays-us = <0 10000 100000>;
 };
 
+&gpu {
+	mali-supply = <&vdd_gpu_s0>;
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-0 = <&i2c1m0_xfer>;
 };
Signature · 1 line
2.45.2
#2 lore raw

PATCH v3 2/8 arm64: dts: rockchip: move uart2 pinmux to dtsi on rk3588-tiger

In reply to Quentin Schulz

From: Heiko Stuebner <[email protected]>

The association of uart2 to the q7-uart pins is part of the module itself and not the baseboard used. Therefore move the pinctrl over to the tiger dtsi.

[ upstream commit: 5adbad5c464a708a87cf5ade1bfe2ca947bb2f82 ]

(cherry picked from commit f8314a4fbc00a3d651a7e9b4d9462d10c6c02a12)

---
 dts/upstream/src/arm64/rockchip/rk3588-tiger-haikou.dts | 1 -
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi       | 5 +++++
 2 files changed, 5 insertions(+), 1 deletion(-)
dts/upstream/src/arm64/rockchip/rk3588-tiger-haikou.dts +0 -1
index d672198c6b6..9bdd14799ef 100644
@@ -231,7 +231,6 @@
 };
 
 &uart2 {
-	pinctrl-0 = <&uart2m2_xfer>;
 	status = "okay";
 };
 
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +5 -0
index 72fe696b003..4984e36a8c2 100644
@@ -688,6 +688,11 @@
 	status = "okay";
 };
 
+/* Routed to UART0 on the Q7 connector */
+&uart2 {
+	pinctrl-0 = <&uart2m2_xfer>;
+};
+
 /* Mule-ATtiny UPDI */
 &uart4 {
 	pinctrl-0 = <&uart4m2_xfer>;
Signature · 1 line
2.45.2
#3 lore raw

PATCH v3 3/8 arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards

In reply to Quentin Schulz

From: Jing Luo <[email protected]>

gpio_pwrctrl2 gets duplicated by both rk806_dvs1_null and rk806_dvs2_null gpio_pwrctrl1 is unset. This typo appears in multiple files. Let's fix them.

Note: I haven't had the chance to test them all because I don't own all of these boards (obviously). Please test if it's needed.

[ upstream commit: d7f2039e5321636069baa77ef2f1e5d22cb69a88 ]

(cherry picked from commit cb2b6d1d19ed10fcaec5f5859c08a3355d1c66e0)

---
 dts/upstream/src/arm64/rockchip/rk3588-coolpi-cm5.dtsi           | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588-edgeble-neu6a-common.dtsi | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588-jaguar.dts                | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi                | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588-turing-rk1.dtsi           | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588s-coolpi-4b.dts            | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588s-indiedroid-nova.dts      | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588s-orangepi-5.dts           | 2 +-
 dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts              | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
dts/upstream/src/arm64/rockchip/rk3588-coolpi-cm5.dtsi +1 -1
index 94ecb9b4f98..170501a879d 100644
@@ -357,7 +357,7 @@
 		vcca-supply = <&vcc5v0_sys>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588-edgeble-neu6a-common.dtsi +1 -1
index c0d4a15323e..d9bf67525e8 100644
@@ -182,7 +182,7 @@
 		#gpio-cells = <2>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588-jaguar.dts +1 -1
index 39d65002add..7d7303f8ecb 100644
@@ -452,7 +452,7 @@
 		vcca-supply = <&vcc5v0_sys>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +1 -1
index 4984e36a8c2..29f8e536de1 100644
@@ -401,7 +401,7 @@
 		vcca-supply = <&vcc5v0_sys>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588-turing-rk1.dtsi +1 -1
index dc08da518a7..6b9206ce4a0 100644
@@ -318,7 +318,7 @@
 		#gpio-cells = <2>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588s-coolpi-4b.dts +1 -1
index e037bf9db75..7f4d7bb9a07 100644
@@ -479,7 +479,7 @@
 		vcca-supply = <&vcc5v0_sys>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588s-indiedroid-nova.dts +1 -1
index ce8119cbb82..a5b76e24ceb 100644
@@ -528,7 +528,7 @@
 		vcca-supply = <&vcc5v0_sys>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588s-orangepi-5.dts +1 -1
index 25de4362af3..73700d77eed 100644
@@ -336,7 +336,7 @@
 		#gpio-cells = <2>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts +1 -1
index 00afb90d4eb..5c99636a1d0 100644
@@ -414,7 +414,7 @@
 		#gpio-cells = <2>;
 
 		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
 			function = "pin_fun0";
 		};
 
Signature · 1 line
2.45.2
Reviewed-by on v3 3/8
#4 lore raw

Re: [PATCH next v3 3/8] arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards

Quoted 11 lines · Quentin Schulz

From: Jing Luo <[email protected]>

gpio_pwrctrl2 gets duplicated by both rk806_dvs1_null and rk806_dvs2_null gpio_pwrctrl1 is unset. This typo appears in multiple files. Let's fix them.

Note: I haven't had the chance to test them all because I don't own all of these boards (obviously). Please test if it's needed.

Thanks,
- Kever

Quoted 134 lines

[ upstream commit: d7f2039e5321636069baa77ef2f1e5d22cb69a88 ]

(cherry picked from commit cb2b6d1d19ed10fcaec5f5859c08a3355d1c66e0)

---
  dts/upstream/src/arm64/rockchip/rk3588-coolpi-cm5.dtsi           | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588-edgeble-neu6a-common.dtsi | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588-jaguar.dts                | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi                | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588-turing-rk1.dtsi           | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588s-coolpi-4b.dts            | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588s-indiedroid-nova.dts      | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588s-orangepi-5.dts           | 2 +-
  dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts              | 2 +-
  9 files changed, 9 insertions(+), 9 deletions(-)
dts/upstream/src/arm64/rockchip/rk3588-coolpi-cm5.dtsi +1 -1
index 94ecb9b4f98..170501a879d 100644
@@ -357,7 +357,7 @@
  		vcca-supply = <&vcc5v0_sys>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588-edgeble-neu6a-common.dtsi +1 -1
index c0d4a15323e..d9bf67525e8 100644
@@ -182,7 +182,7 @@
  		#gpio-cells = <2>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588-jaguar.dts +1 -1
index 39d65002add..7d7303f8ecb 100644
@@ -452,7 +452,7 @@
  		vcca-supply = <&vcc5v0_sys>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +1 -1
index 4984e36a8c2..29f8e536de1 100644
@@ -401,7 +401,7 @@
  		vcca-supply = <&vcc5v0_sys>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588-turing-rk1.dtsi +1 -1
index dc08da518a7..6b9206ce4a0 100644
@@ -318,7 +318,7 @@
  		#gpio-cells = <2>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588s-coolpi-4b.dts +1 -1
index e037bf9db75..7f4d7bb9a07 100644
@@ -479,7 +479,7 @@
  		vcca-supply = <&vcc5v0_sys>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588s-indiedroid-nova.dts +1 -1
index ce8119cbb82..a5b76e24ceb 100644
@@ -528,7 +528,7 @@
  		vcca-supply = <&vcc5v0_sys>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588s-orangepi-5.dts +1 -1
index 25de4362af3..73700d77eed 100644
@@ -336,7 +336,7 @@
  		#gpio-cells = <2>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
dts/upstream/src/arm64/rockchip/rk3588s-rock-5a.dts +1 -1
index 00afb90d4eb..5c99636a1d0 100644
@@ -414,7 +414,7 @@
  		#gpio-cells = <2>;
 
  		rk806_dvs1_null: dvs1-null-pins {
-			pins = "gpio_pwrctrl2";
+			pins = "gpio_pwrctrl1";
  			function = "pin_fun0";
  		};
 
#5 lore raw

PATCH v3 4/8 arm64: dts: rockchip: fix pcie-refclk frequency on rk3588 tiger

In reply to Quentin Schulz

From: Heiko Stuebner <[email protected]>

The clock-generator of course only produces a 100MHz clock rate, not 1GHz.

[ upstream commit: 0eb2a93518fb4728bd1d55fcd3b57fce4797ef1d ]

(cherry picked from commit b574cbafae976cf508692088944e45c9764c0048)

---
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +1 -1
index 29f8e536de1..a8565720cf5 100644
@@ -46,7 +46,7 @@
 	pcie_refclk_gen: pcie-refclk-gen-clock {
 		compatible = "fixed-clock";
 		#clock-cells = <0>;
-		clock-frequency = <1000000000>;
+		clock-frequency = <100000000>;
 	};
 
 	pcie_refclk: pcie-refclk-clock {
Signature · 1 line
2.45.2
#6 lore raw

PATCH v3 5/8 arm64: dts: rockchip: fix comment for upper usb3 port

In reply to Quentin Schulz

From: Heiko Stuebner <[email protected]>

The comment for the host2_xhci points to the wrong port on the board. The upper usb3 port is the correct one, so fix the comment to prevent confusion.

[ upstream commit: 3482efee1144262dc839792103e6a9e29defecbc ]

(cherry picked from commit 56f3031edf22d163f10bc4b631d37a9aaa82d4d4)

---
 dts/upstream/src/arm64/rockchip/rk3588-tiger-haikou.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
dts/upstream/src/arm64/rockchip/rk3588-tiger-haikou.dts +3 -3
index 9bdd14799ef..2aa43e7430e 100644
@@ -239,12 +239,12 @@
 	status = "okay";
 };
 
-/* host0 on Q7_USB_P2, lower usb3 port */
+/* host0 on Q7_USB_P2, upper usb3 port */
 &usb_host0_ehci {
 	status = "okay";
 };
 
-/* host0 on Q7_USB_P2, lower usb3 port */
+/* host0 on Q7_USB_P2, upper usb3 port */
 &usb_host0_ohci {
 	status = "okay";
 };
@@ -259,7 +259,7 @@
 	status = "okay";
 };
 
-/* host2 on Q7_USB_P2, lower usb3 port */
+/* host2 on Q7_USB_P2, upper usb3 port */
 &usb_host2_xhci {
 	status = "okay";
 };
Signature · 1 line
2.45.2
#7 lore raw

PATCH v3 6/8 arm64: dts: rockchip: add usb-id extcon on rk3588 tiger

In reply to Quentin Schulz

From: Heiko Stuebner <[email protected]>

The Q7 standard specifies a usb-id pin on the connector to distiuish between host and device mode. Model this via the usb-id extcon binding.

While the pin is part of the Q7 standard, so part of the module, the extcon stays disabled in the som dtsi and will only be enabled in a baseboard using it.

[ upstream commit: eabb53f5dacfd643b5255f35bad30b8f914decdc ]

(cherry picked from commit 4843cec4092318ef7feb0999b0d34ef817465b33)

---
 dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
dts/upstream/src/arm64/rockchip/rk3588-tiger.dtsi +15 -0
index a8565720cf5..aebe1fedd2d 100644
@@ -23,6 +23,14 @@
 		reset-gpios = <&gpio2 RK_PA3 GPIO_ACTIVE_HIGH>;
 	};
 
+	extcon_usb3: extcon-usb3 {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb3_id>;
+		status = "disabled";
+	};
+
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
@@ -327,6 +335,13 @@
 			rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
 	};
+
+	usb3 {
+		usb3_id: usb3-id {
+			rockchip,pins =
+			  <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &saradc {
Signature · 1 line
2.45.2
#8 lore raw

PATCH v3 7/8 arm64: dts: rockchip: add dual-role usb3 hosts to rk3588 Tiger-Haikou

In reply to Quentin Schulz

From: Heiko Stuebner <[email protected]>

Apart from the host-only usb3 controller (host2) the rk3588 also provides two dual-role controllers. On the Tiger-Haikou combination these are connected to the lower usb3-host port in host-only mode and the micro-usb3 port for dual-role operation.

Add the necessary controllers, phys to the Tiger-Haikou board and enable the usb-id extcon.

[ upstream commit: d7b83921d098bd76623381f75f5cd2296f1315cc ]

(cherry picked from commit 193d3b2a0a98f2dcd8c43bcbf8a766098a9fa75d)

---
 .../src/arm64/rockchip/rk3588-tiger-haikou.dts     | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)
dts/upstream/src/arm64/rockchip/rk3588-tiger-haikou.dts +58 -0
index 2aa43e7430e..e4b7a0a4444 100644
@@ -113,6 +113,16 @@
 		vin-supply = <&dc_12v>;
 	};
 
+	vcc5v0_otg: vcc5v0-otg-regulator {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&otg_vbus_drv>;
+		regulator-name = "vcc5v0_otg";
+		regulator-always-on;
+	};
+
 	vcc5v0_usb: vcc5v0-usb-regulator {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc5v0_usb";
@@ -137,6 +147,10 @@
 	status = "okay";
 };
 
+&extcon_usb3 {
+	status = "okay";
+};
+
 &gmac0 {
 	status = "okay";
 };
@@ -199,6 +213,13 @@
 				<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
 		};
 	};
+
+	usb2 {
+		otg_vbus_drv: otg-vbus-drv {
+			rockchip,pins =
+			  <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
 };
 
 &sdmmc {
@@ -214,6 +235,23 @@
 	status = "okay";
 };
 
+&u2phy0 {
+	status = "okay";
+};
+
+&u2phy0_otg {
+	phy-supply = <&vcc5v0_otg>;
+	status = "okay";
+};
+
+&u2phy1 {
+	status = "okay";
+};
+
+&u2phy1_otg {
+	status = "okay";
+};
+
 &u2phy2 {
 	status = "okay";
 };
@@ -236,6 +274,13 @@
 
 &uart5 {
 	rts-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
+};
+
+&usbdp_phy0 {
+	status = "okay";
+};
+
+&usbdp_phy1 {
 	status = "okay";
 };
 
@@ -249,6 +294,13 @@
 	status = "okay";
 };
 
+/* host0_xhci on Q7_USB_P1, usb3-otg port */
+&usb_host0_xhci {
+	dr_mode = "otg";
+	extcon = <&extcon_usb3>;
+	status = "okay";
+};
+
 /* host1 on Q7_USB_P3, usb2 port */
 &usb_host1_ehci {
 	status = "okay";
@@ -259,6 +311,12 @@
 	status = "okay";
 };
 
+/* host1_xhci on Q7_USB_P0, lower usb3 port */
+&usb_host1_xhci {
+	dr_mode = "host";
+	status = "okay";
+};
+
 /* host2 on Q7_USB_P2, upper usb3 port */
 &usb_host2_xhci {
 	status = "okay";
Signature · 1 line
2.45.2
#9 lore raw

PATCH v3 8/8 rockchip: add support for Theobroma Systems SOM-RK3588-Q7 Tiger module

In reply to Quentin Schulz

From: Quentin Schulz <[email protected]>

The RK3588-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230 connector) system-on-module from Theobroma Systems, featuring the Rockchip RK3588.

It provides the following feature set:
* up to 16GB LPDDR4x
* on-module eMMC
* SD card (on a baseboard) via edge connector
* Gigabit Ethernet with on-module GbE PHY
* HDMI/eDP
* MIPI-DSI
* 4x MIPI-CSI (3x on FPC connectors, 1x over Q7)
* HDMI input over FPC connector
* CAN
* USB
- 1x USB 3.0 dual-role (direct connection)
- 2x USB 3.0 host + 1x USB 2.0 host
* PCIe
- 1x PCIe 2.1 Gen3, 4 lanes
- 2xSATA / 2x PCIe 2.1 Gen1, 2 lanes
* on-module ATtiny816 companion controller, implementing:
- low-power RTC functionality (ISL1208 emulation)
- fan controller (AMC6821 emulation)
* on-module Secure Element with Global Platform 2.2.1 compliant JavaCard environment

The support is added for Tiger on Haikou devkit, similarly to RK3399 Puma and PX30 Ringneck.

---
 arch/arm/dts/rk3588-tiger-haikou-u-boot.dtsi       |  37 +++++++
 arch/arm/mach-rockchip/rk3588/Kconfig              |  31 ++++++
 board/theobroma-systems/tiger_rk3588/Kconfig       |  16 +++
 board/theobroma-systems/tiger_rk3588/MAINTAINERS   |  13 +++
 board/theobroma-systems/tiger_rk3588/Makefile      |  10 ++
 .../theobroma-systems/tiger_rk3588/tiger_rk3588.c  |  53 ++++++++++
 configs/tiger-rk3588_defconfig                     | 113 +++++++++++++++++++++
 doc/board/rockchip/rockchip.rst                    |   1 +
 doc/board/theobroma-systems/index.rst              |   1 +
 doc/board/theobroma-systems/tiger_rk3588.rst       | 102 +++++++++++++++++++
 include/configs/tiger_rk3588.h                     |  15 +++
 11 files changed, 392 insertions(+)
arch/arm/dts/rk3588-tiger-haikou-u-boot.dtsi new file +37 -0
new file mode 100644
index 00000000000..275ae6fdaea
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Theobroma Systems Design und Consulting GmbH
+ */
+
+#include "rk3588-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+	};
+};
+
+&emmc_pwrseq {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&emmc_reset {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&gpio2 {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&sdhci {
+	/* U-Boot currently cannot handle anything below HS200 for eMMC on RK3588 */
+	/delete-property/ mmc-ddr-1_8v;
+	/delete-property/ cap-mmc-highspeed;
+};
+
+&uart2m2_xfer {
+	bootph-all;
+};
arch/arm/mach-rockchip/rk3588/Kconfig +31 -0
index 9f82e9f3371..9a35c7d9cc2 100644
@@ -193,6 +193,36 @@ config TARGET_QUARTZPRO64_RK3588
 	  Pine64 QuartzPro64 is a Rockchip RK3588 based SBC (Single Board
 	  Computer) by Pine64.
 
+config TARGET_TIGER_RK3588
+	bool "Theobroma Systems SOM-RK3588-Q7 (Tiger)"
+	select BOARD_LATE_INIT
+	help
+	  The RK3588-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230
+	  connector) system-on-module from Theobroma Systems, featuring the
+	  Rockchip RK3588.
+
+	  It provides the following feature set:
+	   * up to 16GB LPDDR4x
+	   * on-module eMMC
+	   * SD card (on a baseboard) via edge connector
+	   * Gigabit Ethernet with on-module GbE PHY
+	   * HDMI/eDP
+	   * MIPI-DSI
+	   * 4x MIPI-CSI (3x on FPC connectors, 1x over Q7)
+	   * HDMI input over FPC connector
+	   * CAN
+	   * USB
+	     - 1x USB 3.0 dual-role (direct connection)
+	     - 2x USB 3.0 host + 1x USB 2.0 host
+	   * PCIe
+	     - 1x PCIe 2.1 Gen3, 4 lanes
+	     - 2xSATA / 2x PCIe 2.1 Gen1, 2 lanes
+	   * on-module ATtiny816 companion controller, implementing:
+	     - low-power RTC functionality (ISL1208 emulation)
+	     - fan controller (AMC6821 emulation)
+	   * on-module Secure Element with Global Platform 2.2.1 compliant
+	     JavaCard environment
+
 config TARGET_TURINGRK1_RK3588
 	bool "Turing Machines RK1 RK3588 board"
 	select BOARD_LATE_INIT
@@ -266,5 +296,6 @@ source "board/radxa/rock5b-rk3588/Kconfig"
 source "board/rockchip/evb_rk3588/Kconfig"
 source "board/rockchip/toybrick_rk3588/Kconfig"
 source "board/theobroma-systems/jaguar_rk3588/Kconfig"
+source "board/theobroma-systems/tiger_rk3588/Kconfig"
 
 endif
board/theobroma-systems/tiger_rk3588/Kconfig new file +16 -0
new file mode 100644
index 00000000000..2c6ac6a9a83
@@ -0,0 +1,16 @@
+if TARGET_TIGER_RK3588
+
+config SYS_BOARD
+	default "tiger_rk3588"
+
+config SYS_VENDOR
+	default "theobroma-systems"
+
+config SYS_CONFIG_NAME
+	default "tiger_rk3588"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select ENV_IS_NOWHERE
+
+endif
board/theobroma-systems/tiger_rk3588/MAINTAINERS new file +13 -0
new file mode 100644
index 00000000000..e5aab4b29f3
@@ -0,0 +1,13 @@
+TIGER-RK3588 (SOM-RK3588-Q7)
+M:	Klaus Goger <[email protected]>
+M:	Quentin Schulz <[email protected]>
+M:	Heiko Stuebner <[email protected]>
+S:	Maintained
+F:	board/theobroma-systems/tiger_rk3588
+F:	board/theobroma-systems/common
+F:	doc/board/theobroma-systems/
+F:	include/configs/tiger_rk3588.h
+F:	arch/arm/dts/rk3588-tiger*
+F:	configs/tiger-rk3588_defconfig
+W:	https://embedded.cherry.de/product/tiger-som-rk3588-q7/
+T:	git git://git.embedded.cherry.de/tiger-u-boot.git
board/theobroma-systems/tiger_rk3588/Makefile new file +10 -0
new file mode 100644
index 00000000000..5c4c484657a
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2024 Theobroma Systems Design und Consulting GmbH
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += tiger_rk3588.o
+ifneq ($(CONFIG_SPL_BUILD),y)
+obj-y	+= ../common/common.o
+endif
board/theobroma-systems/tiger_rk3588/tiger_rk3588.c new file +53 -0

53 lines not on this page · raw message

configs/tiger-rk3588_defconfig new file +113 -0

113 lines not on this page · raw message

doc/board/rockchip/rockchip.rst +1 -0
index fec8675c8be..eaf71673b7f 100644
@@ -131,6 +131,7 @@ List of mainline supported Rockchip boards:
      - Radxa ROCK 5B (rock5b-rk3588)
      - Rockchip Toybrick TB-RK3588X (toybrick-rk3588)
      - Theobroma Systems RK3588-SBC Jaguar (jaguar-rk3588)
+     - Theobroma Systems SOM-RK3588-Q7 - Tiger (tiger-rk3588)
      - Turing Machines RK1 (turing-rk1-rk3588)
      - Xunlong Orange Pi 5 (orangepi-5-rk3588s)
      - Xunlong Orange Pi 5 Plus (orangepi-5-plus-rk3588)
doc/board/theobroma-systems/index.rst +1 -0
index b4da2616c37..73e07f7ebfa 100644
@@ -9,3 +9,4 @@ Theobroma Systems
    jaguar_rk3588
    puma_rk3399
    ringneck_px30
+   tiger_rk3588
doc/board/theobroma-systems/tiger_rk3588.rst new file +102 -0

102 lines not on this page · raw message

include/configs/tiger_rk3588.h new file +15 -0
new file mode 100644
index 00000000000..7a32adfaf2a
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2023 Theobroma Systems Design und Consulting GmbH
+ */
+
+#ifndef __TIGER_RK3588_H
+#define __TIGER_RK3588_H
+
+#define ROCKCHIP_DEVICE_SETTINGS \
+		"stdout=serial,vidconsole\0" \
+		"stderr=serial,vidconsole\0"
+
+#include <configs/rk3588_common.h>
+
+#endif /* __TIGER_RK3588_H */
Signature · 1 line
2.45.2
Reviewed-by on v3 8/8
#10 lore raw
Quoted 28 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

The RK3588-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230 connector) system-on-module from Theobroma Systems, featuring the Rockchip RK3588.

It provides the following feature set:
* up to 16GB LPDDR4x
* on-module eMMC
* SD card (on a baseboard) via edge connector
* Gigabit Ethernet with on-module GbE PHY
* HDMI/eDP
* MIPI-DSI
* 4x MIPI-CSI (3x on FPC connectors, 1x over Q7)
* HDMI input over FPC connector
* CAN
* USB
- 1x USB 3.0 dual-role (direct connection)
- 2x USB 3.0 host + 1x USB 2.0 host
* PCIe
- 1x PCIe 2.1 Gen3, 4 lanes
- 2xSATA / 2x PCIe 2.1 Gen1, 2 lanes
* on-module ATtiny816 companion controller, implementing:
- low-power RTC functionality (ISL1208 emulation)
- fan controller (AMC6821 emulation)
* on-module Secure Element with Global Platform 2.2.1 compliant JavaCard environment

Quoted 6 lines

The support is added for Tiger on Haikou devkit, similarly to RK3399 Puma and PX30 Ringneck.

Thanks,
- Kever

Quoted 491 lines
---
  arch/arm/dts/rk3588-tiger-haikou-u-boot.dtsi       |  37 +++++++
  arch/arm/mach-rockchip/rk3588/Kconfig              |  31 ++++++
  board/theobroma-systems/tiger_rk3588/Kconfig       |  16 +++
  board/theobroma-systems/tiger_rk3588/MAINTAINERS   |  13 +++
  board/theobroma-systems/tiger_rk3588/Makefile      |  10 ++
  .../theobroma-systems/tiger_rk3588/tiger_rk3588.c  |  53 ++++++++++
  configs/tiger-rk3588_defconfig                     | 113 +++++++++++++++++++++
  doc/board/rockchip/rockchip.rst                    |   1 +
  doc/board/theobroma-systems/index.rst              |   1 +
  doc/board/theobroma-systems/tiger_rk3588.rst       | 102 +++++++++++++++++++
  include/configs/tiger_rk3588.h                     |  15 +++
  11 files changed, 392 insertions(+)
arch/arm/dts/rk3588-tiger-haikou-u-boot.dtsi new file +37 -0
new file mode 100644
index 00000000000..275ae6fdaea
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Theobroma Systems Design und Consulting GmbH
+ */
+
+#include "rk3588-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+	};
+};
+
+&emmc_pwrseq {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&emmc_reset {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&gpio2 {
+	bootph-pre-ram;
+	bootph-some-ram;
+};
+
+&sdhci {
+	/* U-Boot currently cannot handle anything below HS200 for eMMC on RK3588 */
+	/delete-property/ mmc-ddr-1_8v;
+	/delete-property/ cap-mmc-highspeed;
+};
+
+&uart2m2_xfer {
+	bootph-all;
+};
arch/arm/mach-rockchip/rk3588/Kconfig +31 -0
index 9f82e9f3371..9a35c7d9cc2 100644
@@ -193,6 +193,36 @@ config TARGET_QUARTZPRO64_RK3588
  	  Pine64 QuartzPro64 is a Rockchip RK3588 based SBC (Single Board
  	  Computer) by Pine64.
 
+config TARGET_TIGER_RK3588
+	bool "Theobroma Systems SOM-RK3588-Q7 (Tiger)"
+	select BOARD_LATE_INIT
+	help
+	  The RK3588-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230
+	  connector) system-on-module from Theobroma Systems, featuring the
+	  Rockchip RK3588.
+
+	  It provides the following feature set:
+	   * up to 16GB LPDDR4x
+	   * on-module eMMC
+	   * SD card (on a baseboard) via edge connector
+	   * Gigabit Ethernet with on-module GbE PHY
+	   * HDMI/eDP
+	   * MIPI-DSI
+	   * 4x MIPI-CSI (3x on FPC connectors, 1x over Q7)
+	   * HDMI input over FPC connector
+	   * CAN
+	   * USB
+	     - 1x USB 3.0 dual-role (direct connection)
+	     - 2x USB 3.0 host + 1x USB 2.0 host
+	   * PCIe
+	     - 1x PCIe 2.1 Gen3, 4 lanes
+	     - 2xSATA / 2x PCIe 2.1 Gen1, 2 lanes
+	   * on-module ATtiny816 companion controller, implementing:
+	     - low-power RTC functionality (ISL1208 emulation)
+	     - fan controller (AMC6821 emulation)
+	   * on-module Secure Element with Global Platform 2.2.1 compliant
+	     JavaCard environment
+
  config TARGET_TURINGRK1_RK3588
  	bool "Turing Machines RK1 RK3588 board"
  	select BOARD_LATE_INIT
@@ -266,5 +296,6 @@ source "board/radxa/rock5b-rk3588/Kconfig"
  source "board/rockchip/evb_rk3588/Kconfig"
  source "board/rockchip/toybrick_rk3588/Kconfig"
  source "board/theobroma-systems/jaguar_rk3588/Kconfig"
+source "board/theobroma-systems/tiger_rk3588/Kconfig"
 
  endif
board/theobroma-systems/tiger_rk3588/Kconfig new file +16 -0
new file mode 100644
index 00000000000..2c6ac6a9a83
@@ -0,0 +1,16 @@
+if TARGET_TIGER_RK3588
+
+config SYS_BOARD
+	default "tiger_rk3588"
+
+config SYS_VENDOR
+	default "theobroma-systems"
+
+config SYS_CONFIG_NAME
+	default "tiger_rk3588"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select ENV_IS_NOWHERE
+
+endif
board/theobroma-systems/tiger_rk3588/MAINTAINERS new file +13 -0
new file mode 100644
index 00000000000..e5aab4b29f3
@@ -0,0 +1,13 @@
+TIGER-RK3588 (SOM-RK3588-Q7)
+M:	Klaus Goger <[email protected]>
+M:	Quentin Schulz <[email protected]>
+M:	Heiko Stuebner <[email protected]>
+S:	Maintained
+F:	board/theobroma-systems/tiger_rk3588
+F:	board/theobroma-systems/common
+F:	doc/board/theobroma-systems/
+F:	include/configs/tiger_rk3588.h
+F:	arch/arm/dts/rk3588-tiger*
+F:	configs/tiger-rk3588_defconfig
+W:	https://embedded.cherry.de/product/tiger-som-rk3588-q7/
+T:	git git://git.embedded.cherry.de/tiger-u-boot.git
board/theobroma-systems/tiger_rk3588/Makefile new file +10 -0
new file mode 100644
index 00000000000..5c4c484657a
@@ -0,0 +1,10 @@
+#
+# Copyright (c) 2024 Theobroma Systems Design und Consulting GmbH
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += tiger_rk3588.o
+ifneq ($(CONFIG_SPL_BUILD),y)
+obj-y	+= ../common/common.o
+endif
board/theobroma-systems/tiger_rk3588/tiger_rk3588.c new file +53 -0
new file mode 100644
index 00000000000..a6d44f10db3
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2023 Theobroma Systems Design und Consulting GmbH
+ */
+
+#include <phy.h>
+#include <eth_phy.h>
+
+#include <asm/types.h>
+#include <asm/arch-rockchip/cru_rk3588.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/ioc_rk3588.h>
+#include <asm-generic/u-boot.h>
+#include <dm/device.h>
+#include <dm/uclass-id.h>
+#include <linux/bitfield.h>
+
+#include "../common/common.h"
+
+#define GPIO2C3_SEL_MASK		GENMASK(15, 12)
+#define GPIO2C3_ETH0_REFCLKO_25M	FIELD_PREP(GPIO2C3_SEL_MASK, 1)
+
+#define REFCLKO25M_ETH0_OUT_SEL_MASK	BIT(15)
+#define REFCLKO25M_ETH0_OUT_SEL_CPLL	FIELD_PREP(REFCLKO25M_ETH0_OUT_SEL_MASK, 1)
+#define REFCLKO25M_ETH0_OUT_DIV_MASK	GENMASK(14, 8)
+#define REFCLKO25M_ETH0_OUT_DIV(x)	FIELD_PREP(REFCLKO25M_ETH0_OUT_DIV_MASK, (x) - 1)
+
+#define REFCLKO25M_ETH0_OUT_EN		BIT(4)
+
+void setup_eth0refclko(void)
+{
+	/* Configure and enable ETH0_REFCLKO_25MHz */
+	static struct rk3588_bus_ioc * const bus_ioc = (void *)BUS_IOC_BASE;
+	static struct rk3588_cru * const cru = (void *)CRU_BASE;
+
+	/* 1. Pinmux */
+	rk_clrsetreg(&bus_ioc->gpio2c_iomux_sel_l, GPIO2C3_SEL_MASK, GPIO2C3_ETH0_REFCLKO_25M);
+	/* 2. Parent clock selection + divider => CPLL (1.5GHz) / 60 => 25MHz */
+	rk_clrsetreg(&cru->clksel_con[15],
+		     REFCLKO25M_ETH0_OUT_SEL_MASK | REFCLKO25M_ETH0_OUT_DIV_MASK,
+		     REFCLKO25M_ETH0_OUT_SEL_CPLL | REFCLKO25M_ETH0_OUT_DIV(60));
+	/* 3. Enable clock */
+	rk_clrreg(&cru->clkgate_con[5], REFCLKO25M_ETH0_OUT_EN);
+}
+
+int rockchip_early_misc_init_r(void)
+{
+	setup_boottargets();
+
+	setup_eth0refclko();
+
+	return 0;
+}
configs/tiger-rk3588_defconfig new file +113 -0
new file mode 100644
index 00000000000..8fcdd063a3d
@@ -0,0 +1,113 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_SPL_GPIO=y
+CONFIG_SF_DEFAULT_SPEED=24000000
+CONFIG_SF_DEFAULT_MODE=0x2000
+CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588-tiger-haikou"
+CONFIG_ROCKCHIP_RK3588=y
+CONFIG_ROCKCHIP_BOOT_MODE_REG=0x0
+CONFIG_SPL_SERIAL=y
+CONFIG_TARGET_TIGER_RK3588=y
+CONFIG_DEBUG_UART_BASE=0xfeb50000
+CONFIG_DEBUG_UART_CLOCK=24000000
+# CONFIG_DEBUG_UART_BOARD_INIT is not set
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+# CONFIG_BOOTMETH_VBE is not set
+CONFIG_LEGACY_IMAGE_FORMAT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3588-tiger-haikou.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_CYCLIC=y
+CONFIG_SPL_MAX_SIZE=0x40000
+CONFIG_SPL_PAD_TO=0x7f8000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_ATF=y
+# CONFIG_BOOTM_NETBSD is not set
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
+# CONFIG_BOOTM_VXWORKS is not set
+# CONFIG_CMD_ELF is not set
+CONFIG_CMD_ADC=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_I2C=y
+# CONFIG_CMD_LOADB is not set
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+# CONFIG_CMD_SF is not set
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_MII is not set
+# CONFIG_CMD_BLOCK_CACHE is not set
+# CONFIG_CMD_EFICONFIG is not set
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_EROFS=y
+CONFIG_CMD_SQUASHFS=y
+# CONFIG_SPL_DOS_PARTITION is not set
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+# CONFIG_OF_TAG_MIGRATE is not set
+CONFIG_OF_SPL_REMOVE_PROPS="interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_REGMAP=y
+CONFIG_SPL_SYSCON=y
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_SPL_CLK=y
+CONFIG_CLK_GPIO=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MISC=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_IO_VOLTAGE=y
+CONFIG_SPL_MMC_IO_VOLTAGE=y
+CONFIG_MMC_UHS_SUPPORT=y
+CONFIG_SPL_MMC_UHS_SUPPORT=y
+CONFIG_MMC_HS400_ES_SUPPORT=y
+CONFIG_SPL_MMC_HS400_ES_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_SPL_MMC_HS400_SUPPORT=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_SDMA=y
+CONFIG_MMC_SDHCI_ROCKCHIP=y
+# CONFIG_SPI_FLASH is not set
+CONFIG_SF_DEFAULT_BUS=5
+CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DWC_ETH_QOS=y
+CONFIG_DWC_ETH_QOS_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
+CONFIG_PHY_ROCKCHIP_USBDP=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_SPL_RAM=y
+CONFIG_SCSI=y
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_ROCKCHIP_SPI=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_ERRNO_STR=y
doc/board/rockchip/rockchip.rst +1 -0
index fec8675c8be..eaf71673b7f 100644
@@ -131,6 +131,7 @@ List of mainline supported Rockchip boards:
       - Radxa ROCK 5B (rock5b-rk3588)
       - Rockchip Toybrick TB-RK3588X (toybrick-rk3588)
       - Theobroma Systems RK3588-SBC Jaguar (jaguar-rk3588)
+     - Theobroma Systems SOM-RK3588-Q7 - Tiger (tiger-rk3588)
       - Turing Machines RK1 (turing-rk1-rk3588)
       - Xunlong Orange Pi 5 (orangepi-5-rk3588s)
       - Xunlong Orange Pi 5 Plus (orangepi-5-plus-rk3588)
doc/board/theobroma-systems/index.rst +1 -0
index b4da2616c37..73e07f7ebfa 100644
@@ -9,3 +9,4 @@ Theobroma Systems
     jaguar_rk3588
     puma_rk3399
     ringneck_px30
+   tiger_rk3588
doc/board/theobroma-systems/tiger_rk3588.rst new file +102 -0
new file mode 100644
index 00000000000..a73eec7fb9b
@@ -0,0 +1,102 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+SOM-RK3588-Q7 Tiger
+===================
+
+The RK3588-Q7 SoM is a Qseven-compatible (70mm x 70mm, MXM-230
+connector) system-on-module from Theobroma Systems, featuring the
+Rockchip RK3588.
+
+It provides the following feature set:
+ * up to 16GB LPDDR4x
+ * on-module eMMC
+ * SD card (on a baseboard) via edge connector
+ * Gigabit Ethernet with on-module GbE PHY
+ * HDMI/eDP
+ * MIPI-DSI
+ * 4x MIPI-CSI (3x on FPC connectors, 1x over Q7)
+ * HDMI input over FPC connector
+ * CAN
+ * USB
+   - 1x USB 3.0 dual-role (direct connection)
+   - 2x USB 3.0 host + 1x USB 2.0 host
+ * PCIe
+   - 1x PCIe 2.1 Gen3, 4 lanes
+   - 2xSATA / 2x PCIe 2.1 Gen1, 2 lanes
+ * on-module ATtiny816 companion controller, implementing:
+   - low-power RTC functionality (ISL1208 emulation)
+   - fan controller (AMC6821 emulation)
+ * on-module Secure Element with Global Platform 2.2.1 compliant
+   JavaCard environment
+
+Here is the step-by-step to boot to U-Boot on SOM-RK3588-Q7 Tiger from Theobroma
+Systems.
+
+Get the TF-A and DDR init (TPL) binaries
+----------------------------------------
+
+.. prompt:: bash
+
+   git clone https://github.com/rockchip-linux/rkbin
+   cd rkbin
+   export RKBIN=$(pwd)
+   export BL31=$RKBIN/bin/rk35/rk3588_bl31_v1.38.elf
+   export ROCKCHIP_TPL=$RKBIN/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.11.bin
+   sed -i 's/^uart baudrate=.*$/uart baudrate=115200/' tools/ddrbin_param.txt
+   sed -i 's/^uart iomux=.*$/uart iomux=2/' tools/ddrbin_param.txt
+   ./tools/ddrbin_tool tools/ddrbin_param.txt "$ROCKCHIP_TPL"
+   ./tools/boot_merger RKBOOT/RK3588MINIALL.ini
+   export RKDB=$RKBIN/rk3588_spl_loader_v1.11.112.bin
+
+This will setup all required external dependencies for compiling U-Boot. This will
+be updated in the future once upstream Trusted-Firmware-A supports RK3588 or U-Boot
+gains support for open-source DRAM initialization in TPL.
+
+Build U-Boot
+------------
+
+.. prompt:: bash
+
+   cd ../u-boot
+   make CROSS_COMPILE=aarch64-linux-gnu- tiger-rk3588_defconfig all
+
+This will build ``u-boot-rockchip.bin`` which can be written to an MMC device
+(eMMC or SD card).
+
+Flash the image
+---------------
+
+Copy ``u-boot-rockchip.bin`` to offset 32k for SD/eMMC.
+
+SD-Card
+~~~~~~~
+
+.. prompt:: bash
+
+   dd if=u-boot-rockchip.bin of=/dev/sdX seek=64
+
+.. note::
+
+   Replace ``/dev/sdX`` to match your SD card kernel device.
+
+eMMC
+~~~~
+
+``rkdeveloptool`` allows to flash the on-board eMMC via the USB OTG interface
+with help of the Rockchip loader binary.
+
+To enter the USB flashing mode on Haikou baseboard, remove any SD card, insert a
+micro-USB cable in the ``Q7 USB P1`` connector (P8), move ``SW5`` switch into
+``BIOS Disable`` mode, power cycle or reset the board and move ``SW5`` switch
+back to ``Normal Boot`` mode. A new USB device should have appeared on your PC
+(check with ``lsusb -d 2207:350b``).
+
+To flash U-Boot on the eMMC with ``rkdeveloptool``:
+
+.. prompt:: bash
+
+   git clone https://github.com/rockchip-linux/rkdeveloptool
+   cd rkdeveloptool
+   autoreconf -i && CPPFLAGS=-Wno-format-truncation ./configure && make
+   ./rkdeveloptool db "$RKDB"
+   ./rkdeveloptool wl 64 ../u-boot-rockchip.bin
include/configs/tiger_rk3588.h new file +15 -0
new file mode 100644
index 00000000000..7a32adfaf2a
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2023 Theobroma Systems Design und Consulting GmbH
+ */
+
+#ifndef __TIGER_RK3588_H
+#define __TIGER_RK3588_H
+
+#define ROCKCHIP_DEVICE_SETTINGS \
+		"stdout=serial,vidconsole\0" \
+		"stderr=serial,vidconsole\0"
+
+#include <configs/rk3588_common.h>
+
+#endif /* __TIGER_RK3588_H */
maintainer Tested-by on the v3 series
#11 lore raw
In reply to Quentin Schulz

Am Montag, 10. Juni 2024, 15:13:30 CEST schrieb Quentin Schulz:

Quoted 24 lines

This has a dependency on https://lore.kernel.org/u-boot/[email protected]/

Changes in v3:
- rebased on top of next,
- changed patch series dependency from DRAM ATAGS (merged) to RK3588
upstream DTS cherry-picks from 6.10-rc1 (USB nodes),
- cherry-picked kernel DTS commits for Tiger between v6.9 and v6.10-rc2,
note that the "arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards" commit triggered some git auto-merging while cherry-picking,
- support for Q7 USB P1 (micro-USB OTG) has been dropped, it requires
extcon USB GPIO driver that isn't supported in U-Boot (yet?),
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- removed uart controller muxing patch as not necessary until we get open-source DRAM init,
- disabled DEBUG_UART_BOARD_INIT as it's only used for muxing the UART controller and it's not necessary since DDR bin does this for us
already,
- added missing uart2 mux bootph in U-Boot dtsi (though not required
yet),
- switched to USB_DWC3_GENERIC from USB_XHCI_DWC3 as requested by Jonas,
- Link to v1: https://lore.kernel.org/r/[email protected]

Quoted 1 line

Putting both the dependency and this series on top of next, still allows my tiger to boot, so