Skip to content
Snippets Groups Projects
Commit de979804 authored by Ye.Li's avatar Ye.Li Committed by Stefano Babic
Browse files

imximage: Fix the bootdata.size calculation


In system boot chapter of i.MX6 reference manual, the "Image Vector Table"
figure shows the bootdata.start points to the beginning of the destination
memory. It means the bootdata.size should contain the IVT offset part,
but the calculation in imximage tool does not have.

We found this issue when booting from QuadSPI NOR on i.MX6SX. The u-boot
runs into abnormal (crash or stop) after booting. After checked the destination
memory where the image is loaded to, there are hundreds of bytes at
the image end are not loaded into memory. Since there is a 4096 bytes
round in the calculation, for the booting devices using smaller IVT offset,
such as SD and SPI booting, they are not easy to reproduce.

Signed-off-by: default avatarYe.Li <B37916@freescale.com>
parent d12159b6
No related branches found
No related tags found
No related merge requests found
...@@ -587,7 +587,7 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd, ...@@ -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! * 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) { if (csf_ptr && imximage_csf_size) {
*csf_ptr = params->ep - imximage_init_loadsize + *csf_ptr = params->ep - imximage_init_loadsize +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment