From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH v3 4/4] arm64: rockchip: qnap-tsx33: support USB installer with EFI
Date: Thu, 18 Dec 2025 22:33:10 +0100 [thread overview]
Message-ID: <20251218213542.3263658-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20251218213542.3263658-1-a.fatoum@pengutronix.de>
[ 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@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
prev parent reply other threads:[~2025-12-18 21:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 21:33 [PATCH v3 1/4] Documentation: split Rockchip documentation Ahmad Fatoum
2025-12-18 21:33 ` [PATCH v3 2/4] Documentation: rk35xx: expand on supported SoCs/boards Ahmad Fatoum
2025-12-18 21:33 ` [PATCH v3 3/4] arm64: rockchip: Add support for QNAP's ts-433 4bay NAS Ahmad Fatoum
2025-12-18 21:33 ` Ahmad Fatoum [this message]
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=20251218213542.3263658-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--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