Add support for TP-Link TL-WR802N (QCA9533)
authorPiotr Dymacz <pepe2k@gmail.com>
Mon, 21 Mar 2016 23:17:34 +0000 (00:17 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Mon, 21 Mar 2016 23:17:34 +0000 (00:17 +0100)
Makefile
u-boot/Makefile
u-boot/include/configs/ap143.h

index 4905f2377fca27b0ec99984de5206f0bfd44287d..59d053614fd3a63122724ec4ef33d6a15d33f818 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -184,6 +184,17 @@ tplink_wr820n_CN:
        @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
        @make --no-print-directory show_size
 
+tplink_wr802n: export UBOOT_FILE_NAME=uboot_for_tp-link_tl-wr802n
+tplink_wr802n: export CONFIG_MAX_UBOOT_SIZE_KB=123
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+tplink_wr802n: export COMPRESSED_UBOOT=1
+endif
+tplink_wr802n: export ETH_CONFIG=_s27
+tplink_wr802n:
+       @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) wr802n_config
+       @cd $(BUILD_TOPDIR)/u-boot/ && $(MAKECMD) ENDIANNESS=-EB V=1 all
+       @make --no-print-directory show_size
+
 dlink_dir505:  export UBOOT_FILE_NAME=uboot_for_d-link_dir-505
 dlink_dir505:  export CONFIG_MAX_UBOOT_SIZE_KB=64
 ifndef CONFIG_SKIP_LOWLEVEL_INIT
index e9f81ad0c7cf76605671dbc24e361f7906cf08eb..384e75fb6670a1dfc2bf0c676aad0b8ede15bf96 100644 (file)
@@ -613,6 +613,20 @@ wr820n_CN_config : unconfig ap143_common_config
 
        @./mkconfig -a ap143 mips mips ap143 ar7240 ar7240
 
+wr802n_config : unconfig ap143_common_config
+       @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR802N at:' `date` '\e[0m'
+       @echo "#define SOC_TYPE               QCA_QCA953X_SOC" >> include/config.h
+       @echo "#define CONFIG_FOR_TPLINK_WR802N             1" >> include/config.h
+       @echo "#define CFG_ATHRS27_PHY                      1" >> include/config.h
+       @echo "#define CFG_ATH_GMAC_NMACS                   2" >> include/config.h
+       @echo "#define CONFIG_DEFAULT_FLASH_SIZE_IN_MB      4" >> include/config.h
+       @echo "#define CONFIG_GPIO_RESET_BTN               12" >> include/config.h
+       @echo "#define CONFIG_GPIO_RESET_BTN_ACTIVE_LOW     1" >> include/config.h
+       @echo "#define CONFIG_TPLINK_IMAGE_HEADER           1" >> include/config.h
+       @echo "#define CONFIG_BOARD_CUSTOM_STRING           \"TP-Link TL-WR802N\"" >> include/config.h
+
+       @./mkconfig -a ap143 mips mips ap143 ar7240 ar7240
+
 wr841n_v9_config : unconfig ap143_common_config
        @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR841N/D v9 at:' `date` '\e[0m'
        @echo "#define SOC_TYPE               QCA_QCA953X_SOC" >> include/config.h
index cc7749de70b676abb6527403ded46a9ca3f77412..a0b2a92dfa6ff0348d96ad2c364f084d77913eff 100644 (file)
@@ -12,7 +12,8 @@
 /*
  * GPIO configuration
  */
-#if defined(CONFIG_FOR_TPLINK_WR820N_CN)
+#if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)
        /* LEDs */
        #define CONFIG_QCA_GPIO_MASK_LEDS_ACTIVE_LO             GPIO13
 
 #undef CONFIG_BOOTARGS
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN)
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:32k(u-boot1),32k(u-boot2),3008k(rootfs),896k(uImage),64k(mib0),64k(ART)"
-#elif defined(CONFIG_FOR_TPLINK_WR841N_V9)
+#elif defined(CONFIG_FOR_TPLINK_WR841N_V9) ||\
+         defined(CONFIG_FOR_TPLINK_WR802N)
        #define CONFIG_BOOTARGS "console=ttyS0,115200 root=31:02 rootfstype=squashfs init=/sbin/init mtdparts=ath-nor0:128k(u-boot),1024k(kernel),2816k(rootfs),64k(config),64k(art)"
 #endif
 
 #define CONFIG_LOADADDR                        0x80800000
 
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define CFG_LOAD_ADDR                    0x9F020000
        #define UPDATE_SCRIPT_FW_ADDR   "0x9F020000"
 #define        CFG_HZ  bd->bi_cfg_hz
 
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define CONFIG_QCA_PLL          QCA_PLL_PRESET_550_400_200
 #endif
 #undef  CFG_ENV_IS_NOWHERE
 
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define CFG_ENV_ADDR            0x9F01EC00
        #define CFG_ENV_SIZE            0x1000
  * Available commands
  */
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define CONFIG_COMMANDS (CFG_CMD_MEMORY | \
                                                         CFG_CMD_DHCP   | \
 
 // Firmware partition offset
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define WEBFAILSAFE_UPLOAD_KERNEL_ADDRESS               WEBFAILSAFE_UPLOAD_UBOOT_ADDRESS + 0x20000
 #endif
 
 // TODO: should be == CONFIG_MAX_UBOOT_SIZE_KB
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define UPDATE_SCRIPT_UBOOT_SIZE_IN_BYTES                       "0x1EC00"
        #define UPDATE_SCRIPT_UBOOT_BACKUP_SIZE_IN_BYTES        "0x20000"
 // max. firmware size <= (FLASH_SIZE -  WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES)
 // TP-Link: 64k(U-Boot),64k(MAC/model/WPS pin block),64k(ART)
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define WEBFAILSAFE_UPLOAD_LIMITED_AREA_IN_BYTES        (192 * 1024)
 #endif
 #define CONFIG_NET_MULTI
 #define CONFIG_PCI 1
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define WLANCAL                                 0x9fff1000
        #define BOARDCAL                                0x9fff0000
 
 /* MAC address, model and PIN number offsets in FLASH */
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        #define OFFSET_MAC_DATA_BLOCK                   0x010000
        #define OFFSET_MAC_DATA_BLOCK_LENGTH    0x010000
  * PLL and clocks configurations from FLASH
  */
 #if defined(CONFIG_FOR_TPLINK_WR820N_CN) ||\
+       defined(CONFIG_FOR_TPLINK_WR802N)    ||\
        defined(CONFIG_FOR_TPLINK_WR841N_V9)
        /*
         * All TP-Link routers have a lot of unused space