summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-01-27 16:15:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-01-31 18:51:53 +0100
commit7ebb5fbb58b6b9e496e3441f1be6bdc5b993964d (patch)
tree35a052c59e4f16f19c72113bed8c298cea422659 /arch
parent3711a1d8e7022925b6e4e83836bd957691f52ae0 (diff)
downloadbarebox-7ebb5fbb58b6b9e496e3441f1be6bdc5b993964d.tar.gz
barebox-7ebb5fbb58b6b9e496e3441f1be6bdc5b993964d.tar.xz
ARM: i.MX: external NAND boot: make dtb boarddata work
If we are running from NFC SRAM and we are passed boarddata containing a devicetree pointer then it point to an address relative to the NFC SRAM start. First thing we do is to copy the initial binary to SDRAM and jump there. The devicetree pointer has to be adjusted by this offset. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/external-nand-boot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/external-nand-boot.c b/arch/arm/mach-imx/external-nand-boot.c
index c08806cee3..fe933aa3a9 100644
--- a/arch/arm/mach-imx/external-nand-boot.c
+++ b/arch/arm/mach-imx/external-nand-boot.c
@@ -373,6 +373,11 @@ void __noreturn BARE_INIT_FUNCTION(imx##soc##_barebox_boot_nand_external) \
\
fn = (void *)__fn; \
\
+ if (boarddata > nfc_base && boarddata < nfc_base + SZ_512K) { \
+ boarddata &= SZ_512K - 1; \
+ boarddata += sdram; \
+ } \
+ \
fn(boarddata); \
}