diff mbox series

tools: imx8mimage: Keep IVT reserved1 field zero always

Message ID 20220629151637.111413-1-marex@denx.de
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series tools: imx8mimage: Keep IVT reserved1 field zero always | expand

Commit Message

Marek Vasut June 29, 2022, 3:16 p.m. UTC
Since fe8acf556c3 ("imx: HAB: Validate IVT before authenticating image")
the U-Boot HAB implementation is checking whether reserved1 field in IVT
is zero or not. In case the field is not zero, IVT validation fails. Stop
setting IVT reserved1 field to non-zero in mkimage imx8m plugin, otherwise
the validation cannot ever work.

Note that this only affects legacy boards which do not use binman.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 tools/imx8mimage.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Stefano Babic July 25, 2022, 4:40 p.m. UTC | #1
> Since fe8acf556c3 ("imx: HAB: Validate IVT before authenticating image")
> the U-Boot HAB implementation is checking whether reserved1 field in IVT
> is zero or not. In case the field is not zero, IVT validation fails. Stop
> setting IVT reserved1 field to non-zero in mkimage imx8m plugin, otherwise
> the validation cannot ever work.
> Note that this only affects legacy boards which do not use binman.
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Fabio Estevam <festevam@denx.de>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

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",