[PATCH firmware-utils] tplink-safeloader: TP-Link RE650 v2 support

Marcin Gordziejewski openwrt at flicksfix.com
Thu Apr 7 11:43:25 PDT 2022


Support creating images for TP-Link RE650 v2.

Partition table pulled from OEM firmware on the device:
  partition fs-uboot base 0x00000 size 0x20000
  partition os-image base 0x20000 size 0x330000
  partition file-system base 0x350000 size 0x470000
  partition partition-table base 0x7c0000 size 0x02000
  partition default-mac base 0x7c2000 size 0x00020
  partition pin base 0x7c2100 size 0x00020
  partition product-info base 0x7c3100 size 0x01000
  partition soft-version base 0x7c4200 size 0x01000
  partition support-list base 0x7c5200 size 0x01000
  partition profile base 0x7c6200 size 0x08000
  partition config-info base 0x7ce200 size 0x00400
  partition user-config base 0x7d0000 size 0x10000
  partition default-config base 0x7e0000 size 0x10000
  partition radio base 0x7f0000 size 0x10000

One notable difference from v1 in terms of safeloader, is that it requires
soft_ver to be defined for device to accept the firmware, otherwise it
otherwise it denies the firmware file. Version v1 has also 16MB of Flash
instead of 8MB that v2 has, so the paritions had to be shrinked
accordingly.

In OpenWRT "firmware" partition is merged into one, it's made out of
os-image and file-system partitions.

Signed-off-by: Marcin Gordziejewski <openwrt at flicksfix.com>
---
 src/tplink-safeloader.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index c4727df..e4021a9 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -2807,6 +2807,45 @@ static struct device_info boards[] = {
 		.first_sysupgrade_partition = "os-image",
 		.last_sysupgrade_partition = "file-system"
 	},
+	/** Firmware layout for the RE650 V2 (8MB Flash)*/
+	{
+		.id     = "RE650-V2",
+		.vendor = "",
+		.support_list =
+			"SupportList:\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:00000000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:45550000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:4A500000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:41550000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:43410000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:41530000}\n"
+			"{product_name:RE650,product_ver:2.0.0,special_id:55530000}\n",
+		.part_trail = 0x00,
+		/* For RE650 v2, soft ver is required, otherwise OEM install doesn't work */
+		.soft_ver = SOFT_VER_TEXT("soft_ver:2.0.0\n"),
+
+		/* We're using a dynamic kernel/rootfs split here */
+		.partitions = {
+			{"fs-uboot", 0x00000, 0x20000},
+			{"firmware", 0x20000, 0x7a0000},
+			{"partition-table", 0x7c0000, 0x02000},
+			{"default-mac", 0x7c2000, 0x00020},
+			{"pin", 0x7c2100, 0x00020},
+			{"product-info", 0x7c3100, 0x01000},
+			{"soft-version", 0x7c4200, 0x01000},
+			{"support-list", 0x7c5200, 0x01000},
+			{"profile", 0x7c6200, 0x08000},
+			{"config-info", 0x7ce200, 0x00400},
+			{"user-config", 0x7d0000, 0x10000},
+			{"default-config", 0x7e0000, 0x10000},
+			{"radio", 0x7f0000, 0x10000},
+			{NULL, 0, 0}
+		},
+
+		.first_sysupgrade_partition = "os-image",
+		.last_sysupgrade_partition = "file-system"
+	},
+
 
 	{}
 };
-- 
2.35.1




More information about the openwrt-devel mailing list