mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v2] scripts: imx: IMX8MQ: fix header entry offset
@ 2024-04-18  9:24 Benjamin Gaignard
  2024-04-22 12:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2024-04-18  9:24 UTC (permalink / raw)
  To: barebox; +Cc: Benjamin Gaignard

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-22 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  9:24 [PATCH v2] scripts: imx: IMX8MQ: fix header entry offset Benjamin Gaignard
2024-04-22 12:17 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox