From 7ebb5fbb58b6b9e496e3441f1be6bdc5b993964d Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 27 Jan 2014 16:15:00 +0100 Subject: 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 --- arch/arm/mach-imx/external-nand-boot.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/arm/mach-imx/external-nand-boot.c') 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); \ } -- cgit v1.2.3