mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] scripts: imx: fix header entry offset
@ 2024-04-18  8:34 Benjamin Gaignard
  2024-04-18  8:40 ` Marco Felsch
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Gaignard @ 2024-04-18  8:34 UTC (permalink / raw)
  To: barebox; +Cc: Benjamin Gaignard

Header entry is at a fixed offset and doesn't rely on header lenght.
Use header lenght create a bug when adding a signed firmware like
the HDMI firmware for IMX8MQ.

Fixes: 1c18863354dc ("scripts: imx-image: header_v2: add header_len parameter")
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
 scripts/imx/imx-image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
index bc2e7af5d6..4f4d5526ed 100644
--- a/scripts/imx/imx-image.c
+++ b/scripts/imx/imx-image.c
@@ -322,7 +322,7 @@ 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;
+	hdr->entry		= loadaddr + HEADER_LEN;
 	if (dcdsize)
 		hdr->dcd_ptr = loadaddr + offset + offsetof(struct imx_flash_header_v2, dcd_header);
 	if (create_usb_image) {
-- 
2.40.1




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

* Re: [PATCH] scripts: imx: fix header entry offset
  2024-04-18  8:34 [PATCH] scripts: imx: fix header entry offset Benjamin Gaignard
@ 2024-04-18  8:40 ` Marco Felsch
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Felsch @ 2024-04-18  8:40 UTC (permalink / raw)
  To: Benjamin Gaignard; +Cc: barebox

Hi Benjamin,

On 24-04-18, Benjamin Gaignard wrote:
> Header entry is at a fixed offset and doesn't rely on header lenght.
> Use header lenght create a bug when adding a signed firmware like
> the HDMI firmware for IMX8MQ.

NAK, please see b6e2b263f304 ("scripts: imx-image: header_v2: add
header_len parameter") and following commits. We would need to fix the
issue for i.MX8MQ differently.

Regards,
  Marco

> Fixes: 1c18863354dc ("scripts: imx-image: header_v2: add header_len parameter")
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
>  scripts/imx/imx-image.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c
> index bc2e7af5d6..4f4d5526ed 100644
> --- a/scripts/imx/imx-image.c
> +++ b/scripts/imx/imx-image.c
> @@ -322,7 +322,7 @@ 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;
> +	hdr->entry		= loadaddr + HEADER_LEN;
>  	if (dcdsize)
>  		hdr->dcd_ptr = loadaddr + offset + offsetof(struct imx_flash_header_v2, dcd_header);
>  	if (create_usb_image) {
> -- 
> 2.40.1
> 
> 
> 



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

end of thread, other threads:[~2024-04-18  8:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18  8:34 [PATCH] scripts: imx: fix header entry offset Benjamin Gaignard
2024-04-18  8:40 ` Marco Felsch

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