[U-Boot] [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512

Liu Hui-R64343 r64343 at freescale.com
Wed Nov 28 11:34:34 CET 2012


>-----Original Message-----
>From: Troy Kisky [mailto:troy.kisky at boundarydevices.com]
>Sent: Wednesday, November 28, 2012 9:32 AM
>To: sbabic at denx.de
>Cc: dirk.behme at googlemail.com; u-boot at lists.denx.de; Liu Hui-R64343;
>festevam at gmail.com; Troy Kisky
>Subject: [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple
>of 512
>
>The mx53 ROM will truncate the length at a multiple of 512.
>Transferring too much is not a problem, so round up.
>
>Problem reported by Stefano Babic.
>
>Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>

Acked-by: Jason Liu <r64343 at freescale.com>

>---
> tools/imximage.c |   10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/tools/imximage.c b/tools/imximage.c index 63f88b6..7e54e97
>100644
>--- a/tools/imximage.c
>+++ b/tools/imximage.c
>@@ -494,6 +494,8 @@ static void imximage_print_header(const void *ptr)
> 	}
> }
>
>+#define ALIGN(a, b)	(((a) + (b) - 1) & ~((b) - 1))
>+
> static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
> 				struct mkimage_params *params)
> {
>@@ -515,7 +517,13 @@ static void imximage_set_header(void *ptr, struct
>stat *sbuf, int ifd,
>
> 	/* Set the imx header */
> 	(*set_imx_hdr)(imxhdr, dcd_len, params->ep, imxhdr->flash_offset);
>-	*header_size_ptr = sbuf->st_size + imxhdr->flash_offset;
>+	/*
>+	 * ROM bug alert
>+	 * mx53 only loads 512 byte multiples.
>+	 * The remaining fraction of a block bytes would
>+	 * not be loaded.
>+	 */
>+	*header_size_ptr = ALIGN(sbuf->st_size + imxhdr->flash_offset, 512);
> }
>
> int imximage_check_params(struct mkimage_params *params)
>--
>1.7.9.5
>




More information about the U-Boot mailing list