From eace0468823c78f2674946ef34cd81fbdfe8c281 Mon Sep 17 00:00:00 2001 From: Dmitriy Zherebkov Date: Sat, 26 Sep 2015 22:51:04 +0300 Subject: [PATCH] add Black Swift board support Black Swift is a tiny coin-sized embedded computer based on AR9331 SoC. See http://www.black-swift.com/ for details. See also Black Swift kickstarter page: https://www.kickstarter.com/projects/1133560316/black-swift-tiny-wireless-computer Signed-off-by: Dmitriy Zherebkov Signed-off-by: Antony Pavlov --- Makefile | 9 +++++ u-boot/Makefile | 12 +++++++ u-boot/board/ar7240/ap121/ap121.c | 22 ++++++++++++ u-boot/common/cmd_bootm.c | 16 +++++---- u-boot/httpd/vendors/SE/404.html | 15 ++++++++ u-boot/httpd/vendors/SE/art.html | 24 +++++++++++++ u-boot/httpd/vendors/SE/fail.html | 15 ++++++++ u-boot/httpd/vendors/SE/flashing.html | 18 ++++++++++ u-boot/httpd/vendors/SE/index.html | 18 ++++++++++ u-boot/httpd/vendors/SE/style.css | 52 +++++++++++++++++++++++++++ u-boot/httpd/vendors/SE/uboot.html | 25 +++++++++++++ u-boot/include/common.h | 2 ++ u-boot/include/configs/ap121.h | 49 +++++++++++++++++++++++-- 13 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 u-boot/httpd/vendors/SE/404.html create mode 100644 u-boot/httpd/vendors/SE/art.html create mode 100644 u-boot/httpd/vendors/SE/fail.html create mode 100644 u-boot/httpd/vendors/SE/flashing.html create mode 100644 u-boot/httpd/vendors/SE/index.html create mode 100644 u-boot/httpd/vendors/SE/style.css create mode 100644 u-boot/httpd/vendors/SE/uboot.html diff --git a/Makefile b/Makefile index 77f44bb..029b065 100644 --- a/Makefile +++ b/Makefile @@ -192,6 +192,15 @@ 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 + @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all + @make --no-print-directory show_size + villagetelco_mp2: export UBOOT_FILE_NAME=uboot_for_villagetelco_mp2 villagetelco_mp2: export CONFIG_MAX_UBOOT_SIZE_KB=192 villagetelco_mp2: export DEVICE_VENDOR=villagetelco diff --git a/u-boot/Makefile b/u-boot/Makefile index 5018dc7..28ab194 100644 --- a/u-boot/Makefile +++ b/u-boot/Makefile @@ -492,6 +492,18 @@ gs_oolite_v1_dev_config : unconfig hornet_common_config @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240 +bsb_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 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 + @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h + @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h + @echo "#define BOARD_CUSTOM_STRING \"U-Boot for Black Swift board (AR9331)\"" >> include/config.h + + @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240 + carambola2_config : unconfig hornet_common_config @/bin/echo -e '\e[32m> Configuring for 8devices Carambola 2 at:' `date` '\e[0m' @echo "#define CONFIG_FOR_8DEVICES_CARAMBOLA2 1" >> include/config.h diff --git a/u-boot/board/ar7240/ap121/ap121.c b/u-boot/board/ar7240/ap121/ap121.c index cdaec80..b576e33 100644 --- a/u-boot/board/ar7240/ap121/ap121.c +++ b/u-boot/board/ar7240/ap121/ap121.c @@ -38,6 +38,8 @@ 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) + gpio ^= 1 << GPIO_SYS_LED_BIT; #elif defined(CONFIG_FOR_GL_INET) gpio ^= 1 << GPIO_WLAN_LED_BIT; #else @@ -92,6 +94,8 @@ 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) + 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_LAN_LED_BIT, GPIO_LAN_LED_ON); @@ -147,6 +151,8 @@ 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) + 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_LAN_LED_BIT, !GPIO_LAN_LED_ON); @@ -330,6 +336,22 @@ 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) + + /* LED's GPIOs on Black Swift board: + * + * 27 => SYS LED (red) - output + * 13-17=> output only (see AR9331 datasheet) + * 11 => Reset switch (active low) - in (like all other by default) + * + */ + + // set GPIO_OE + ar7240_reg_wr(AR7240_GPIO_OE, (ar7240_reg_rd(AR7240_GPIO_OE) | 0x0803E000)); + + // turn off all + ar7240_reg_wr(AR7240_GPIO_SET, 0x0); + #elif defined(CONFIG_FOR_DLINK_DIR505_A1) /* LED's GPIOs on DIR-505: diff --git a/u-boot/common/cmd_bootm.c b/u-boot/common/cmd_bootm.c index 510953b..4877713 100644 --- a/u-boot/common/cmd_bootm.c +++ b/u-boot/common/cmd_bootm.c @@ -74,7 +74,8 @@ ulong load_addr = CFG_LOAD_ADDR; /* default load address */ #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_MESH_POTATO_V2) && \ + !defined(CONFIG_FOR_BSB) void fake_image_header(image_header_t *hdr, tplink_image_header_t *tpl_hdr){ memset(hdr, 0, sizeof(image_header_t)); @@ -93,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) */ +#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) */ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ ulong addr, data, len; @@ -103,7 +104,8 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ #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_MESH_POTATO_V2) && \ + !defined(CONFIG_FOR_BSB) tplink_image_header_t *fileTag; #endif @@ -118,7 +120,8 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ #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_MESH_POTATO_V2) || \ + defined(CONFIG_FOR_BSB) memmove(&header, (char *)addr, sizeof(image_header_t)); print_image_hdr(hdr); @@ -226,7 +229,8 @@ static void fixup_silent_linux(){ #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_MESH_POTATO_V2) || \ + defined(CONFIG_FOR_BSB) static void print_type(image_header_t *hdr){ char *os, *arch, *type, *comp; @@ -403,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) */ +#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) */ #if (CONFIG_COMMANDS & CFG_CMD_BOOTD) int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]){ diff --git a/u-boot/httpd/vendors/SE/404.html b/u-boot/httpd/vendors/SE/404.html new file mode 100644 index 0000000..b4a2976 --- /dev/null +++ b/u-boot/httpd/vendors/SE/404.html @@ -0,0 +1,15 @@ + + + + + Page not found + + + +
+

Page not found

+

The page you were looking for doesn't exist!
Go back to firmware update page.

+
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/art.html b/u-boot/httpd/vendors/SE/art.html new file mode 100644 index 0000000..6cf722e --- /dev/null +++ b/u-boot/httpd/vendors/SE/art.html @@ -0,0 +1,24 @@ + + + + + ART update + + + +
+

ART UPDATE

+

You are going to update ART (Atheros Radio Test) on the device.
Please, choose file from your local hard drive and click Update ART button.

+
+
+ WARNINGS +
    +
  • do not power off the device during update
  • +
  • if everything goes well, the device will restart
  • +
  • you can upload whatever you want, so be sure that you choose proper ART image for your device
  • +
+
+
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/fail.html b/u-boot/httpd/vendors/SE/fail.html new file mode 100644 index 0000000..4905c66 --- /dev/null +++ b/u-boot/httpd/vendors/SE/fail.html @@ -0,0 +1,15 @@ + + + + + Update failed + + + +
+

Update failed!

+

Please, try again or contact with the author of this modification.
You can also get more information during update in U-Boot console.

+
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/flashing.html b/u-boot/httpd/vendors/SE/flashing.html new file mode 100644 index 0000000..9c982da --- /dev/null +++ b/u-boot/httpd/vendors/SE/flashing.html @@ -0,0 +1,18 @@ + + + + + Update in progress + + + +
+

Update in progress

+

Your file was successfully uploaded! Update is in progress and you should wait for automatic reset of the device.
Update time depends on image size and may take up to a few minutes. You can close this page.

+
+
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/index.html b/u-boot/httpd/vendors/SE/index.html new file mode 100644 index 0000000..c8af032 --- /dev/null +++ b/u-boot/httpd/vendors/SE/index.html @@ -0,0 +1,18 @@ + + + + + Firmware update for Black Swift board + + + +
Black Swift board
+
+

Firmware update

+

You are going to upload new firmware to the device.
Choose a proper file from your local hard drive and click "Update firmware" button.
Please, do not power off the device during update, if everything goes well, the device will restart.

+
+
+
Please, go here to update U-Boot or here to update ART.
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/style.css b/u-boot/httpd/vendors/SE/style.css new file mode 100644 index 0000000..3e21c02 --- /dev/null +++ b/u-boot/httpd/vendors/SE/style.css @@ -0,0 +1,52 @@ +h1, +p, +form, +body { + margin: 0; + padding: 0; +} + +html, +body { + font: 13px/20px Tahoma, sans-serif; + background: #135B72; + color: #FFF; + text-align: center; + height: 100%; +} + +#m, #h { + padding: 30px 0; +} + +#h { + font: bold 40px/40px Arial; + background: #ffffff; + color: #000000; + text-align: center; +} + +#m > * { + padding: 20px; +} + +#f { + font-size: 11px; + position: absolute; + bottom: 0; + width: 100%; + padding: 15px 0; +} + +a { + color: #FEDD12; + text-decoration: none; +} + +h1 { + font: bold 40px/40px Arial; +} + +.red { + color: #ED0000; +} \ No newline at end of file diff --git a/u-boot/httpd/vendors/SE/uboot.html b/u-boot/httpd/vendors/SE/uboot.html new file mode 100644 index 0000000..26d3f24 --- /dev/null +++ b/u-boot/httpd/vendors/SE/uboot.html @@ -0,0 +1,25 @@ + + + + + U-Boot update + + + +
+

U-BOOT UPDATE

+

You are going to update U-Boot bootloader on the device.
Please, choose file from your local hard drive and click Update U-Boot button.

+
+
+ WARNINGS +
    +
  • do not power off the device during update
  • +
  • if everything goes well, the device will restart
  • +
  • you can upload whatever you want, so be sure that you choose proper U-Boot image for your device
  • +
  • updating U-Boot is a very dangerous operation and may damage your device!
  • +
+
+
+
This code is based on GitHub
+ + \ No newline at end of file diff --git a/u-boot/include/common.h b/u-boot/include/common.h index 06eed3f..8c818f1 100644 --- a/u-boot/include/common.h +++ b/u-boot/include/common.h @@ -195,6 +195,7 @@ int autoscript (ulong addr); * use different (simply) image header */ #if !defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) && \ + !defined(CONFIG_FOR_BSB) && \ !defined(CONFIG_FOR_DLINK_DIR505_A1) && \ !defined(CONFIG_FOR_DRAGINO_V2) && \ !defined(CONFIG_FOR_MESH_POTATO_V2) @@ -203,6 +204,7 @@ int autoscript (ulong addr); /* common/cmd_bootm.c */ #if defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \ + defined(CONFIG_FOR_BSB) || \ 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 6939219..982cb7b 100644 --- a/u-boot/include/configs/ap121.h +++ b/u-boot/include/configs/ap121.h @@ -58,6 +58,10 @@ #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) + + #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)" + #elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),16000k(firmware),64k(ART)" @@ -88,6 +92,9 @@ defined(CONFIG_FOR_MESH_POTATO_V2) #define CFG_LOAD_ADDR 0x9F040000 #define UPDATE_SCRIPT_FW_ADDR "0x9F040000" +#elif defined(CONFIG_FOR_BSB) + #define CFG_LOAD_ADDR 0x9F030000 + #define UPDATE_SCRIPT_FW_ADDR "0x9F030000" #else #define CFG_LOAD_ADDR 0x9F020000 #define UPDATE_SCRIPT_FW_ADDR "0x9F020000" @@ -100,6 +107,8 @@ #elif defined(CONFIG_FOR_DRAGINO_V2) || \ defined(CONFIG_FOR_MESH_POTATO_V2) #define CONFIG_BOOTCOMMAND "bootm 0x9F040000" +#elif defined(CONFIG_FOR_BSB) + #define CONFIG_BOOTCOMMAND "bootm 0x9F030000" #else #define CONFIG_BOOTCOMMAND "bootm 0x9F020000" #endif @@ -126,6 +135,13 @@ #define CFG_PROMPT "dr_boot> " #endif +#if defined(CONFIG_FOR_BSB) + #if defined(CFG_PROMPT) + #undef CFG_PROMPT + #endif + #define CFG_PROMPT "BSB> " +#endif + #undef CFG_HZ #define CFG_HZ bd->bi_cfg_hz #undef CPU_PLL_CONFIG_VAL @@ -778,6 +794,10 @@ #define CFG_ENV_ADDR 0x9F040000 #define CFG_ENV_SIZE 0x8000 #define CFG_ENV_SECT_SIZE 0x10000 +#elif defined(CONFIG_FOR_BSB) + #define CFG_ENV_ADDR 0x9F020000 + #define CFG_ENV_SIZE 0x8000 + #define CFG_ENV_SECT_SIZE 0x10000 #else #define CFG_ENV_ADDR 0x9F01EC00 #define CFG_ENV_SIZE 0x1000 @@ -802,7 +822,8 @@ #elif defined(CONFIG_FOR_8DEVICES_CARAMBOLA2) || \ defined(CONFIG_FOR_DRAGINO_V2) || \ - defined(CONFIG_FOR_MESH_POTATO_V2) + defined(CONFIG_FOR_MESH_POTATO_V2) || \ + defined(CONFIG_FOR_BSB) #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \ CFG_CMD_DHCP | \ @@ -894,6 +915,9 @@ 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) + #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x20000" + #define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES #else // TODO: should be == CONFIG_MAX_UBOOT_SIZE_KB #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES "0x1EC00" @@ -908,6 +932,8 @@ #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) + #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x30000 #else #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000 #endif @@ -933,6 +959,9 @@ #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) + // Black Swift board: 128k(U-Boot),64k(U-Boot env),64k(ART) + #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (256 * 1024) #else // TP-Link: 64k(U-Boot),64k(MAC/model/WPS pin block),64k(ART) #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES (192 * 1024) @@ -1017,6 +1046,11 @@ #define OFFSET_MAC_DATA_BLOCK 0x010000 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 #define OFFSET_MAC_ADDRESS 0x00FC00 +#elif defined(CONFIG_FOR_BSB) + // 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 + #define OFFSET_MAC_ADDRESS 0x000000 #else #define OFFSET_MAC_DATA_BLOCK 0x010000 #define OFFSET_MAC_DATA_BLOCK_LENGTH 0x010000 @@ -1028,7 +1062,8 @@ !defined(CONFIG_FOR_GS_OOLITE_V1_DEV) && \ !defined(CONFIG_FOR_DRAGINO_V2) && \ !defined(CONFIG_FOR_MESH_POTATO_V2) && \ - !defined(CONFIG_FOR_GL_INET) + !defined(CONFIG_FOR_GL_INET) && \ + !defined(CONFIG_FOR_BSB) #define OFFSET_ROUTER_MODEL 0x00FD00 #endif @@ -1080,6 +1115,16 @@ #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