bootm: Setting fdt_high at the end of board_init

We set 'fdt_high' inside 'bootipq' command.
While booting initramfs image using bootm,
fdt_high is not set causing fdt being loaded
at some random address that could be reserved
from kernel causing boot failure.

Change-Id: I769367dda8cbdf1b1b95233af52780f6d674f50f
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
diff --git a/arch/arm/include/asm/arch-qca-common/qca_common.h b/arch/arm/include/asm/arch-qca-common/qca_common.h
index f8a6255..07588db 100644
--- a/arch/arm/include/asm/arch-qca-common/qca_common.h
+++ b/arch/arm/include/asm/arch-qca-common/qca_common.h
@@ -29,6 +29,9 @@
 #include <asm/arch-ipq806x/clock.h>
 #endif
 
+#define XMK_STR(x)#x
+#define MK_STR(x)XMK_STR(x)
+
 struct ipq_i2c_platdata {
 	int type;
 };
diff --git a/board/qca/arm/common/board_init.c b/board/qca/arm/common/board_init.c
index 6690b9c..0175bb3 100644
--- a/board/qca/arm/common/board_init.c
+++ b/board/qca/arm/common/board_init.c
@@ -13,6 +13,7 @@
 
 #include <common.h>
 #include <environment.h>
+#include <asm/arch-qca-common/qca_common.h>
 #include <asm/arch-qca-common/smem.h>
 #include <asm/arch-qca-common/uart.h>
 #include <asm/arch-qca-common/gpio.h>
@@ -332,6 +333,12 @@
 	}
 #endif
 	set_ethmac_addr();
+
+	/*
+	 * set fdt_high parameter so that u-boot will not
+	 * load dtb above CONFIG_IPQ_FDT_HIGH region.
+	 */
+	run_command("setenv fdt_high " MK_STR(CONFIG_IPQ_FDT_HIGH) "\n", 0);
 	return 0;
 }
 
diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c
index cedc698..e0d9f99 100644
--- a/board/qca/arm/common/cmd_bootqca.c
+++ b/board/qca/arm/common/cmd_bootqca.c
@@ -29,11 +29,10 @@
 #include <spi_flash.h>
 #include <spi.h>
 #include <asm/arch-qca-common/iomap.h>
+#include <asm/arch-qca-common/qca_common.h>
 #include <asm/io.h>
 
 #define DLOAD_MAGIC_COOKIE 0x10
-#define XMK_STR(x)#x
-#define MK_STR(x)XMK_STR(x)
 #define MAX_TFTP_SIZE 0x40000000
 
 static int debug = 0;