firmware-utils: add support for TL-WR1043ND v4 to mktplinkfw and tplink-safeloader
authorMatthias Schiffer <mschiffer@universe-factory.net>
Sat, 10 Dec 2016 19:45:50 +0000 (20:45 +0100)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Tue, 20 Dec 2016 13:38:48 +0000 (14:38 +0100)
The TL-WR1043ND v4 uses a kernel image with a mktplinkfw header inside the
os-image partition of a tplink-safeloader image.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
tools/firmware-utils/src/mktplinkfw.c
tools/firmware-utils/src/tplink-safeloader.c

index 34e6546a2d7db72748146ef233830c2e8de9ce97..fbf89609c22dd0fb50c4c8656141c8a8b9c29817 100644 (file)
@@ -177,6 +177,20 @@ static struct flash_layout layouts[] = {
                .kernel_la      = 0x00000000 ,
                .kernel_ep      = 0xc0000000,
                .rootfs_ofs     = 0x2a0000,
+       }, {
+               /*
+                       Some devices (e.g. TL-WR1043 v4) use a mktplinkfw kernel image
+                       embedded in a tplink-safeloader image as os-image partition.
+
+                       We use a 1.5MB partition for the compressed kernel, which should
+                       be sufficient, but not too wasteful (the flash of the TL-WR1043 v4
+                       has 16MB in total).
+               */
+               .id             = "16Msafeloader",
+               .fw_max_len     = 0x180000,
+               .kernel_la      = 0x80060000,
+               .kernel_ep      = 0x80060000,
+               .rootfs_ofs     = 0,
        }, {
                /* terminating entry */
        }
index 7a5990cc9b4d7319d1b5f6b7e439f651384444f7..016c118787f3b5332b76f65c85930065a569d6b8 100644 (file)
@@ -294,6 +294,42 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system"
        },
 
+       /** Firmware layout for the TL-WR1043 v4 */
+       {
+               .id     = "TLWR1043NDV4",
+               .vendor = "",
+               .support_list =
+                       "SupportList:\n"
+                       "{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n",
+               .support_trail = '\x00',
+
+               /**
+                   We use a bigger os-image partition than the stock images (and thus
+                   smaller file-system), as our kernel doesn't fit in the stock firmware's
+                   1MB os-image.
+               */
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x20000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0xdb0000},
+                       {"default-mac", 0xf50000, 0x00200},
+                       {"pin", 0xf50200, 0x00200},
+                       {"product-info", 0xf50400, 0x0fc00},
+                       {"soft-version", 0xf60000, 0x0b000},
+                       {"support-list", 0xf6b000, 0x04000},
+                       {"profile", 0xf70000, 0x04000},
+                       {"default-config", 0xf74000, 0x0b000},
+                       {"user-config", 0xf80000, 0x40000},
+                       {"partition-table", 0xfc0000, 0x10000},
+                       {"log", 0xfd0000, 0x20000},
+                       {"radio", 0xff0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system"
+       },
+
        {}
 };