From c2382fa2fd43d5422857b85e4cab576310297b88 Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Tue, 10 Jul 2018 15:21:14 +0530 Subject: [PATCH] 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 --- arch/arm/include/asm/arch-qca-common/qca_common.h | 3 +++ board/qca/arm/common/board_init.c | 7 +++++++ board/qca/arm/common/cmd_bootqca.c | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) 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 f8a6255ce8..07588db272 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 #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 6690b9cfb3..0175bb35a4 100644 --- a/board/qca/arm/common/board_init.c +++ b/board/qca/arm/common/board_init.c @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -332,6 +333,12 @@ int board_late_init(void) } #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 cedc698603..e0d9f99de2 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -29,11 +29,10 @@ #include #include #include +#include #include #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;