From a086e2006dd1c49b5a351019623204e371751c53 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Mon, 7 Nov 2016 22:57:47 +0100 Subject: [PATCH] Allow loading kernel from rootfs+kernel and kernel+rootfs firmware images Most of the boards with firmware based on official and old QC/A SDK use rootfs+kernel firmware order. In OpenWrt/LEDE kernel+rootfs order is prefered (better for growing size of kernel) and more common. As we don't know what firmware user is using, make it working with both type of images, with kernel in front or behind the rootfs. With this change, there is no need to change 'bootcmd' variable when switching from vendor firmware to OpenWrt/LEDE on YunCore AP90Q/CPE830. --- u-boot/include/configs/ap143.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/u-boot/include/configs/ap143.h b/u-boot/include/configs/ap143.h index c2cbf5e..72b6fcd 100644 --- a/u-boot/include/configs/ap143.h +++ b/u-boot/include/configs/ap143.h @@ -175,15 +175,20 @@ defined(CONFIG_FOR_TPLINK_WR841N_V11) ||\ defined(CONFIG_FOR_TPLINK_WR841N_V9) #define CFG_LOAD_ADDR 0x9F020000 -#elif defined(CONFIG_FOR_WALLYS_DR531) - #define CFG_LOAD_ADDR 0x9F050000 -#elif defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ +#elif defined(CONFIG_FOR_WALLYS_DR531) ||\ + defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ defined(CONFIG_FOR_YUNCORE_CPE830) ||\ defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) - #define CFG_LOAD_ADDR 0x9FE80000 + #define CFG_LOAD_ADDR 0x9F050000 #endif -#define CONFIG_BOOTCOMMAND "bootm " MK_STR(CFG_LOAD_ADDR) +#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ + defined(CONFIG_FOR_YUNCORE_CPE830) ||\ + defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) + #define CONFIG_BOOTCOMMAND "bootm 0x9FE80000 || bootm 0x9F050000" +#else + #define CONFIG_BOOTCOMMAND "bootm " MK_STR(CFG_LOAD_ADDR) +#endif /* * ========================= @@ -284,13 +289,7 @@ * HTTP recovery configuration * =========================== */ -#if defined(CONFIG_FOR_YUNCORE_AP90Q) ||\ - defined(CONFIG_FOR_YUNCORE_CPE830) ||\ - defined(CONFIG_FOR_ZBTLINK_ZBT_WE1526) - #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_FLASH_BASE + 0x50000 -#else - #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR -#endif +#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS CFG_LOAD_ADDR /* Firmware size limit */ #if defined(CONFIG_FOR_COMFAST_CF_E314N) ||\ -- 2.25.1