>-----Original Message----- >From: Troy Kisky [mailto:troy.ki...@boundarydevices.com] >Sent: Wednesday, November 28, 2012 9:32 AM >To: sba...@denx.de >Cc: dirk.be...@googlemail.com; u-boot@lists.denx.de; Liu Hui-R64343; >feste...@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.ki...@boundarydevices.com>
Acked-by: Jason Liu <r64...@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 > _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot