[PATCH v2] scripts: imx: IMX8MQ: fix header entry offset

Benjamin Gaignard benjamin.gaignard at collabora.com
Thu Apr 18 02:24:11 PDT 2024


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 at 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




More information about the barebox mailing list