summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2014-06-16 11:47:05 +0800
committerYe.Li <B37916@freescale.com>2014-06-17 11:13:39 +0800
commit249f3d675ff804a015563abcdecbc98a62cc4927 (patch)
treeee11f6655cb83dc296cd79a9be30992a35d9b866
parentbd29cd3e5d02a666f65b44daa975b59097cac15e (diff)
downloadu-boot-imx-249f3d675ff804a015563abcdecbc98a62cc4927.zip
u-boot-imx-249f3d675ff804a015563abcdecbc98a62cc4927.tar.gz
u-boot-imx-249f3d675ff804a015563abcdecbc98a62cc4927.tar.bz2
ENGR00315894-8 imximage: Fix imximage bug for EIM-NOR boot
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>
-rw-r--r--tools/imximage.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/imximage.c b/tools/imximage.c
index 91b2e8e..7e12cec 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -729,6 +729,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);