From 19b0d92da0c560d47d5bf4a84d1967b54ceb0aee Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Thu, 5 Nov 2015 20:45:39 +0100 Subject: [PATCH] Use longer name for Black Swift board defines, BSB doesn't say too much --- Makefile | 12 ++++----- u-boot/Makefile | 4 +-- u-boot/board/ar7240/ap121/ap121.c | 8 +++--- u-boot/common/cmd_bootm.c | 12 ++++----- u-boot/include/common.h | 4 +-- u-boot/include/configs/ap121.h | 41 ++++++++++++++----------------- 6 files changed, 39 insertions(+), 42 deletions(-) diff --git a/Makefile b/Makefile index 029b065..272e9a9 100644 --- a/Makefile +++ b/Makefile @@ -192,12 +192,12 @@ dragino_v2_ms14: @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 diff --git a/u-boot/Makefile b/u-boot/Makefile index 28ab194..5a9231e 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -492,9 +492,9 @@ gs_oolite_v1_dev_config : unconfig hornet_common_config @./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 diff --git a/u-boot/board/ar7240/ap121/ap121.c b/u-boot/board/ar7240/ap121/ap121.c index b576e33..9ae5c40 100644 --- a/u-boot/board/ar7240/ap121/ap121.c +++ b/u-boot/board/ar7240/ap121/ap121.c @@ -38,7 +38,7 @@ void led_toggle(void){ 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; @@ -94,7 +94,7 @@ void all_led_on(void){ 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); @@ -151,7 +151,7 @@ void all_led_off(void){ 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); @@ -336,7 +336,7 @@ void gpio_config(void){ /* 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: * diff --git a/u-boot/common/cmd_bootm.c b/u-boot/common/cmd_bootm.c index 4877713..ccfeb76 100644 --- a/u-boot/common/cmd_bootm.c +++ b/u-boot/common/cmd_bootm.c @@ -75,7 +75,7 @@ ulong load_addr = CFG_LOAD_ADDR; /* default load address */ !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)); @@ -94,7 +94,7 @@ void fake_image_header(image_header_t *hdr, tplink_image_header_t *tpl_hdr){ 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; @@ -105,7 +105,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ !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 @@ -121,7 +121,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ 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); @@ -230,7 +230,7 @@ static void fixup_silent_linux(){ 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; @@ -407,7 +407,7 @@ void print_image_hdr(tplink_image_header_t *hdr){ 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[]){ diff --git a/u-boot/include/common.h b/u-boot/include/common.h index 8c818f1..de8e621 100644 --- a/u-boot/include/common.h +++ b/u-boot/include/common.h @@ -195,7 +195,7 @@ int autoscript (ulong addr); * 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) @@ -204,7 +204,7 @@ int autoscript (ulong addr); /* 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) diff --git a/u-boot/include/configs/ap121.h b/u-boot/include/configs/ap121.h index 982cb7b..f13ffe3 100644 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -58,7 +58,7 @@ #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)" @@ -92,7 +92,7 @@ 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 @@ -107,7 +107,7 @@ #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" @@ -135,7 +135,7 @@ #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 @@ -794,7 +794,7 @@ #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 @@ -823,7 +823,7 @@ #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 | \ @@ -915,7 +915,7 @@ 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 @@ -932,7 +932,7 @@ #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 @@ -959,7 +959,7 @@ #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 @@ -1046,7 +1046,7 @@ #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 @@ -1063,7 +1063,7 @@ !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 @@ -1084,11 +1084,18 @@ * - 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 @@ -1115,16 +1122,6 @@ #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 -- 2.25.1