a quick and dirty implementation of EAP220 master
authorAlexander Couzens <lynxis@fe80.eu>
Sat, 14 Jul 2018 01:32:42 +0000 (03:32 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Sat, 14 Jul 2018 03:54:03 +0000 (05:54 +0200)
target/linux/ar71xx/base-files/etc/board.d/02_network
target/linux/ar71xx/base-files/etc/diag.sh
target/linux/ar71xx/base-files/lib/ar71xx.sh
target/linux/ar71xx/base-files/lib/upgrade/platform.sh
target/linux/ar71xx/files/arch/mips/ath79/mach-eap120.c
target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
target/linux/ar71xx/image/generic-tp-link.mk
tools/firmware-utils/src/tplink-safeloader.c

index 4a141e9..dde1e63 100755 (executable)
@@ -77,6 +77,7 @@ ar71xx_setup_interfaces()
        cpe210-v2|\
        dr342|\
        eap120|\
+       eap220|\
        eap300v2|\
        eap7660d|\
        el-mini|\
index 137baa9..67cc3e3 100644 (file)
@@ -26,6 +26,7 @@ get_status_led() {
        e1700ac-v2|\
        e600gac-v2|\
        eap120|\
+       eap220|\
        minibox-v1|\
        packet-squirrel|\
        som9331|\
index 63b7a4f..2397d54 100755 (executable)
@@ -685,6 +685,10 @@ ar71xx_board_detect() {
                name="eap120"
                tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
                ;;
+       *"EAP220")
+               name="eap220"
+               tplink_pharos_board_detect "$(tplink_pharos_get_model_string | tr -d '\r')"
+               ;;
        *"EAP300 v2")
                name="eap300v2"
                ;;
index 41e60d7..73302e2 100755 (executable)
@@ -580,6 +580,7 @@ platform_check_image() {
        cpe210|\
        cpe510|\
        eap120|\
+       eap220|\
        wbs210|\
        wbs510)
                tplink_pharos_check_image "$1" "7f454c46" "$(tplink_pharos_get_model_string)" '' && return 0
index 130c770..15bef3f 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_data/phy-at803x.h>
 
 #include "common.h"
+#include "dev-ap9x-pci.h"
 #include "dev-eth.h"
 #include "dev-gpio-buttons.h"
 #include "dev-leds-gpio.h"
@@ -121,6 +122,28 @@ static void __init eap120_setup(void)
        ath79_register_wmac(ee, mac);
 }
 
+static void __init eap220_setup(void)
+{
+       u8 second_wifi[ETH_ALEN] = { 0 };
+
+       u8 *mac = (u8 *) KSEG1ADDR(0x1f030008);
+       u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
+
+       eap_setup(mac);
+
+       /* first wifi / 2.4 GHz */
+#define EAP220_WMAC_OFFSET 0x1000
+       ath79_register_wmac(art + EAP220_WMAC_OFFSET, mac);
+
+       /* second wifi / 5 GHz */
+#define EAP220_PCIE_CALDATA_OFFSET 0x5000
+       ath79_init_mac(second_wifi, mac, 1);
+       ap91_pci_init(art + EAP220_PCIE_CALDATA_OFFSET, second_wifi);
+}
+
 MIPS_MACHINE(ATH79_MACH_EAP120, "EAP120", "TP-LINK EAP120",
                eap120_setup);
 
+MIPS_MACHINE(ATH79_MACH_EAP220, "EAP220", "TP-LINK EAP220",
+               eap220_setup);
+
index c5be6b9..c9eb32b 100644 (file)
@@ -108,6 +108,7 @@ enum ath79_mach_type {
        ATH79_MACH_E600G_V2,                    /* Qxwlan E600G v2 */
        ATH79_MACH_E600GAC_V2,                  /* Qxwlan E600GAC v2 */
        ATH79_MACH_EAP120,                      /* TP-LINK EAP120 */
+       ATH79_MACH_EAP220,                      /* TP-LINK EAP220 */
        ATH79_MACH_EAP300V2,                    /* EnGenius EAP300 v2 */
        ATH79_MACH_EAP7660D,                    /* Senao EAP7660D */
        ATH79_MACH_EBR_2310_C1,                 /* D-link EBR-2310 rev. C1 */
index 8998377..17e2da0 100644 (file)
@@ -202,6 +202,21 @@ define Device/wbs510-v1
 endef
 TARGET_DEVICES += wbs510-v1
 
+define Device/eap220-v1
+  DEVICE_TITLE := TP-LINK EAP220 v1
+  MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware)
+  IMAGE_SIZE := 15872k
+  BOARDNAME := EAP220
+  TPLINK_BOARD_ID := EAP220
+  DEVICE_PROFILE := EAP220
+  LOADER_TYPE := elf
+  KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel
+  IMAGES := sysupgrade.bin factory.bin
+  IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade
+  IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
+endef
+TARGET_DEVICES += eap220-v1
+
 define Device/eap120-v1
   DEVICE_TITLE := TP-LINK EAP120 v1
   MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware)
index 92d4485..6ef603c 100644 (file)
@@ -731,6 +731,36 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system"
        },
 
+       /** Firmware layout for the EAP220 */
+       {
+               .id     = "EAP220",
+               .vendor = "EAP220(TP-LINK|UN|N600-D):1.0\r\n",
+               .support_list =
+                       "SupportList:\r\n"
+                       "EAP220(TP-LINK|UN|N600-D):1.0\r\n",
+               .support_trail = '\xff',
+               .soft_ver = NULL,
+
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x20000},
+                       {"partition-table", 0x20000, 0x02000},
+                       {"default-mac", 0x30000, 0x00020},
+                       {"support-list", 0x31000, 0x00100},
+                       {"product-info", 0x31100, 0x00100},
+                       {"soft-version", 0x32000, 0x00100},
+                       {"os-image", 0x40000, 0x180000},
+                       {"file-system", 0x1c0000, 0x600000},
+                       {"user-config", 0x7c0000, 0x10000},
+                       {"backup-config", 0x7d0000, 0x10000},
+                       {"log", 0x7e0000, 0x10000},
+                       {"radio", 0x7f0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system"
+       },
+
        /** Firmware layout for the TL-WA850RE v2 */
        {
                .id     = "TLWA850REV2",