* [U-Boot] [PATCH v2] imximage: Fix the bootdata.size calculation
@ 2014-10-30 9:54 Ye.Li
2014-11-03 10:25 ` Stefano Babic
0 siblings, 1 reply; 2+ messages in thread
From: Ye.Li @ 2014-10-30 9:54 UTC (permalink / raw)
To: u-boot
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: Ye.Li <B37916@freescale.com>
---
Changes since v1:
- Improve the patch message to explicate the issue and reason.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH v2] imximage: Fix the bootdata.size calculation
2014-10-30 9:54 [U-Boot] [PATCH v2] imximage: Fix the bootdata.size calculation Ye.Li
@ 2014-11-03 10:25 ` Stefano Babic
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2014-11-03 10:25 UTC (permalink / raw)
To: u-boot
On 30/10/2014 10:54, Ye.Li wrote:
> 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: Ye.Li <B37916@freescale.com>
> ---
Applied to u-boot-imx, thanks !
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-03 10:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 9:54 [U-Boot] [PATCH v2] imximage: Fix the bootdata.size calculation Ye.Li
2014-11-03 10:25 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox