From bd856eff48509fa4511169ee55f639ede8dd4ac6 Mon Sep 17 00:00:00 2001 From: Andrew Cameron Date: Wed, 9 Nov 2022 13:23:01 +0000 Subject: [PATCH] tplink-safeloader: add TP-Link CPE605 v1 Support Enable creating images compatible with the TP-Link CPE605 v1 Router Original partitions from stock firmware are: partition fs-uboot base 0x00000 size 0x20000 partition partition-table base 0x20000 size 0x02000 partition default-mac base 0x30000 size 0x00020 partition serial-number base 0x30100 size 0x00020 partition product-info base 0x31100 size 0x00100 partition device-info base 0x31400 size 0x00400 partition signature base 0x32000 size 0x00400 partition device-id base 0x33000 size 0x00100 partition os-image base 0x40000 size 0x170000 partition soft-version base 0x1b0000 size 0x00100 partition support-list base 0x1b1000 size 0x01000 partition file-system base 0x1c0000 size 0x600000 partition user-config base 0x7c0000 size 0x10000 partition default-config base 0x7d0000 size 0x10000 partition log base 0x7e0000 size 0x10000 partition radio base 0x7f0000 size 0x10000 The 'soft-version' and 'support-list' partitions are relocated afther the 'file-system' partition. This creates ones contiguous firmware area, allowing for dynamic partition splitting. Tested by forum user ruildias Signed-off-by: Andrew Cameron [add original partition overview and note on relocation commit message, update support_list and part_trail properties to match vendor FW] Signed-off-by: Sander Vanheule --- src/tplink-safeloader.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c index 7f9081d..ddb5dff 100644 --- a/src/tplink-safeloader.c +++ b/src/tplink-safeloader.c @@ -468,6 +468,41 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "support-list", }, + /** Firmware layout for the CPE605V1 */ + { + .id = "CPE605V1", + .vendor = "CPE605(TP-LINK|UN|N150-5):1.0\r\n", + .support_list = + "SupportList:\r\n" + "CPE605(TP-LINK|UN|N150-5|00000000):1.0\r\n" + "CPE605(TP-LINK|EU|N150-5|45550000):1.0\r\n" + "CPE605(TP-LINK|US|N150-5|55530000):1.0\r\n", + .part_trail = 0x00, + .soft_ver = SOFT_VER_DEFAULT, + + .partitions = { + {"fs-uboot", 0x00000, 0x20000}, + {"partition-table", 0x20000, 0x02000}, + {"default-mac", 0x30000, 0x00020}, + {"serial-number", 0x30100, 0x00020}, + {"product-info", 0x31100, 0x00100}, + {"device-info", 0x31400, 0x00400}, + {"signature", 0x32000, 0x00400}, + {"device-id", 0x33000, 0x00100}, + {"firmware", 0x40000, 0x770000}, + {"soft-version", 0x7b0000, 0x00100}, + {"support-list", 0x7b1000, 0x01000}, + {"user-config", 0x7c0000, 0x10000}, + {"default-config", 0x7d0000, 0x10000}, + {"log", 0x7e0000, 0x10000}, + {"radio", 0x7f0000, 0x10000}, + {NULL, 0, 0} + }, + + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "support-list", + }, + /** Firmware layout for the CPE610V1 */ { .id = "CPE610V1", -- 2.30.2