Allow loading kernel from rootfs+kernel and kernel+rootfs firmware images
authorPiotr Dymacz <pepe2k@gmail.com>
Mon, 7 Nov 2016 21:57:47 +0000 (22:57 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Mon, 7 Nov 2016 21:57:47 +0000 (22:57 +0100)
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

index c2cbf5e35e325ee7cccc7d2ea3883fed19931957..72b6fcdea2435672422f542e7a549686bceb7ab7 100644 (file)
     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
 
 /*
  * =========================
  * 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)    ||\