summaryrefslogtreecommitdiff
path: root/tools/imximage.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2013-04-21 05:52:22 +0000
committerStefano Babic <sbabic@denx.de>2013-05-05 17:45:04 +0200
commit895d996676b2d538657a5e058aa316a85237487c (patch)
treeda661378af1700714a56d02981900785c7badda1 /tools/imximage.c
parentfb7383a7a27a6ae2442b7f0db89831478192fd2d (diff)
downloadu-boot-imx-895d996676b2d538657a5e058aa316a85237487c.zip
u-boot-imx-895d996676b2d538657a5e058aa316a85237487c.tar.gz
u-boot-imx-895d996676b2d538657a5e058aa316a85237487c.tar.bz2
imx: Align the imximage header and payload to multiples of 4k
The MX53 ROM loads the data from NAND in multiples of pages and supports maximum page size of 4k. Thus, align the image and header to 4k to be safe from ROM bugs. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@ti.com>
Diffstat (limited to 'tools/imximage.c')
-rw-r--r--tools/imximage.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/imximage.c b/tools/imximage.c
index 895c9de..5e8e470 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -524,11 +524,14 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd,
/*
* ROM bug alert
- * mx53 only loads 512 byte multiples.
- * The remaining fraction of a block bytes would
- * not be loaded.
+ *
+ * MX53 only loads 512 byte multiples in case of SD boot.
+ * MX53 only loads NAND page multiples in case of NAND boot and
+ * supports up to 4096 byte large pages, thus align to 4096.
+ *
+ * The remaining fraction of a block bytes would not be loaded!
*/
- *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 512);
+ *header_size_ptr = ROUND(sbuf->st_size + imxhdr->flash_offset, 4096);
}
int imximage_check_params(struct mkimage_params *params)