[PATCH v3 4/4] arm64: rockchip: qnap-tsx33: support USB installer with EFI
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Dec 18 13:33:10 PST 2025
[ NOT FOR MERGING ]
We do not do USB enumeration by default, but we should if we want to be
able to boot off an UEFI installer image inserted via USB.
This has been tested on QNAP TS-433eU with
debian-13.1.0-arm64-netinst.iso.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
Included, just for informational purposes, until EFI loader support is
upstream.
---
Documentation/boards/rk35xx/qnap-tsx33.rst | 26 +++++++++++++++++--
arch/arm/boards/qnap-tsx33/Makefile | 1 +
arch/arm/boards/qnap-tsx33/board.c | 3 +++
.../defaultenv-tsx33/init/usbdetect | 6 +++++
4 files changed, 34 insertions(+), 2 deletions(-)
create mode 100755 arch/arm/boards/qnap-tsx33/defaultenv-tsx33/init/usbdetect
diff --git a/Documentation/boards/rk35xx/qnap-tsx33.rst b/Documentation/boards/rk35xx/qnap-tsx33.rst
index b205e31e561b..0a21df4a2b12 100644
--- a/Documentation/boards/rk35xx/qnap-tsx33.rst
+++ b/Documentation/boards/rk35xx/qnap-tsx33.rst
@@ -24,6 +24,14 @@ With these barebox can be compiled as:
If cross-compiling, ``CROSS_COMPILE`` needs to be additionally set.
+Alternatively, if you enable barebox to boot an OS image with
+UEFI, use:
+
+.. code-block:: sh
+
+ make ARCH=arm rockchip_v8_efiloader_defconfig
+ make ARCH=arm
+
Flashing via USB
----------------
@@ -48,5 +56,19 @@ load barebox into RAM and flash it to the eMMC using ``fastboot``:
Booting Debian
--------------
-Refer to https://wiki.debian.org/InstallingDebianOn/Qnap/TS-433
-for information on how to install Debian.
+Flash the Debian netinstall image to a USB stick and insert it into
+the (first) front USB and power on the device after having flashed
+barebox to the eMMC as per the previous section.
+
+It should then boot into a GRUB menu and from there into the
+Debian installer.
+
+When the installer asks you at the end about whether to also install
+GRUB to the removable media path, say **yes**.
+
+After installation is done, remove the USB drive and the system
+will automatically boot from the Debian system installed to the
+eMMC.
+
+Refer also to https://wiki.debian.org/InstallingDebianOn/Qnap/TS-433
+for more information on how to install Debian.
diff --git a/arch/arm/boards/qnap-tsx33/Makefile b/arch/arm/boards/qnap-tsx33/Makefile
index 1d052d28c9fc..ec1b7fb7486b 100644
--- a/arch/arm/boards/qnap-tsx33/Makefile
+++ b/arch/arm/boards/qnap-tsx33/Makefile
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
lwl-y += lowlevel.o
obj-y += board.o
+bbenv-y += defaultenv-tsx33
diff --git a/arch/arm/boards/qnap-tsx33/board.c b/arch/arm/boards/qnap-tsx33/board.c
index a4e86b0337f8..c407401e571a 100644
--- a/arch/arm/boards/qnap-tsx33/board.c
+++ b/arch/arm/boards/qnap-tsx33/board.c
@@ -7,6 +7,7 @@
#include <globalvar.h>
#include <envfs.h>
#include <deep-probe.h>
+#include <environment.h>
#include <linux/usb/gadget-multi.h>
struct ts433_match_data {
@@ -49,6 +50,8 @@ static int ts433_probe(struct device *dev)
rockchip_bbu_mmc_register("emmc", BBU_HANDLER_FLAG_DEFAULT, "/dev/mmc0");
+ defaultenv_append_directory(defaultenv_tsx33);
+
return 0;
}
diff --git a/arch/arm/boards/qnap-tsx33/defaultenv-tsx33/init/usbdetect b/arch/arm/boards/qnap-tsx33/defaultenv-tsx33/init/usbdetect
new file mode 100755
index 000000000000..f2d30f01ac32
--- /dev/null
+++ b/arch/arm/boards/qnap-tsx33/defaultenv-tsx33/init/usbdetect
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -n "${efi.loader}" ] && [ "${bootsource}" = mmc ]; then
+ otg.mode=host
+ usb
+fi
--
2.47.3
More information about the barebox
mailing list