From d3cacb79e7062772e54cb4a2f5a23f873a630b0e Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Mon, 28 Oct 2024 20:00:34 +0100 Subject: board: rockchip: add support for Qnap TS433 devices The Qnap TS433 is a 4-bay NAS based around the RK3568. Two SATA bays are connected to the RK3568's own SATA controllers while the other two are connected to a JMicron SATA controller living on the PCIe bus. It provides one 2.5Gb and one 1Gb ethernet port as well as 3 usb ports. Signed-off-by: Heiko Stuebner Reviewed-by: Kever Yang --- arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi | 6 ++++++ arch/arm/mach-rockchip/rk3568/Kconfig | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi (limited to 'arch') diff --git a/arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi b/arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi new file mode 100644 index 00000000000..19acbceb468 --- /dev/null +++ b/arch/arm/dts/rk3568-qnap-ts433-u-boot.dtsi @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * (C) Copyright 2024 Heiko Stuebner + */ + +#include "rk356x-u-boot.dtsi" diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig index e646f714c92..ce327ed6f9e 100644 --- a/arch/arm/mach-rockchip/rk3568/Kconfig +++ b/arch/arm/mach-rockchip/rk3568/Kconfig @@ -32,6 +32,19 @@ config TARGET_POWKIDDY_X55_RK3566 help Powkiddy X55 handheld gaming console with an RK3566 SoC. +config TARGET_QNAP_TS433_RK3568 + bool "QNAP-TS433" + help + Qnap TS433 4-bay NAS with a RK3568 SoC. + + It provides the following featureset: + * 4GB LPDDR4 + * 4GB eMMC + * 2 SATA ports connected to two RK3568's SATA controllers + * 2 SATA ports connected to a JMicron JMB58x AHCI SATA controller + * 1 1G network controller + * 1 2.5G Realtek RTL8125 network controller + config TARGET_QUARTZ64_RK3566 bool "Pine64 Quartz64" help @@ -70,6 +83,7 @@ source "board/hardkernel/odroid_m1/Kconfig" source "board/hardkernel/odroid_m1s/Kconfig" source "board/pine64/quartz64_rk3566/Kconfig" source "board/powkiddy/x55/Kconfig" +source "board/qnap/ts433/Kconfig" source "board/radxa/zero3-rk3566/Kconfig" source "board/xunlong/orangepi-3b-rk3566/Kconfig" -- cgit v1.2.3 From dfcd4afd4cc0801358f9741d6d6388928a091498 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Mon, 4 Nov 2024 20:23:00 +0800 Subject: board: rockchip: Add support for rk3588 GenBook Add support for Cool Pi GenBook, it works as a carrier board connect with CM5 SOM. Specification: - Rockchip RK3588 - LPDDR5X 8/32 GB - eMMC 64 GB - HDMI Type A out x 1 - USB 3.0 Host x 1 - USB-C 3.0 with DisplayPort AltMode - PCIE M.2 E Key for RTL8852BE Wireless connection - PCIE M.2 M Key for NVME connection - eDP panel with 1920x1080 Tested by Armbian boot on USB disk. Change-Id: I4d9b8572dc7c400077dde666633f3fea1b47dd03 Signed-off-by: Andy Yan Reviewed-by: Kever Yang --- arch/arm/dts/rk3588-coolpi-cm5-genbook-u-boot.dtsi | 20 ++++++++++++++++++++ arch/arm/mach-rockchip/rk3588/Kconfig | 19 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 arch/arm/dts/rk3588-coolpi-cm5-genbook-u-boot.dtsi (limited to 'arch') diff --git a/arch/arm/dts/rk3588-coolpi-cm5-genbook-u-boot.dtsi b/arch/arm/dts/rk3588-coolpi-cm5-genbook-u-boot.dtsi new file mode 100644 index 00000000000..5a3073d6e7f --- /dev/null +++ b/arch/arm/dts/rk3588-coolpi-cm5-genbook-u-boot.dtsi @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +#include "rk3588-u-boot.dtsi" + +&fspim2_pins { + bootph-pre-ram; + bootph-some-ram; +}; + +&sfc { + flash@0 { + bootph-pre-ram; + bootph-some-ram; + }; +}; + +/* USB A out */ +&usb_host1_xhci { + snps,dis_u3_susphy_quirk; +}; diff --git a/arch/arm/mach-rockchip/rk3588/Kconfig b/arch/arm/mach-rockchip/rk3588/Kconfig index 6f28a313325..b5a0e624a53 100644 --- a/arch/arm/mach-rockchip/rk3588/Kconfig +++ b/arch/arm/mach-rockchip/rk3588/Kconfig @@ -29,6 +29,24 @@ config TARGET_CM3588_NAS_RK3588 - 3.5mm Headphone out, 2.0mm PH-2A Mic in - 5V Fan connector, PWM beeper, IR receiver, RTC battery connector +config TARGET_GENBOOK_CM5_RK3588 + bool "Cool Pi CM5 GenBook" + select BOARD_LATE_INIT + help + GeenBook is a notebook based on Rockchip RK3588, and works as a carrier + board connect with CM5 SOM. + + Specification: + - Rockchip RK3588 + - LPDDR5X 8/32 GB + - eMMC 64 GB + - HDMI Type A out x 1 + - USB 3.0 Host x 1 + - USB-C 3.0 with DisplayPort AltMode + - PCIE M.2 E Key for RTL8852BE Wireless connection + - PCIE M.2 M Key for NVME connection + - eDP panel with 1920x1080 + config TARGET_JAGUAR_RK3588 bool "Theobroma Systems SBC-RK3588-AMR (Jaguar)" select BOARD_LATE_INIT @@ -367,6 +385,7 @@ config TEXT_BASE default 0x00a00000 source "board/armsom/sige7-rk3588/Kconfig" +source "board/coolpi/genbook_cm5_rk3588/Kconfig" source "board/edgeble/neural-compute-module-6/Kconfig" source "board/friendlyelec/cm3588-nas-rk3588/Kconfig" source "board/friendlyelec/nanopc-t6-rk3588/Kconfig" -- cgit v1.2.3 From 3133b7c645157846590f6fc16e26f54d70f5e1d6 Mon Sep 17 00:00:00 2001 From: Jonas Karlman Date: Fri, 1 Nov 2024 22:21:30 +0000 Subject: board: rockchip: Add FriendlyElec NanoPi R2S Plus The FriendlyElec NanoPi R2S Plus is a single-board computer based on Rockchip RK3328 SoC. It features e.g. 1 GB DDR4 RAM, 32 GB eMMC, SD-card, 2x GbE LAN, optional M.2 SDIO Wi-Fi and 2x USB 2.0 host. Features tested on a NanoPi R2S Plus 2309: - SD-card boot - eMMC boot - Ethernet - USB gadget - USB host Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- arch/arm/dts/rk3328-nanopi-r2s-plus-u-boot.dtsi | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 arch/arm/dts/rk3328-nanopi-r2s-plus-u-boot.dtsi (limited to 'arch') diff --git a/arch/arm/dts/rk3328-nanopi-r2s-plus-u-boot.dtsi b/arch/arm/dts/rk3328-nanopi-r2s-plus-u-boot.dtsi new file mode 100644 index 00000000000..2ab32cf00a1 --- /dev/null +++ b/arch/arm/dts/rk3328-nanopi-r2s-plus-u-boot.dtsi @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rk3328-nanopi-r2s-u-boot.dtsi" -- cgit v1.2.3 From b21fd44c84fd5053a350de6138fb832839c04b67 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Wed, 6 Nov 2024 12:29:42 +0100 Subject: rockchip: rk3399: merge CRU check within rk3399_force_power_on_reset To prepare to support forcing power on reset from TPL which would have the exact same logic, just in an earlier stage, let's merge the CRU check that triggers the power on reset with the rest of the logic. Reviewed-by: Paul Kocialkowski Signed-off-by: Quentin Schulz Reviewed-by: Kever Yang --- arch/arm/mach-rockchip/rk3399/rk3399.c | 43 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index edccb2a3980..7b6a822ed04 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -172,9 +172,29 @@ void board_debug_uart_init(void) #if defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD) static void rk3399_force_power_on_reset(void) { + const struct rockchip_cru *cru = rockchip_get_cru(); ofnode node; struct gpio_desc sysreset_gpio; + /* + * The RK3399 resets only 'almost all logic' (see also in the + * TRM "3.9.4 Global software reset"), when issuing a software + * reset. This may cause issues during boot-up for some + * configurations of the application software stack. + * + * To work around this, we test whether the last reset reason + * was a power-on reset and (if not) issue an overtemp-reset to + * reset the entire module. + * + * While this was previously fixed by modifying the various + * places that could generate a software reset (e.g. U-Boot's + * sysreset driver, the ATF or Linux), we now have it here to + * ensure that we no longer have to track this through the + * various components. + */ + if (cru->glb_rst_st == 0) + return; + if (!IS_ENABLED(CONFIG_SPL_GPIO)) { debug("%s: trying to force a power-on reset but no GPIO " "support in SPL!\n", __func__); @@ -206,27 +226,6 @@ void spl_board_init(void) { led_setup(); - if (IS_ENABLED(CONFIG_SPL_GPIO)) { - struct rockchip_cru *cru = rockchip_get_cru(); - - /* - * The RK3399 resets only 'almost all logic' (see also in the - * TRM "3.9.4 Global software reset"), when issuing a software - * reset. This may cause issues during boot-up for some - * configurations of the application software stack. - * - * To work around this, we test whether the last reset reason - * was a power-on reset and (if not) issue an overtemp-reset to - * reset the entire module. - * - * While this was previously fixed by modifying the various - * places that could generate a software reset (e.g. U-Boot's - * sysreset driver, the ATF or Linux), we now have it here to - * ensure that we no longer have to track this through the - * various components. - */ - if (cru->glb_rst_st != 0) - rk3399_force_power_on_reset(); - } + rk3399_force_power_on_reset(); } #endif -- cgit v1.2.3 From 7461d55ca7d1a55d5f90c5d33501a369eabd4277 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Wed, 6 Nov 2024 12:29:43 +0100 Subject: rockchip: tpl: allow to call board/SoC-specific code before DRAM init This defines a weak tpl_board_init function that can be used for running board/SoC-specific code before the DRAM init happens, similarly to spl_board_init() for SPL. Reviewed-by: Paul Kocialkowski Signed-off-by: Quentin Schulz Reviewed-by: Kever Yang --- arch/arm/mach-rockchip/tpl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index bbb9329e725..6b880f19f84 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -21,6 +21,10 @@ #include #endif +__weak void tpl_board_init(void) +{ +} + void board_init_f(ulong dummy) { struct udevice *dev; @@ -54,6 +58,8 @@ void board_init_f(ulong dummy) if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER)) timer_init(); + tpl_board_init(); + ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { printf("DRAM init failed: %d\n", ret); -- cgit v1.2.3 From 0a17123dedf827f4ca9b158252279adf03906307 Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Wed, 6 Nov 2024 12:29:44 +0100 Subject: rockchip: rk3399: move sysreset-gpio logic to TPL If TPL_GPIO and TPL_PINCTRL_ROCKCHIP are enabled and a sysreset-gpio is provided in the TPL Device Tree, this will trigger a system reset similar to what's currently been done in SPL whenever the RK3399 "warm" boots. Because there's currently only one user of sysreset-gpio logic, and TPL is enabled on that board, so let's migrate the logic and that board to do it in TPL. There are three reasons for moving this earlier: - faster boot time as we don't need to reach SPL to be able to reset the system on a condition we know is already met in TPL, - have less code to be impacted by the issue this system reset works around (that is, "unclean" SoC registers after a reboot), - less confusion around the reason for restarting. Indeed when done from SPL, the following log can be observed: """ U-Boot TPL 2025.01-rc1-00165-gd79216ca9878-dirty (Nov 05 2024 - 15:31:45) Channel 0: DDR3, 666MHz BW=32 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=2048MB Channel 1: DDR3, 666MHz BW=32 Col=10 Bk=8 CS0 Row=16 CS=1 Die BW=16 Size=2048MB 256B stride Trying to boot from BOOTROM Returning to boot ROM... U-Boot SPL 2025.01-rc1-00165-gd79216ca9878-dirty (Nov 05 2024 - 15:31:45 +0100) Trying to boot from MMC2 U-Boot TPL 2025.01-rc1-00165-gd79216ca9878-dirty (Nov 05 2024 - 15:31:45) """ possibly hinting at an issue within the SPL when loading the fitImage from MMC2 instead of the normal course of events (a system reset). Signed-off-by: Quentin Schulz Reviewed-by: Paul Kocialkowski Reviewed-by: Kever Yang --- arch/arm/mach-rockchip/rk3399/rk3399.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c index 7b6a822ed04..0c28241c603 100644 --- a/arch/arm/mach-rockchip/rk3399/rk3399.c +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c @@ -169,7 +169,8 @@ void board_debug_uart_init(void) } #endif -#if defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD) +#if defined(CONFIG_XPL_BUILD) +#if defined(CONFIG_TPL_BUILD) static void rk3399_force_power_on_reset(void) { const struct rockchip_cru *cru = rockchip_get_cru(); @@ -195,9 +196,9 @@ static void rk3399_force_power_on_reset(void) if (cru->glb_rst_st == 0) return; - if (!IS_ENABLED(CONFIG_SPL_GPIO)) { + if (!IS_ENABLED(CONFIG_TPL_GPIO)) { debug("%s: trying to force a power-on reset but no GPIO " - "support in SPL!\n", __func__); + "support in TPL!\n", __func__); return; } @@ -218,6 +219,11 @@ static void rk3399_force_power_on_reset(void) dm_gpio_set_value(&sysreset_gpio, 1); } +void tpl_board_init(void) +{ + rk3399_force_power_on_reset(); +} +# else void __weak led_setup(void) { } @@ -225,7 +231,6 @@ void __weak led_setup(void) void spl_board_init(void) { led_setup(); - - rk3399_force_power_on_reset(); } #endif +#endif -- cgit v1.2.3