All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field
@ 2022-07-02 23:58 Peng Fan (OSS)
  2022-07-03  6:43 ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan (OSS) @ 2022-07-02 23:58 UTC (permalink / raw)
  To: sbabic, festevam; +Cc: u-boot, Peng Fan, Mihai Chelalau, Dan Douglass

From: Peng Fan <peng.fan@nxp.com>

Commit log from NXP imx-mkimage:
On iMX8MQ B2, ROM will check IVT header and requires the reserved fields
in IVT to be 0.
However, in imx-mkimage we set the reserved1 field for the offset from
second boot image to SPL boot image, which was used for mfgtool but
has deprecated. So remove it to fix the boot failure on iMX8MQ B2.

Update imx8mimage to address same issue

Cc: Mihai Chelalau <mihai.chelalau@nxp.com>
Cc: Dan Douglass <dan.douglass@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 tools/imx8mimage.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
index 4eed683396f..52baf4c9903 100644
--- a/tools/imx8mimage.c
+++ b/tools/imx8mimage.c
@@ -505,14 +505,6 @@ void build_image(int ofd)
 			exit(EXIT_FAILURE);
 		} else {
 			sld_header_off = sld_src_off - rom_image_offset;
-			/*
-			 * Record the second bootloader relative offset in
-			 * image's IVT reserved1
-			 */
-			if (rom_version == ROM_V1) {
-				imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
-					sld_header_off - header_image_off;
-			}
 			sld_fd = open(sld_img, O_RDONLY | O_BINARY);
 			if (sld_fd < 0) {
 				fprintf(stderr, "%s: Can't open: %s\n",
-- 
2.36.0


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

* Re: [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field
  2022-07-02 23:58 [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field Peng Fan (OSS)
@ 2022-07-03  6:43 ` Michael Nazzareno Trimarchi
  2022-07-03  6:46   ` Peng Fan (OSS)
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-07-03  6:43 UTC (permalink / raw)
  To: Peng Fan (OSS), Marek Vašut
  Cc: sbabic, festevam, u-boot, Peng Fan, Mihai Chelalau, Dan Douglass

Hi Peng

On Sun, Jul 3, 2022 at 1:15 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> Commit log from NXP imx-mkimage:
> On iMX8MQ B2, ROM will check IVT header and requires the reserved fields
> in IVT to be 0.
> However, in imx-mkimage we set the reserved1 field for the offset from
> second boot image to SPL boot image, which was used for mfgtool but
> has deprecated. So remove it to fix the boot failure on iMX8MQ B2.
>
> Update imx8mimage to address same issue
>
> Cc: Mihai Chelalau <mihai.chelalau@nxp.com>
> Cc: Dan Douglass <dan.douglass@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  tools/imx8mimage.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c
> index 4eed683396f..52baf4c9903 100644
> --- a/tools/imx8mimage.c
> +++ b/tools/imx8mimage.c
> @@ -505,14 +505,6 @@ void build_image(int ofd)
>                         exit(EXIT_FAILURE);
>                 } else {
>                         sld_header_off = sld_src_off - rom_image_offset;
> -                       /*
> -                        * Record the second bootloader relative offset in
> -                        * image's IVT reserved1
> -                        */
> -                       if (rom_version == ROM_V1) {
> -                               imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
> -                                       sld_header_off - header_image_off;
> -                       }
>                         sld_fd = open(sld_img, O_RDONLY | O_BINARY);
>                         if (sld_fd < 0) {
>                                 fprintf(stderr, "%s: Can't open: %s\n",
> --
> 2.36.0
>

I have seen a similar change from Marek last week

tools: imx8mimage: Keep IVT reserved1 field zero always

Michael

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

* RE: [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field
  2022-07-03  6:43 ` Michael Nazzareno Trimarchi
@ 2022-07-03  6:46   ` Peng Fan (OSS)
  2022-07-03  6:48     ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan (OSS) @ 2022-07-03  6:46 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi, Peng Fan (OSS), Marek Vašut
  Cc: sbabic, festevam, u-boot, Mihai Chelalau, Dan Douglass

> Subject: Re: [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1
> field
> 
> Hi Peng
> 
> On Sun, Jul 3, 2022 at 1:15 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> wrote:
> >
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Commit log from NXP imx-mkimage:
> > On iMX8MQ B2, ROM will check IVT header and requires the reserved
> > fields in IVT to be 0.
> > However, in imx-mkimage we set the reserved1 field for the offset from
> > second boot image to SPL boot image, which was used for mfgtool but
> > has deprecated. So remove it to fix the boot failure on iMX8MQ B2.
> >
> > Update imx8mimage to address same issue
> >
> > Cc: Mihai Chelalau <mihai.chelalau@nxp.com>
> > Cc: Dan Douglass <dan.douglass@nxp.com>
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > ---
> >  tools/imx8mimage.c | 8 --------
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c index
> > 4eed683396f..52baf4c9903 100644
> > --- a/tools/imx8mimage.c
> > +++ b/tools/imx8mimage.c
> > @@ -505,14 +505,6 @@ void build_image(int ofd)
> >                         exit(EXIT_FAILURE);
> >                 } else {
> >                         sld_header_off = sld_src_off - rom_image_offset;
> > -                       /*
> > -                        * Record the second bootloader relative offset in
> > -                        * image's IVT reserved1
> > -                        */
> > -                       if (rom_version == ROM_V1) {
> > -                               imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
> > -                                       sld_header_off - header_image_off;
> > -                       }
> >                         sld_fd = open(sld_img, O_RDONLY | O_BINARY);
> >                         if (sld_fd < 0) {
> >                                 fprintf(stderr, "%s: Can't open:
> > %s\n",
> > --
> > 2.36.0
> >
> 
> I have seen a similar change from Marek last week
> 
> tools: imx8mimage: Keep IVT reserved1 field zero always
[Peng Fan] 

Oh, yes. Please ignore this patch.

Thanks,
Peng.

> 
> Michael

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

* Re: [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field
  2022-07-03  6:46   ` Peng Fan (OSS)
@ 2022-07-03  6:48     ` Michael Nazzareno Trimarchi
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-07-03  6:48 UTC (permalink / raw)
  To: Peng Fan (OSS)
  Cc: Marek Vašut, sbabic, festevam, u-boot, Mihai Chelalau, Dan Douglass

Hi Peng

On Sun, Jul 3, 2022 at 8:46 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> > Subject: Re: [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1
> > field
> >
> > Hi Peng
> >
> > On Sun, Jul 3, 2022 at 1:15 AM Peng Fan (OSS) <peng.fan@oss.nxp.com>
> > wrote:
> > >
> > > From: Peng Fan <peng.fan@nxp.com>
> > >
> > > Commit log from NXP imx-mkimage:
> > > On iMX8MQ B2, ROM will check IVT header and requires the reserved
> > > fields in IVT to be 0.
> > > However, in imx-mkimage we set the reserved1 field for the offset from
> > > second boot image to SPL boot image, which was used for mfgtool but
> > > has deprecated. So remove it to fix the boot failure on iMX8MQ B2.
> > >
> > > Update imx8mimage to address same issue
> > >
> > > Cc: Mihai Chelalau <mihai.chelalau@nxp.com>
> > > Cc: Dan Douglass <dan.douglass@nxp.com>
> > > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > > ---
> > >  tools/imx8mimage.c | 8 --------
> > >  1 file changed, 8 deletions(-)
> > >
> > > diff --git a/tools/imx8mimage.c b/tools/imx8mimage.c index
> > > 4eed683396f..52baf4c9903 100644
> > > --- a/tools/imx8mimage.c
> > > +++ b/tools/imx8mimage.c
> > > @@ -505,14 +505,6 @@ void build_image(int ofd)
> > >                         exit(EXIT_FAILURE);
> > >                 } else {
> > >                         sld_header_off = sld_src_off - rom_image_offset;
> > > -                       /*
> > > -                        * Record the second bootloader relative offset in
> > > -                        * image's IVT reserved1
> > > -                        */
> > > -                       if (rom_version == ROM_V1) {
> > > -                               imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
> > > -                                       sld_header_off - header_image_off;
> > > -                       }
> > >                         sld_fd = open(sld_img, O_RDONLY | O_BINARY);
> > >                         if (sld_fd < 0) {
> > >                                 fprintf(stderr, "%s: Can't open:
> > > %s\n",
> > > --
> > > 2.36.0
> > >
> >
> > I have seen a similar change from Marek last week
> >
> > tools: imx8mimage: Keep IVT reserved1 field zero always
> [Peng Fan]
>
> Oh, yes. Please ignore this patch.
>

Can you add your review on the Marek patch?

Michael

> Thanks,
> Peng.
>
> >
> > Michael



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

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

end of thread, other threads:[~2022-07-03  6:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-02 23:58 [PATCH] tools/imx8mimage: Remove the usage of IVT reserved1 field Peng Fan (OSS)
2022-07-03  6:43 ` Michael Nazzareno Trimarchi
2022-07-03  6:46   ` Peng Fan (OSS)
2022-07-03  6:48     ` Michael Nazzareno Trimarchi

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.