mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
To: barebox@lists.infradead.org
Cc: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Subject: [PATCH v2] scripts: imx: IMX8MQ: fix header entry offset
Date: Thu, 18 Apr 2024 11:24:11 +0200	[thread overview]
Message-ID: <20240418092411.224055-1-benjamin.gaignard@collabora.com> (raw)

Unlike other IMX8M, IMX8MQ version use a fixed offset so do a special
case for this SoC.

Fixes: 1c18863354dc ("scripts: imx-image: header_v2: add header_len parameter")
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
version 2:
- Use a fixed offset only for IMX8MQ

 scripts/imx/imx-image.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index bc2e7af5d6..9ba60dbc5b 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -322,7 +322,11 @@ add_header_v2(const struct config_data *data, void *buf, uint32_t offset,
 	hdr->header.length	= htobe16(32);
 	hdr->header.version	= IVT_VERSION;
 
-	hdr->entry		= loadaddr + header_len;
+	/* IMX_CPU_IMX8MQ is a special case with fixed offset */
+	if (data->cpu_type == IMX_CPU_IMX8MQ)
+		hdr->entry	= loadaddr + HEADER_LEN;
+	else
+		hdr->entry	= loadaddr + header_len;
 	if (dcdsize)
 		hdr->dcd_ptr = loadaddr + offset + offsetof(struct imx_flash_header_v2, dcd_header);
 	if (create_usb_image) {
@@ -1019,6 +1023,7 @@ int main(int argc, char *argv[])
 					PLUGIN_HDMI_SIZE);
 
 			header_len += signed_hdmi_firmware_size;
+
 			barebox_image_size += signed_hdmi_firmware_size;
 
 			buf = realloc(buf, header_len);
-- 
2.40.1




             reply	other threads:[~2024-04-18  9:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  9:24 Benjamin Gaignard [this message]
2024-04-22 12:17 ` Sascha Hauer

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=20240418092411.224055-1-benjamin.gaignard@collabora.com \
    --to=benjamin.gaignard@collabora.com \
    --cc=barebox@lists.infradead.org \
    /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