@cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
@make --no-print-directory show_size
-bsb: export UBOOT_FILE_NAME=uboot_for_bsb
-bsb: export CONFIG_MAX_UBOOT_SIZE_KB=128
-bsb: export COMPRESSED_UBOOT=1
-bsb: export DEVICE_VENDOR=SE
-bsb:
- @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) bsb_config
+black_swift_board: export UBOOT_FILE_NAME=uboot_for_black_swift_board
+black_swift_board: export CONFIG_MAX_UBOOT_SIZE_KB=128
+black_swift_board: export COMPRESSED_UBOOT=1
+black_swift_board: export DEVICE_VENDOR=SE
+black_swift_board:
+ @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) black_swift_board_config
@cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
@make --no-print-directory show_size
@./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
-bsb_config : unconfig hornet_common_config
+black_swift_board_config : unconfig hornet_common_config
@echo '======= Configuring for Black Swift board (128K compressed) at:' `date` '======='
- @echo "#define CONFIG_FOR_BSB 1" >> include/config.h
+ @echo "#define CONFIG_FOR_BLACK_SWIFT_BOARD 1" >> include/config.h
@echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
@echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
@echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
gpio ^= 1 << GPIO_WLAN_LED_BIT;
#elif defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
gpio ^= 1 << GPIO_SYS_LED_BIT;
#elif defined(CONFIG_FOR_GL_INET)
gpio ^= 1 << GPIO_WLAN_LED_BIT;
SETBITVAL(gpio, GPIO_WAN_LED_BIT, GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, GPIO_LAN_LED_ON);
SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, GPIO_INTERNET_LED_ON);
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
SETBITVAL(gpio, GPIO_SYS_LED_BIT, GPIO_SYS_LED_ON);
#elif defined(CONFIG_FOR_GL_INET)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, GPIO_WLAN_LED_ON);
SETBITVAL(gpio, GPIO_WAN_LED_BIT, !GPIO_WAN_LED_ON);
SETBITVAL(gpio, GPIO_LAN_LED_BIT, !GPIO_LAN_LED_ON);
SETBITVAL(gpio, GPIO_INTERNET_LED_BIT, !GPIO_INTERNET_LED_ON);
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
SETBITVAL(gpio, GPIO_SYS_LED_BIT, !GPIO_SYS_LED_ON);
#elif defined(CONFIG_FOR_GL_INET)
SETBITVAL(gpio, GPIO_WLAN_LED_BIT, !GPIO_WLAN_LED_ON);
/* set GPIO_OE */
ar7240_reg_wr(AR7240_GPIO_OE, (ar7240_reg_rd(AR7240_GPIO_OE) | 0x10022001));
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
/* LED's GPIOs on Black Swift board:
*
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
!defined(CONFIG_FOR_DRAGINO_V2) && \
!defined(CONFIG_FOR_MESH_POTATO_V2) && \
- !defined(CONFIG_FOR_BSB)
+ !defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
void fake_image_header(image_header_t *hdr, tplink_image_header_t *tpl_hdr){
memset(hdr, 0, sizeof(image_header_t));
strncpy((char *)hdr->ih_name, (char *)tpl_hdr->signiture_1, IH_NMLEN);
}
-#endif /* if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && !defined(CONFIG_FOR_DLINK_DIR505_A1) && !defined(CONFIG_FOR_DRAGINO_V2) && !defined(CONFIG_FOR_MESH_POTATO_V2) && !defined(CONFIG_FOR_BSB) */
+#endif /* if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && !defined(CONFIG_FOR_DLINK_DIR505_A1) && !defined(CONFIG_FOR_DRAGINO_V2) && !defined(CONFIG_FOR_MESH_POTATO_V2) && !defined(CONFIG_FOR_BLACK_SWIFT_BOARD) */
int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
ulong addr, data, len;
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
!defined(CONFIG_FOR_DRAGINO_V2) && \
!defined(CONFIG_FOR_MESH_POTATO_V2) && \
- !defined(CONFIG_FOR_BSB)
+ !defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
tplink_image_header_t *fileTag;
#endif
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2) || \
- defined(CONFIG_FOR_BSB)
+ defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
memmove(&header, (char *)addr, sizeof(image_header_t));
print_image_hdr(hdr);
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2) || \
- defined(CONFIG_FOR_BSB)
+ defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
static void print_type(image_header_t *hdr){
char *os, *arch, *type, *comp;
print_size(ntohl(hdr->kernelLen), "\n");
printf(" Load address: 0x%08X\n Entry point: 0x%08X\n\n", ntohl(hdr->kernelTextAddr), ntohl(hdr->kernelEntryPoint));
}
-#endif /* defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DLINK_DIR505_A1) || defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2) || defined(CONFIG_FOR_BSB) */
+#endif /* defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || defined(CONFIG_FOR_DLINK_DIR505_A1) || defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2) || defined(CONFIG_FOR_BLACK_SWIFT_BOARD) */
#if (CONFIG_COMMANDS & CFG_CMD_BOOTD)
int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){
* use different (simply) image header
*/
#if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \
- !defined(CONFIG_FOR_BSB) && \
+ !defined(CONFIG_FOR_BLACK_SWIFT_BOARD) && \
!defined(CONFIG_FOR_DLINK_DIR505_A1) && \
!defined(CONFIG_FOR_DRAGINO_V2) && \
!defined(CONFIG_FOR_MESH_POTATO_V2)
/* common/cmd_bootm.c */
#if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
- defined(CONFIG_FOR_BSB) || \
+ defined(CONFIG_FOR_BLACK_SWIFT_BOARD) || \
defined(CONFIG_FOR_DLINK_DIR505_A1) || \
defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(ART)"
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:128k(u-boot),64k(u-boot-env),16128k(firmware),64k(ART)"
defined(CONFIG_FOR_MESH_POTATO_V2)
#define CFG_LOAD_ADDR 0x9F040000
#define UPDATE_SCRIPT_FW_ADDR "0x9F040000"
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define CFG_LOAD_ADDR 0x9F030000
#define UPDATE_SCRIPT_FW_ADDR "0x9F030000"
#else
#elif defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2)
#define CONFIG_BOOTCOMMAND "bootm 0x9F040000"
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define CONFIG_BOOTCOMMAND "bootm 0x9F030000"
#else
#define CONFIG_BOOTCOMMAND "bootm 0x9F020000"
#define CFG_PROMPT "dr_boot> "
#endif
-#if defined(CONFIG_FOR_BSB)
+#if defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#if defined(CFG_PROMPT)
#undef CFG_PROMPT
#endif
#define CFG_ENV_ADDR 0x9F040000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define CFG_ENV_ADDR 0x9F020000
#define CFG_ENV_SIZE 0x8000
#define CFG_ENV_SECT_SIZE 0x10000
#elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \
defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2) || \
- defined(CONFIG_FOR_BSB)
+ defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
CFG_CMD_DHCP | \
defined(CONFIG_FOR_MESH_POTATO_V2)
#define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x30000"
#define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x20000"
#define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES
#else
#elif defined(CONFIG_FOR_DRAGINO_V2) || \
defined(CONFIG_FOR_MESH_POTATO_V2)
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x40000
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x30000
#else
#define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000
#elif defined(CONFIG_FOR_GS_OOLITE_V1_DEV)
// GS-Oolite v1: 128k(U-Boot + MAC),64k(ART)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024)
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
// Black Swift board: 128k(U-Boot),64k(U-Boot env),64k(ART)
#define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (256 * 1024)
#else
#define OFFSET_MAC_DATA_BLOCK 0x010000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
#define OFFSET_MAC_ADDRESS 0x00FC00
-#elif defined(CONFIG_FOR_BSB)
+#elif defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
// Black Swift board has only one MAC address at the beginning of ART partition
#define OFFSET_MAC_DATA_BLOCK 0xFF0000
#define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000
!defined(CONFIG_FOR_DRAGINO_V2) && \
!defined(CONFIG_FOR_MESH_POTATO_V2) && \
!defined(CONFIG_FOR_GL_INET) && \
- !defined(CONFIG_FOR_BSB)
+ !defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
#define OFFSET_ROUTER_MODEL 0x00FD00
#endif
* - CLOCK_CONTROL (page 71)
* - SPI_CONTROL (page 261)
*/
-#if defined(CONFIG_FOR_DLINK_DIR505_A1)
+#if defined(CONFIG_FOR_DLINK_DIR505_A1) || \
+ defined(CONFIG_FOR_BLACK_SWIFT_BOARD)
/*
+ * For DIR505 A1:
* We will store PLL and CLOCK registers
* configuration at the end of MAC data
* partition (3rd 64 KiB block)
+ * ----
+ * For Black Swift board:
+ * We will store PLL and CLOCK registers
+ * configuration at the end of environment
+ * sector (64 KB, environment uses only part!)
*/
#define PLL_IN_FLASH_MAGIC 0x504C4C73
#define PLL_IN_FLASH_DATA_BLOCK_OFFSET 0x00020000
#define PLL_IN_FLASH_DATA_BLOCK_OFFSET 0x00030000
#define PLL_IN_FLASH_DATA_BLOCK_LENGTH 0x00010000
#define PLL_IN_FLASH_MAGIC_OFFSET 0x0000FFF0 // last 16 bytes
-#elif defined(CONFIG_FOR_BSB)
- /*
- * We will store PLL and CLOCK registers
- * configuration at the end of environment
- * sector (64 KB, environment uses only half!)
- */
- #define PLL_IN_FLASH_MAGIC 0x504C4C73
- #define PLL_IN_FLASH_DATA_BLOCK_OFFSET 0x00020000
- #define PLL_IN_FLASH_DATA_BLOCK_LENGTH 0x00010000
- #define PLL_IN_FLASH_MAGIC_OFFSET 0x0000FFF0 // last 16 bytes
#else
/*
* All TP-Link routers have a lot of unused space