[PATCH 1/4] filetype: detect Rockchip signed images
Michael Tretter
m.tretter at pengutronix.de
Wed Aug 20 03:16:57 PDT 2025
Rockchip signed images use the RKSS magic instead of the RKNS magic.
Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
---
common/filetype.c | 4 ++++
include/filetype.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/common/filetype.c b/common/filetype.c
index 019f34811103ac66dae05e8c09b15fc061602eb8..eb397a175cb63df06e4426d2b99e4fde360c5b11 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -85,6 +85,8 @@ static const struct filetype_str filetype_str[] = {
[filetype_rockchip_rkns_image] = { "Rockchip boot image", "rk-image" },
[filetype_fip] = { "TF-A Firmware Image Package", "fip" },
[filetype_zstd_compressed] = { "ZSTD compressed", "zstd" },
+ [filetype_rockchip_rkss_image] = { "Rockchip signed boot image",
+ "rk-image" },
};
static const char *file_type_to_nr_string(enum filetype f)
@@ -385,6 +387,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
if (strncmp(buf8, "RKNS", 4) == 0)
return filetype_rockchip_rkns_image;
+ if (strncmp(buf8, "RKSS", 4) == 0)
+ return filetype_rockchip_rkss_image;
if (le32_to_cpu(buf[0]) == le32_to_cpu(0xaa640001))
return filetype_fip;
diff --git a/include/filetype.h b/include/filetype.h
index e66237878615ecf039e12ac68055000b60fc13a9..6f4a103df3040ef259660d06ca878f72e2245c12 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -66,6 +66,7 @@ enum filetype {
filetype_qemu_fw_cfg,
filetype_nxp_fspi_image,
filetype_zstd_compressed,
+ filetype_rockchip_rkss_image,
filetype_max,
};
--
2.39.5
More information about the barebox
mailing list