summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-01-28 10:39:45 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-01-31 18:51:53 +0100
commit3711a1d8e7022925b6e4e83836bd957691f52ae0 (patch)
treeab393678fe16a531dd6a098a1007340475595be1 /arch
parentbf6846cacc417d261da96058df12023d98db70a8 (diff)
downloadbarebox-3711a1d8e7022925b6e4e83836bd957691f52ae0.tar.gz
barebox-3711a1d8e7022925b6e4e83836bd957691f52ae0.tar.xz
ARM: i.MX: external NAND boot: use image size from image header
When compiling with multiimage support ld_var(_barebox_image_size) only contains the length of the PBL image, but not including the appended compressed data. With this patch the image size is read from the barebox header instead which contains the correct size, either from the linker or from the fix_size tool. This makes the external_nand_boot compatible with multiimage support. Tested on Phytec phyCARD-i.MX27 with and without PBL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/external-nand-boot.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index fab37bf77a..c08806cee3 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -322,10 +322,13 @@ void __noreturn BARE_INIT_FUNCTION(imx##soc##_boot_nand_external_cont) \
(uint32_t boarddata) \
{ \
unsigned long nfc_base = MX##soc##_NFC_BASE_ADDR; \
- unsigned long sdram = MX##soc##_CSD0_BASE_ADDR; \
+ void *sdram = (void *)MX##soc##_CSD0_BASE_ADDR; \
+ uint32_t image_size; \
+ \
+ image_size = *(uint32_t *)(sdram + 0x2c); \
\
- imx##soc##_nand_load_image((void *)sdram, \
- ld_var(_barebox_image_size), \
+ imx##soc##_nand_load_image(sdram, \
+ image_size, \
(void *)nfc_base, \
imx##soc##_pagesize_2k()); \
\