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.tret...@pengutronix.de>
---
Changes in v2:
- none
---
 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


Reply via email to