summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/guf-neso
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2020-02-18 09:11:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-02-19 09:20:03 +0100
commit104f5a22d61480fb275d05298ea185c95fbcb5b7 (patch)
tree0775f276332921f52ae2ffe62029f8cb27f6ea5c /arch/arm/boards/guf-neso
parent07199cefe060aed82febc8a88ee8f80b37444456 (diff)
downloadbarebox-104f5a22d61480fb275d05298ea185c95fbcb5b7.tar.gz
barebox-104f5a22d61480fb275d05298ea185c95fbcb5b7.tar.xz
ARM: i.MX: external NAND boot: Fix passing boarddata
We used to pass a device tree pointer to imx*_barebox_boot_nand_external(). This no longer works since we compile barebox with -fPIE. The problem is that we only have the first 2KiB of the image available when we start from NAND. The pointer to the device tree is not valid yet. This hasn't been a problem because the pointer is only used later when we have the full image in SDRAM. With -fPIE though the actual pointer is derived indirectly through another pointer, and that pointer to the pointer is also not valid which causes an invalid pointer to the device tree later. This is solved by splitting the NAND boot functions up into two functions. With imx*_nand_relocate_to_sdram() the board code relocates the image out of the NFC SRAM into SDRAM. From that point on the device tree pointer can be accessed and the board can load the image using imx*_nand_load_image() and can afterwards pass control to barebox passing whatever device tee pointer it likes. Fixes: b0348d677b ("ARM: Compile with -fPIE") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/guf-neso')
-rw-r--r--arch/arm/boards/guf-neso/lowlevel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/boards/guf-neso/lowlevel.c b/arch/arm/boards/guf-neso/lowlevel.c
index 20f48be7dd..3ae70eca30 100644
--- a/arch/arm/boards/guf-neso/lowlevel.c
+++ b/arch/arm/boards/guf-neso/lowlevel.c
@@ -89,7 +89,7 @@ void __bare_init __naked barebox_arm_reset_vector(uint32_t r0, uint32_t r1, uint
MX27_ESDCTL_BASE_ADDR + IMX_ESDCTL0);
if (IS_ENABLED(CONFIG_ARCH_IMX_EXTERNAL_BOOT_NAND))
- imx27_barebox_boot_nand_external(0);
+ imx27_barebox_boot_nand_external();
out:
imx27_barebox_entry(NULL);