ar71xx: increase kernel partition size for TP-Link RE450 v1
[openwrt/staging/wigyori.git] / tools / firmware-utils / src / tplink-safeloader.c
index dceba75da56d8c39eb654c68b1ec2277ed2c872e..eef1f913b96ff70497fc798d95bf02f796256243 100644 (file)
@@ -365,8 +365,8 @@ static struct device_info boards[] = {
                        {"profile", 0x11700, 0x03900},
                        {"default-config", 0x15000, 0x04000},
                        {"user-config", 0x19000, 0x04000},
-                       {"os-image", 0x20000, 0x150000},
-                       {"file-system", 0x170000, 0x678000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0x648000},
                        {"certyficate", 0x7e8000, 0x08000},
                        {"radio", 0x7f0000, 0x10000},
                        {NULL, 0, 0}
@@ -439,8 +439,8 @@ static struct device_info boards[] = {
                        {"profile", 0x11700, 0x03900},
                        {"default-config", 0x15000, 0x04000},
                        {"user-config", 0x19000, 0x04000},
-                       {"os-image", 0x20000, 0x150000},
-                       {"file-system", 0x170000, 0x678000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0x648000},
                        {"certyficate", 0x7e8000, 0x08000},
                        {"radio", 0x7f0000, 0x10000},
                        {NULL, 0, 0}
@@ -485,6 +485,49 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system"
        },
 
+       /** Firmware layout for the C7 */
+       {
+               .id = "ARCHER-C7-V4",
+               .support_list =
+                       "SupportList:\n"
+                       "{product_name:Archer C7,product_ver:4.0.0,special_id:45550000}\n"
+                       "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n"
+                       "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n",
+               .support_trail = '\x00',
+               .soft_ver = "soft_ver:1.0.0\n",
+
+               /**
+                   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 = {
+                       {"factory-boot", 0x00000, 0x20000},
+                       {"fs-uboot", 0x20000, 0x20000},
+                       {"os-image", 0x40000, 0x180000},        /* Stock: base 0x40000 size 0x120000 */
+                       {"file-system", 0x1c0000, 0xd40000},    /* Stock: base 0x160000 size 0xda0000 */
+                       {"default-mac", 0xf00000, 0x00200},
+                       {"pin", 0xf00200, 0x00200},
+                       {"device-id", 0xf00400, 0x00100},
+                       {"product-info", 0xf00500, 0x0fb00},
+                       {"soft-version", 0xf10000, 0x00100},
+                       {"extra-para", 0xf11000, 0x01000},
+                       {"support-list", 0xf12000, 0x0a000},
+                       {"profile", 0xf1c000, 0x04000},
+                       {"default-config", 0xf20000, 0x10000},
+                       {"user-config", 0xf30000, 0x40000},
+                       {"qos-db", 0xf70000, 0x40000},
+                       {"certificate", 0xfb0000, 0x10000},
+                       {"partition-table", 0xfc0000, 0x10000},
+                       {"log", 0xfd0000, 0x20000},
+                       {"radio", 0xff0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system",
+       },
+
        /** Firmware layout for the C9 */
        {
                .id = "ARCHERC9",
@@ -687,8 +730,8 @@ static struct device_info boards[] = {
                */
                .partitions = {
                        {"fs-uboot", 0x00000, 0x20000},
-                       {"os-image", 0x20000, 0x160000},
-                       {"file-system", 0x180000, 0x5d0000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0x5b0000},
                        {"default-mac", 0x750000, 0x00200},
                        {"pin", 0x750200, 0x00200},
                        {"product-info", 0x750400, 0x0fc00},
@@ -720,8 +763,8 @@ static struct device_info boards[] = {
 
                .partitions = {
                        {"fs-uboot", 0x00000, 0x20000},
-                       {"os-image", 0x20000, 0x150000},
-                       {"file-system", 0x170000, 0xcd0000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0xca0000},
                        {"default-mac", 0xe40000, 0x00200},
                        {"pin", 0xe40200, 0x00200},
                        {"product-info", 0xe40400, 0x0fc00},
@@ -809,8 +852,8 @@ static struct device_info boards[] = {
                */
                .partitions = {
                        {"fs-uboot", 0x00000, 0x20000},
-                       {"os-image", 0x20000, 0x150000},
-                       {"file-system", 0x170000, 0x4a0000},
+                       {"os-image", 0x20000, 0x180000},
+                       {"file-system", 0x1a0000, 0x460000},
                        {"partition-table", 0x600000, 0x02000},
                        {"default-mac", 0x610000, 0x00020},
                        {"pin", 0x610100, 0x00020},
@@ -1214,6 +1257,9 @@ static void build_image(const char *output,
        if (strcasecmp(info->id, "ARCHER-C25-V1") == 0) {
                const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00};
                parts[5] = put_data("extra-para", mdat, 11);
+       } else if (strcasecmp(info->id, "ARCHER-C7-V4") == 0) {
+               const char mdat[11] = {0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x00};
+               parts[5] = put_data("extra-para", mdat, 11);
        }
 
        size_t len;