tplink-safeloader: add TP-Link Archer A9 v6 support
authorPiotr Dymacz <pepe2k@gmail.com>
Sat, 26 Feb 2022 22:54:03 +0000 (23:54 +0100)
committerPiotr Dymacz <pepe2k@gmail.com>
Sat, 26 Feb 2022 22:54:03 +0000 (23:54 +0100)
Support creating images compatible with TP-Link Archer A9 v6.

Original partition layout:
  partition factory-boot base 0x00000 size 0x20000
  partition fs-uboot base 0x20000 size 0x20000
  partition partition-table base 0x40000 size 0x10000
  partition radio base 0x50000 size 0x10000
  partition default-mac base 0x60000 size 0x00200
  partition pin base 0x60200 size 0x00200
  partition device-id base 0x60400 size 0x00100
  partition product-info base 0x60500 size 0x0fb00
  partition soft-version base 0x70000 size 0x01000
  partition extra-para base 0x71000 size 0x01000
  partition support-list base 0x72000 size 0x0a000
  partition profile base 0x7c000 size 0x04000
  partition user-config base 0x80000 size 0x10000
  partition ap-config base 0x90000 size 0x10000
  partition apdef-config base 0xa0000 size 0x10000
  partition router-config base 0xb0000 size 0x10000
  partition os-image base 0xc0000 size 0x120000
  partition file-system base 0x1e0000 size 0xde0000
  partition log base 0xfc0000 size 0x20000
  partition certificate base 0xfe0000 size 0x10000
  partition default-config base 0xff0000 size 0x10000

To make use of automatic mtd split, the 'os-image' and 'file-system'
partitions were merged into 'firmware' for OpenWrt.

There are only 3 official vendor's firmware releases for this device,
all were successfully tested for migration to OpenWrt:
  1.1.1 Build 20210315 rel.40637
  1.0.6 Build 20200114 rel.73164
  1.0.3 Build 20190226 rel.62939

According to the 'SupportList' from vendor's latest firmware release,
this hardware might be also available under name 'Archer C90 v6',
probably dedicated for US market:
  SupportList:
  {product_name:Archer A9,product_ver:6.0,special_id:55530000}
  {product_name:Archer A9,product_ver:6.0,special_id:45550000}
  {product_name:Archer A9,product_ver:6.0,special_id:52550000}
  {product_name:Archer A9,product_ver:6.0,special_id:4A500000}
  {product_name:Archer C90,product_ver:6.0,special_id:55530000}

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
src/tplink-safeloader.c

index bc285d0fc63bc6291c47677acb61375d3ddd0610..c4727df75d1fbea2bc4e4a5a74e04ad588e34777 100644 (file)
@@ -831,6 +831,49 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system",
        },
 
+       /** Firmware layout for the Archer A9 v6 */
+       {
+               .id     = "ARCHER-A9-V6",
+               .support_list =
+                       "SupportList:\n"
+                       "{product_name:Archer A9,product_ver:6.0,special_id:55530000}\n"
+                       "{product_name:Archer A9,product_ver:6.0,special_id:45550000}\n"
+                       "{product_name:Archer A9,product_ver:6.0,special_id:52550000}\n"
+                       "{product_name:Archer A9,product_ver:6.0,special_id:4A500000}\n"
+                       "{product_name:Archer C90,product_ver:6.0,special_id:55530000}\n",
+               .part_trail = 0x00,
+               .soft_ver = SOFT_VER_TEXT("soft_ver:1.1.0\n"),
+
+               /* We're using a dynamic kernel/rootfs split here */
+               .partitions = {
+                       {"factory-boot", 0x00000, 0x20000},
+                       {"fs-uboot", 0x20000, 0x20000},
+                       {"partition-table", 0x40000, 0x10000},
+                       {"radio", 0x50000, 0x10000},
+                       {"default-mac", 0x60000, 0x00200},
+                       {"pin", 0x60200, 0x00200},
+                       {"device-id", 0x60400, 0x00100},
+                       {"product-info", 0x60500, 0x0fb00},
+                       {"soft-version", 0x70000, 0x01000},
+                       {"extra-para", 0x71000, 0x01000},
+                       {"support-list", 0x72000, 0x0a000},
+                       {"profile", 0x7c000, 0x04000},
+                       {"user-config", 0x80000, 0x10000},
+                       {"ap-config", 0x90000, 0x10000},
+                       {"apdef-config", 0xa0000, 0x10000},
+                       {"router-config", 0xb0000, 0x10000},
+                       {"firmware", 0xc0000, 0xf00000},        /* Stock: name os-image base 0xc0000 size 0x120000 */
+                                                               /* Stock: name file-system base 0x1e0000 size 0xde0000 */
+                       {"log", 0xfc0000, 0x20000},
+                       {"certificate", 0xfe0000, 0x10000},
+                       {"default-config", 0xff0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system",
+       },
+
        /** Firmware layout for the C2v3 */
        {
                .id     = "ARCHER-C2-V3",
@@ -3222,6 +3265,7 @@ static void build_image(const char *output,
        /* Some devices need the extra-para partition to accept the firmware */
        if (strcasecmp(info->id, "ARCHER-A6-V3") == 0 ||
            strcasecmp(info->id, "ARCHER-A7-V5") == 0 ||
+           strcasecmp(info->id, "ARCHER-A9-V6") == 0 ||
            strcasecmp(info->id, "ARCHER-C2-V3") == 0 ||
            strcasecmp(info->id, "ARCHER-C7-V4") == 0 ||
            strcasecmp(info->id, "ARCHER-C7-V5") == 0 ||