[PATCH 6/7] rockchip: mkimage: Add option for image load address and flag
Alexey Charkov
alchark at flipper.net
Mon Jul 13 12:02:47 CEST 2026
From: Jonas Karlman <jonas at kwiboo.se>
The v2 image format supports defining a load address and flag for each
embedded image.
Add initial support for writing the image load address and flag to the
v2 image format header.
This may later be used for RK3576 to embed a minimal initial image that
if required to fix booting from SD-card due to a BootROM issue.
Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
Signed-off-by: Alexey Charkov <alchark at flipper.net>
---
tools/rkcommon.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index a52d1f36d772..81361cde4823 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -169,12 +169,16 @@ static struct spl_info spl_infos[] = {
*
* @file: image file path
* @size: aligned size of image in bytes
+ * @address: image load address
+ * @flag: no use
*/
struct spl_params {
struct {
char *file;
uint32_t size;
+ uint32_t address;
+ uint32_t flag;
} images[4];
};
@@ -385,7 +389,8 @@ static void rkcommon_set_header0_v2(void *buf, struct image_tool_params *params)
image_sector_count = spl_params.images[i].size / RK_BLK_SIZE;
hdr->images[i].offset = cpu_to_le16(sector_offset);
hdr->images[i].size = cpu_to_le16(image_sector_count);
- hdr->images[i].address = 0xFFFFFFFF;
+ hdr->images[i].address = spl_params.images[i].address ?: 0xFFFFFFFF;
+ hdr->images[i].flag = spl_params.images[i].flag;
hdr->images[i].counter = cpu_to_le32(i + 1);
image_ptr = buf + sector_offset * RK_BLK_SIZE;
do_sha256_hash(image_ptr, spl_params.images[i].size,
--
2.53.0
More information about the U-Boot
mailing list