Use longer name for Black Swift board defines, BSB doesn't say too much
authorPiotr Dymacz <pepe2k@gmail.com>
Thu, 5 Nov 2015 19:45:39 +0000 (20:45 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Thu, 5 Nov 2015 19:45:39 +0000 (20:45 +0100)
Makefile
u-boot/Makefile
u-boot/board/ar7240/ap121/ap121.c
u-boot/common/cmd_bootm.c
u-boot/include/common.h
u-boot/include/configs/ap121.h

index 029b065b11f4acd19739b46f4baae1decfeb09ff..272e9a974b238affc613e83ee4cbb03d18cba000 100644 (file)
--- 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
 
index 28ab19491c21b80dc1c67fd488f3245a701d8e79..5a9231e46b931485762a90bda02fbd8696952edd 100644 (file)
@@ -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
index b576e332f0417b0e671ac2d23eebfbfb56e133a0..9ae5c40c9a27c0e951eab51a670d8a8c491a4d04 100644 (file)
@@ -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:
         *
index 4877713d45af28fbe98b38f147dd354a064e0172..ccfeb764be934784b81fd970228fa020cf3f427a 100644 (file)
@@ -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[]){
index 8c818f1c6c550381334f39ff8d285054f38a0b44..de8e6210ad6b1f2f239dbaa208675adb44f6f63c 100644 (file)
@@ -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)
index 982cb7b00bd06ab028afa37d9a74d276f1737585..f13ffe37da30709d2919824126863efc820c19f3 100644 (file)
@@ -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
 #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