From: "Uwe Kleine-König" <uwe@kleine-koenig.org>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] WIP: arm64: rockchip: Add support for QNAP's ts-433 4bay NAS
Date: Sat, 1 Mar 2025 17:36:21 +0100 [thread overview]
Message-ID: <1ec0faa7cbbbe074c328bb8be3dbb571fa4587b2.1740846737.git.uwe@kleine-koenig.org> (raw)
In-Reply-To: <cover.1740846737.git.uwe@kleine-koenig.org>
The resulting image boots to a prompt using usb booting. But neither
network nor eMMC work :-\
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
---
Documentation/boards/rockchip.rst | 1 +
arch/arm/boards/Makefile | 1 +
arch/arm/boards/qnap-tsx33/.gitignore | 1 +
arch/arm/boards/qnap-tsx33/Makefile | 2 ++
arch/arm/boards/qnap-tsx33/lowlevel.c | 27 ++++++++++++++++++++++++++
arch/arm/configs/rockchip_v8_defconfig | 1 +
arch/arm/dts/Makefile | 1 +
arch/arm/dts/rk3568-qnap-ts433.dts | 27 ++++++++++++++++++++++++++
arch/arm/mach-rockchip/Kconfig | 7 +++++++
images/Makefile.rockchip | 1 +
10 files changed, 69 insertions(+)
create mode 100644 arch/arm/boards/qnap-tsx33/.gitignore
create mode 100644 arch/arm/boards/qnap-tsx33/Makefile
create mode 100644 arch/arm/boards/qnap-tsx33/lowlevel.c
create mode 100644 arch/arm/dts/rk3568-qnap-ts433.dts
diff --git a/Documentation/boards/rockchip.rst b/Documentation/boards/rockchip.rst
index b2b04abb03cd..a9499e3560dd 100644
--- a/Documentation/boards/rockchip.rst
+++ b/Documentation/boards/rockchip.rst
@@ -61,6 +61,7 @@ Supported Boards
- Pine64 Quartz64 Model A
- Radxa ROCK3 Model A
- Radxa CM3 (RK3566) IO Board
+- QNAP TS-433 NAS
- Protonic MECSBC
The steps described in the following target the RK3568 and the RK3568 EVB but
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index c6104d043297..747676056a45 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -94,6 +94,7 @@ obj-$(CONFIG_MACH_PROTONIC_STM32MP1) += protonic-stm32mp1/
obj-$(CONFIG_MACH_PROTONIC_STM32MP13) += protonic-stm32mp13/
obj-$(CONFIG_MACH_QIL_A9260) += qil-a926x/
obj-$(CONFIG_MACH_QIL_A9G20) += qil-a926x/
+obj-$(CONFIG_MACH_QNAP_TSX33) += qnap-tsx33/
obj-$(CONFIG_MACH_RADXA_ROCK) += radxa-rock/
obj-$(CONFIG_MACH_PHYTEC_SOM_RK3288) += phytec-som-rk3288/
obj-$(CONFIG_MACH_REALQ7) += datamodul-edm-qmx6/
diff --git a/arch/arm/boards/qnap-tsx33/.gitignore b/arch/arm/boards/qnap-tsx33/.gitignore
new file mode 100644
index 000000000000..f458f794b54c
--- /dev/null
+++ b/arch/arm/boards/qnap-tsx33/.gitignore
@@ -0,0 +1 @@
+sdram-init.bin
diff --git a/arch/arm/boards/qnap-tsx33/Makefile b/arch/arm/boards/qnap-tsx33/Makefile
new file mode 100644
index 000000000000..9961af02a3ea
--- /dev/null
+++ b/arch/arm/boards/qnap-tsx33/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0-only
+lwl-y += lowlevel.o
diff --git a/arch/arm/boards/qnap-tsx33/lowlevel.c b/arch/arm/boards/qnap-tsx33/lowlevel.c
new file mode 100644
index 000000000000..f852e8d00a2b
--- /dev/null
+++ b/arch/arm/boards/qnap-tsx33/lowlevel.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0-only
+#include <common.h>
+#include <linux/sizes.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/rockchip/hardware.h>
+#include <mach/rockchip/atf.h>
+#include <debug_ll.h>
+#include <mach/rockchip/rockchip.h>
+
+extern char __dtb_rk3568_qnap_ts433_start[];
+
+ENTRY_FUNCTION(start_rk3568_qnap_ts433, r0, r1, r2)
+{
+ /*
+ * Image execution starts at 0x0, but this is used for ATF and
+ * OP-TEE later, so move away from here.
+ */
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ rk3568_barebox_entry(__dtb_rk3568_qnap_ts433_start);
+}
diff --git a/arch/arm/configs/rockchip_v8_defconfig b/arch/arm/configs/rockchip_v8_defconfig
index f1f418872385..86f31affa901 100644
--- a/arch/arm/configs/rockchip_v8_defconfig
+++ b/arch/arm/configs/rockchip_v8_defconfig
@@ -4,6 +4,7 @@ CONFIG_MACH_RK3568_BPI_R2PRO=y
CONFIG_MACH_PINE64_PINETAB2=y
CONFIG_MACH_PINE64_QUARTZ64=y
CONFIG_MACH_PROTONIC_MECSBC=y
+CONFIG_MACH_QNAP_TSX33=y
CONFIG_MACH_RADXA_ROCK3=y
CONFIG_MACH_RADXA_ROCK5=y
CONFIG_MACH_RADXA_CM3=y
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d2de01927824..b4875cc00c91 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -117,6 +117,7 @@ lwl-$(CONFIG_MACH_PROTONIC_STM32MP1) += \
stm32mp151-mecio1.dtb.o \
stm32mp151-mect1s.dtb.o
lwl-$(CONFIG_MACH_PROTONIC_STM32MP13) += stm32mp133c-prihmb.dtb.o
+lwl-$(CONFIG_MACH_QNAP_TSX33) += rk3568-qnap-ts433.dtb.o
lwl-$(CONFIG_MACH_RADXA_ROCK) += rk3188-radxarock.dtb.o
lwl-$(CONFIG_MACH_RADXA_ROCK3) += rk3568-rock-3a.dtb.o
lwl-$(CONFIG_MACH_RADXA_ROCK5) += rk3588-rock-5b.dtb.o
diff --git a/arch/arm/dts/rk3568-qnap-ts433.dts b/arch/arm/dts/rk3568-qnap-ts433.dts
new file mode 100644
index 000000000000..05876656b4e2
--- /dev/null
+++ b/arch/arm/dts/rk3568-qnap-ts433.dts
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+
+/dts-v1/;
+#include <arm64/rockchip/rk3568-qnap-ts433.dts>
+#include "rk356x.dtsi"
+
+/ {
+ chosen: chosen {
+ environment-emmc {
+ compatible = "barebox,environment";
+ device-path = &environment_emmc;
+ };
+ };
+};
+
+&sdmmc0 {
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ environment_emmc: partition@408000 {
+ label = "barebox-environment";
+ reg = <0x0 0x408000 0x0 0x8000>;
+ };
+ };
+};
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index bfbfa7367a3e..f8b0d5e4ec54 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -106,6 +106,13 @@ config MACH_PROTONIC_MECSBC
help
Say Y here if you are using a Protonic MECSBC
+config MACH_QNAP_TSX33
+ select ARCH_RK3568
+ bool "QNAP TS-433 NAS"
+ help
+ Select this if you are using a QNAP TS-433 NAS.
+ <https://www.qnap.com/en-us/product/ts-433>
+
config MACH_RADXA_ROCK3
select ARCH_RK3568
bool "Radxa ROCK3"
diff --git a/images/Makefile.rockchip b/images/Makefile.rockchip
index 761c6b814989..2e63e554edce 100644
--- a/images/Makefile.rockchip
+++ b/images/Makefile.rockchip
@@ -35,6 +35,7 @@ $(call build_rockchip_image, CONFIG_MACH_PINE64_PINETAB2, start_pinetab2_v0, pin
$(call build_rockchip_image, CONFIG_MACH_PINE64_PINETAB2, start_pinetab2_v2, pine64-pinetab2/sdram-init.bin, pinetab2-v2)
$(call build_rockchip_image, CONFIG_MACH_PINE64_QUARTZ64, start_quartz64a, pine64-quartz64/sdram-init.bin, quartz64a)
$(call build_rockchip_image, CONFIG_MACH_PROTONIC_MECSBC, start_mecsbc, protonic-mecsbc/sdram-init.bin, mecsbc)
+$(call build_rockchip_image, CONFIG_MACH_QNAP_TSX33, start_rk3568_qnap_ts433, qnap-tsx33/sdram-init.bin, qnap-ts433)
$(call build_rockchip_image, CONFIG_MACH_RADXA_ROCK3, start_rock3a, radxa-rock3/sdram-init.bin, rock3a)
$(call build_rockchip_image, CONFIG_MACH_RADXA_ROCK5, start_rock5b, radxa-rock5/sdram-init.bin, rock5b)
$(call build_rockchip_image, CONFIG_MACH_RADXA_CM3, start_radxa_cm3_io, radxa-cm3/sdram-init.bin, radxa-cm3-io)
--
2.47.1
next prev parent reply other threads:[~2025-03-01 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-01 16:36 [PATCH 0/4] " Uwe Kleine-König
2025-03-01 16:36 ` [PATCH 1/4] Documentation: rockchip: Update versions of DDR init blobs Uwe Kleine-König
2025-03-01 16:36 ` [PATCH 2/4] arm64: rockchip: Refresh rockchip_v8_defconfig Uwe Kleine-König
2025-03-01 16:36 ` [PATCH 3/4] arm64: rockchip: Enable rk-usb-loader in rockchip_v8_defconfig Uwe Kleine-König
2025-03-01 16:36 ` Uwe Kleine-König [this message]
2025-03-04 9:15 ` [PATCH 0/4] Add support for QNAP's ts-433 4bay NAS Sascha Hauer
2025-03-04 9:15 ` (subset) " Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1ec0faa7cbbbe074c328bb8be3dbb571fa4587b2.1740846737.git.uwe@kleine-koenig.org \
--to=uwe@kleine-koenig.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox