[PATCH] scripts: rk-usb-loader: push header first

Sascha Hauer s.hauer at pengutronix.de
Wed Mar 11 03:03:47 PDT 2026


From: Michael Tretter <m.tretter at pengutronix.de>

Board that have secure boot enabled need the image header to be able
to verify the signature. Boards with secure boot disabled still work
with this patch as tested on a RK3588 board.

Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 scripts/rk-usb-loader.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
index c9769d79d3..157bb5ad5c 100644
--- a/scripts/rk-usb-loader.c
+++ b/scripts/rk-usb-loader.c
@@ -256,6 +256,11 @@ static int upload_image(const char *filename)
 		goto err;
 	}
 
+	log_info("Uploading header\n");
+	ret = upload(dev, 0x471, hdr, sizeof(*hdr));
+	if (ret)
+		goto err;
+
 	for (i = 0; i < n_files; i++) {
 		struct newidb_entry *entry = &hdr->entries[i];
 		int foffset, fsize, wIndex;
-- 
2.47.3




More information about the barebox mailing list