[U-Boot] [PATCH] imximage: Fix the bootdata.size calculation

Ye.Li B37916 at freescale.com
Wed Oct 22 08:39:29 CEST 2014


The bootdata.size should contain the IVT offset part, but the calculation
in imximage tool does not have. This will cause some data at
the end of image not be loaded into memory.

Signed-off-by: Ye.Li <B37916 at freescale.com>
---
 tools/imximage.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index faba238..526b7d4 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -587,7 +587,7 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
 	 *
 	 * The remaining fraction of a block bytes would not be loaded!
 	 */
-	*header_size_ptr = ROUND(sbuf->st_size, 4096);
+	*header_size_ptr = ROUND((sbuf->st_size + imximage_ivt_offset), 4096);
 
 	if (csf_ptr && imximage_csf_size) {
 		*csf_ptr = params->ep - imximage_init_loadsize +
-- 
1.7.4.1



More information about the U-Boot mailing list