#define CONFIG_LOADADDR 0x80800000
#if defined(CONFIG_FOR_DLINK_DIR505_A1)
- #define CFG_LOAD_ADDR 0x9F080000
+ #define CFG_LOAD_ADDR 0x9F080000
+ #define UPDATE_SCRIPT_FW_ADDR "0x9F080000"
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
- #define CFG_LOAD_ADDR 0x9F050000
+ #define CFG_LOAD_ADDR 0x9F050000
+ #define UPDATE_SCRIPT_FW_ADDR "0x9F050000"
#elif defined(CONFIG_FOR_DRAGINO_V2)
- #define CFG_LOAD_ADDR 0x9F040000
+ #define CFG_LOAD_ADDR 0x9F040000
+ #define UPDATE_SCRIPT_FW_ADDR "0x9F040000"
#else
- #define CFG_LOAD_ADDR 0x9F020000
+ #define CFG_LOAD_ADDR 0x9F020000
+ #define UPDATE_SCRIPT_FW_ADDR "0x9F020000"
#endif
#if defined(CONFIG_FOR_DLINK_DIR505_A1)
#if defined(CONFIG_FOR_DLINK_DIR505_A1)
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (64 * 1024)
+ #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x10000"
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2)
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (256 * 1024)
+ #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x40000"
#elif defined(CONFIG_FOR_DRAGINO_V2)
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (192 * 1024)
+ #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x30000"
#else
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (64 * 1024)
+ #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x10000"
#endif
// Firmware partition offset
/*-----------------------------------------------------------------------*/
+/*
+ * Additional environment variables for simple upgrades
+ */
+#define CONFIG_EXTRA_ENV_SETTINGS "uboot_addr=0x9F000000\0" \
+ "uboot_name=uboot.bin\0" \
+ "uboot_size=" UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "\0" \
+ "uboot_upg=" \
+ "if ping $serverip; then " \
+ "tftp $loadaddr $uboot_name && " \
+ "if itest.l $filesize == $uboot_size; then " \
+ "erase $uboot_addr +$filesize && " \
+ "cp.b $loadaddr $uboot_addr $filesize && " \
+ "echo OK!; " \
+ "else " \
+ "echo ERROR! Wrong file size!; " \
+ "fi; " \
+ "else " \
+ "ERROR! Server not reachable!; " \
+ "fi\0" \
+ "firmware_addr=" UPDATE_SCRIPT_FW_ADDR "\0" \
+ "firmware_name=firmware.bin\0" \
+ "firmware_upg=" \
+ "if ping $serverip; then " \
+ "tftp $loadaddr $firmware_name && " \
+ "erase $firmware_addr +$filesize && " \
+ "cp.b $loadaddr $firmware_addr $filesize && " \
+ "echo OK!; " \
+ "else " \
+ "ERROR! Server not reachable!; " \
+ "fi\0" \
+ SILENT_ENV_VARIABLE
+
#define CFG_ATHRS26_PHY 1
#define CFG_AG7240_NMACS 2
#define CFG_MII0_RMII 1
#undef CONFIG_LOADADDR\r
#define CONFIG_LOADADDR 0x80800000\r
\r
-#define CFG_LOAD_ADDR 0x9F020000\r
-#define CONFIG_BOOTCOMMAND "bootm 0x9F020000"\r
+#define CFG_LOAD_ADDR 0x9F020000\r
+#define UPDATE_SCRIPT_FW_ADDR "0x9F020000"\r
+#define CONFIG_BOOTCOMMAND "bootm 0x9F020000"\r
\r
\r
#define CONFIG_IPADDR 192.168.1.1\r
\r
// U-Boot partition size\r
#define WEBFAILSAFE_UPLOAD_UBOOT_SIZE_IN_BYTES (64 * 1024)\r
+#define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x10000"\r
\r
// ART partition size\r
#define WEBFAILSAFE_UPLOAD_ART_SIZE_IN_BYTES (64 * 1024)\r
\r
/*-----------------------------------------------------------------------*/\r
\r
+/*\r
+ * Additional environment variables for simple upgrades\r
+ */\r
+#define CONFIG_EXTRA_ENV_SETTINGS "uboot_addr=0x9F000000\0" \\r
+ "uboot_name=uboot.bin\0" \\r
+ "uboot_size=" UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "\0" \\r
+ "uboot_upg=" \\r
+ "if ping $serverip; then " \\r
+ "tftp $loadaddr $uboot_name && " \\r
+ "if itest.l $filesize == $uboot_size; then " \\r
+ "erase $uboot_addr +$filesize && " \\r
+ "cp.b $loadaddr $uboot_addr $filesize && " \\r
+ "echo OK!; " \\r
+ "else " \\r
+ "echo ERROR! Wrong file size!; " \\r
+ "fi; " \\r
+ "else " \\r
+ "ERROR! Server not reachable!; " \\r
+ "fi\0" \\r
+ "firmware_addr=" UPDATE_SCRIPT_FW_ADDR "\0" \\r
+ "firmware_name=firmware.bin\0" \\r
+ "firmware_upg=" \\r
+ "if ping $serverip; then " \\r
+ "tftp $loadaddr $firmware_name && " \\r
+ "erase $firmware_addr +$filesize && " \\r
+ "cp.b $loadaddr $firmware_addr $filesize && " \\r
+ "echo OK!; " \\r
+ "else " \\r
+ "ERROR! Server not reachable!; " \\r
+ "fi\0" \\r
+ SILENT_ENV_VARIABLE\r
+\r
/* For Merlin, both PCI, PCI-E interfaces are valid */\r
#define AR7240_ART_PCICFG_OFFSET 12\r
\r