public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] imximage: Fix imximage IVT bug for EIM-NOR boot
@ 2014-08-20  8:55 Ye.Li
  2014-08-20  9:44 ` Stefano Babic
  0 siblings, 1 reply; 4+ messages in thread
From: Ye.Li @ 2014-08-20  8:55 UTC (permalink / raw)
  To: u-boot

From: "Ye.Li" <Ye.Li@freescale.com>

The load region size of EIM-NOR are defined to 0. For this case,
the parameter "imximage_init_loadsize" must be calculated.
The imximage tool implements the calculation in the "imximage_generate"
function, but the following function "imximage_set_header" resets the value
and not calculate. This bug cause some fields of IVT head are not
correct, for example the boot_data and DCD overlay the application area.

Signed-off-by: Ye.Li <B37916@freescale.com>
---
 tools/imximage.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/imximage.c b/tools/imximage.c
index 18dc051..faba238 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -568,6 +568,13 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
 	/* Parse dcd configuration file */
 	dcd_len = parse_cfg_file(imxhdr, params->imagename);
 
+	if (imximage_version == IMXIMAGE_V2) {
+		if (imximage_init_loadsize < imximage_ivt_offset +
+			sizeof(imx_header_v2_t))
+				imximage_init_loadsize = imximage_ivt_offset +
+					sizeof(imx_header_v2_t);
+	}
+
 	/* Set the imx header */
 	(*set_imx_hdr)(imxhdr, dcd_len, params->ep, imximage_ivt_offset);
 
-- 
1.7.9.5

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

end of thread, other threads:[~2014-09-09 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-20  8:55 [U-Boot] [PATCH] imximage: Fix imximage IVT bug for EIM-NOR boot Ye.Li
2014-08-20  9:44 ` Stefano Babic
2014-08-21  7:04   ` Li Ye-B37916
2014-09-09 14:38     ` Stefano Babic

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