From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Wed, 02 Jan 2013 12:42:16 -0700 Subject: [U-Boot] [PATCH] mx53loco: Fix PMIC name In-Reply-To: References: <1355243818-23962-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <50E48D98.9020609@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1/2/2013 11:33 AM, Fabio Estevam wrote: > Thanks for bisecting, Robert. Troy/Stefano, Any suggestions about > this? It would be really nice if we could keep mx53loco functional > when using gcc 4.6.2. Regards, Fabio Estevam Could you see if this patch makes any difference? It still needs cleaned up some before mainline [PATCH V4 01/11] imximage: mx53 needs transfer length a multiple of 512 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