mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Michael Tretter <m.tretter@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Michael Tretter <m.tretter@pengutronix.de>
Subject: [PATCH 5/5] scripts: rockchip: support RKSS images
Date: Thu, 31 Jul 2025 12:48:25 +0200	[thread overview]
Message-ID: <20250731-rkimage-cleanup-v1-5-967037e5d67a@pengutronix.de> (raw)
In-Reply-To: <20250731-rkimage-cleanup-v1-0-967037e5d67a@pengutronix.de>

RKSS is the magic for signed images. Add this magic to the rk-usb-loader
to be able to load signed images via USB.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
 scripts/rk-usb-loader.c | 7 ++++---
 scripts/rockchip.h      | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/rk-usb-loader.c b/scripts/rk-usb-loader.c
index 87b5e3e3060579bc0473a15a9ef1f86c0ee2b720..c9769d79d3d4d487af5008e45e35c29ea3eba99e 100644
--- a/scripts/rk-usb-loader.c
+++ b/scripts/rk-usb-loader.c
@@ -222,9 +222,10 @@ static int upload_image(const char *filename)
 
 	hdr = buf;
 
-	if (hdr->magic != NEWIDB_MAGIC_RKNS) {
-		log_error("%s has invalid magic 0x%08x ( != 0x%08x )\n", filename,
-			  hdr->magic, NEWIDB_MAGIC_RKNS);
+	if (hdr->magic != NEWIDB_MAGIC_RKNS &&
+	    hdr->magic != NEWIDB_MAGIC_RKSS) {
+		log_error("%s has invalid magic 0x%08x\n",
+			  filename, hdr->magic);
 		exit(1);
 	}
 
diff --git a/scripts/rockchip.h b/scripts/rockchip.h
index c4cedfa5669e59506b7c2c32d53bbdafec0e0dac..ed915bdf593ca23aab2046b0997743babbbc371a 100644
--- a/scripts/rockchip.h
+++ b/scripts/rockchip.h
@@ -2,6 +2,7 @@
 #define __ROCKCHIP_H
 
 #define NEWIDB_MAGIC_RKNS 0x534e4b52
+#define NEWIDB_MAGIC_RKSS 0x53534b52
 
 #define NEWIDB_FLAGS_SHA256	(1U << 0)
 #define NEWIDB_FLAGS_SHA512	(1U << 1)

-- 
2.39.5




      parent reply	other threads:[~2025-07-31 10:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31 10:48 [PATCH 0/5] scripts: rockchip: fix and cleanup rkimage Michael Tretter
2025-07-31 10:48 ` [PATCH 1/5] scripts: rockchip: use correct header size Michael Tretter
2025-07-31 10:48 ` [PATCH 2/5] scripts: rockchip: add helper for updating hash Michael Tretter
2025-08-05  5:06   ` Sascha Hauer
2025-07-31 10:48 ` [PATCH 3/5] scripts: rockchip: rename hashtype to flags Michael Tretter
2025-07-31 10:48 ` [PATCH 4/5] scripts: rockchip: rename NEWIDB_MAGIC to NEWIDB_MAGIC_RKNS Michael Tretter
2025-07-31 10:48 ` Michael Tretter [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=20250731-rkimage-cleanup-v1-5-967037e5d67a@pengutronix.de \
    --to=m.tretter@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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