From: Jonas Karlman <jonas@kwiboo.se>
To: Kever Yang <kever.yang@rock-chips.com>,
Simon Glass <sjg@chromium.org>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Jonas Karlman <jonas@kwiboo.se>
Subject: [PATCH 6/6] rockchip: mkimage: Add option for image load address and flag
Date: Wed, 29 Jan 2025 22:36:32 +0000 [thread overview]
Message-ID: <20250129223641.1888833-7-jonas@kwiboo.se> (raw)
In-Reply-To: <20250129223641.1888833-1-jonas@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@kwiboo.se>
---
tools/rkcommon.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index 4ff48e81a636..952b76297dd9 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -150,12 +150,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];
};
@@ -366,7 +370,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.48.1
next prev parent reply other threads:[~2025-01-29 22:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-29 22:36 [PATCH 0/6] rockchip: mkimage: Improve support for v2 image format Jonas Karlman
2025-01-29 22:36 ` [PATCH 1/6] rockchip: mkimage: Split size_and_off and size_and_nimage Jonas Karlman
2025-02-05 15:40 ` Quentin Schulz
2025-02-05 18:50 ` Jonas Karlman
2025-01-29 22:36 ` [PATCH 2/6] rockchip: mkimage: Print image information for all embedded images Jonas Karlman
2025-02-05 15:57 ` Quentin Schulz
2025-02-05 19:36 ` Jonas Karlman
2025-02-06 14:23 ` Quentin Schulz
2025-01-29 22:36 ` [PATCH 3/6] rockchip: mkimage: Print boot0 and boot1 parameters Jonas Karlman
2025-02-05 16:04 ` Quentin Schulz
2025-02-05 16:42 ` Jonas Karlman
2025-02-05 16:48 ` Quentin Schulz
2025-02-05 19:15 ` Jonas Karlman
2025-01-29 22:36 ` [PATCH 4/6] rockchip: mkimage: Add option to change image offset alignment Jonas Karlman
2025-02-05 16:29 ` Quentin Schulz
2025-02-05 16:58 ` Jonas Karlman
2025-01-29 22:36 ` [PATCH 5/6] rockchip: mkimage: Add support for up to 4 input files Jonas Karlman
2025-02-05 16:43 ` Quentin Schulz
2025-02-05 19:00 ` Jonas Karlman
2025-02-06 14:36 ` Quentin Schulz
2025-01-29 22:36 ` Jonas Karlman [this message]
2025-02-05 16:51 ` [PATCH 6/6] rockchip: mkimage: Add option for image load address and flag Quentin Schulz
2025-02-05 19:54 ` Jonas Karlman
2025-02-06 14:30 ` Quentin Schulz
2025-05-06 7:38 ` [PATCH 0/6] rockchip: mkimage: Improve support for v2 image format Kever Yang
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=20250129223641.1888833-7-jonas@kwiboo.se \
--to=jonas@kwiboo.se \
--cc=kever.yang@rock-chips.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.