[PATCH] bcm53xx: fix support for TP-Link Archer C5 v2 and C9 v1

Adrian Schmutzler freifunk at adrianschmutzler.de
Tue Aug 4 19:00:35 EDT 2020


As it appears, these devices just needed a resize of their os-image
partition. Increase it to 0x300000, so we have some extra space left
for future kernels.

Note that this only adjusts the partioning scheme, but since I
do not own the device I cannot say whether the bootloader will
actually cope with os-image > 2 MiB.

Cc: John Crispin <john at phrozen.org>
Cc: Rafał Miłecki <rafal at milecki.pl>
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/bcm53xx/image/Makefile           |  2 -
 .../330-tplink-archer-increase-os-image.patch | 44 +++++++++++++++++++
 .../330-tplink-archer-increase-os-image.patch | 44 +++++++++++++++++++
 tools/firmware-utils/src/tplink-safeloader.c  |  8 ++--
 4 files changed, 92 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/bcm53xx/patches-4.19/330-tplink-archer-increase-os-image.patch
 create mode 100644 target/linux/bcm53xx/patches-5.4/330-tplink-archer-increase-os-image.patch

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index a117e02a45..476ef785db 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -413,7 +413,6 @@ define Device/tplink-archer-c5-v2
   IMAGES := bin
   IMAGE/bin := append-rootfs | bcm53xx-tplink-safeloader
   TPLINK_BOARD := ARCHER-C5-V2
-  BROKEN := y
 endef
 TARGET_DEVICES += tplink-archer-c5-v2
 
@@ -425,7 +424,6 @@ define Device/tplink-archer-c9-v1
   IMAGES := bin
   IMAGE/bin := append-rootfs | bcm53xx-tplink-safeloader
   TPLINK_BOARD := ARCHERC9
-  BROKEN := y
 endef
 TARGET_DEVICES += tplink-archer-c9-v1
 
diff --git a/target/linux/bcm53xx/patches-4.19/330-tplink-archer-increase-os-image.patch b/target/linux/bcm53xx/patches-4.19/330-tplink-archer-increase-os-image.patch
new file mode 100644
index 0000000000..57650e09a0
--- /dev/null
+++ b/target/linux/bcm53xx/patches-4.19/330-tplink-archer-increase-os-image.patch
@@ -0,0 +1,44 @@
+--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
+@@ -106,15 +106,15 @@
+ 			read-only;
+ 		};
+ 
+-		os-image at 100000 {
++		os-image at 40000 {
+ 			label = "os-image";
+-			reg = <0x040000 0x200000>;
++			reg = <0x040000 0x300000>;
+ 			compatible = "brcm,trx";
+ 		};
+ 
+-		rootfs at 240000 {
++		rootfs at 340000 {
+ 			label = "rootfs";
+-			reg = <0x240000 0xc00000>;
++			reg = <0x340000 0xb00000>;
+ 		};
+ 
+ 		nvram at ff0000 {
+--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
+@@ -115,15 +115,15 @@
+ 			read-only;
+ 		};
+ 
+-		os-image at 100000 {
++		os-image at 40000 {
+ 			label = "os-image";
+-			reg = <0x040000 0x200000>;
++			reg = <0x040000 0x300000>;
+ 			compatible = "brcm,trx";
+ 		};
+ 
+-		rootfs at 240000 {
++		rootfs at 340000 {
+ 			label = "rootfs";
+-			reg = <0x240000 0xc00000>;
++			reg = <0x340000 0xb00000>;
+ 		};
+ 
+ 		nvram at ff0000 {
diff --git a/target/linux/bcm53xx/patches-5.4/330-tplink-archer-increase-os-image.patch b/target/linux/bcm53xx/patches-5.4/330-tplink-archer-increase-os-image.patch
new file mode 100644
index 0000000000..5d53dc34ab
--- /dev/null
+++ b/target/linux/bcm53xx/patches-5.4/330-tplink-archer-increase-os-image.patch
@@ -0,0 +1,44 @@
+--- a/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
++++ b/arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts
+@@ -105,15 +105,15 @@
+ 			read-only;
+ 		};
+ 
+-		os-image at 100000 {
++		os-image at 40000 {
+ 			label = "os-image";
+-			reg = <0x040000 0x200000>;
++			reg = <0x040000 0x300000>;
+ 			compatible = "brcm,trx";
+ 		};
+ 
+-		rootfs at 240000 {
++		rootfs at 340000 {
+ 			label = "rootfs";
+-			reg = <0x240000 0xc00000>;
++			reg = <0x340000 0xb00000>;
+ 		};
+ 
+ 		nvram at ff0000 {
+--- a/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
++++ b/arch/arm/boot/dts/bcm4709-tplink-archer-c9-v1.dts
+@@ -116,15 +116,15 @@
+ 			read-only;
+ 		};
+ 
+-		os-image at 100000 {
++		os-image at 40000 {
+ 			label = "os-image";
+-			reg = <0x040000 0x200000>;
++			reg = <0x040000 0x300000>;
+ 			compatible = "brcm,trx";
+ 		};
+ 
+-		rootfs at 240000 {
++		rootfs at 340000 {
+ 			label = "rootfs";
+-			reg = <0x240000 0xc00000>;
++			reg = <0x340000 0xb00000>;
+ 		};
+ 
+ 		nvram at ff0000 {
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index a5f3ced16d..208dde1e1a 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -1118,8 +1118,8 @@ static struct device_info boards[] = {
 
 		.partitions = {
 			{"fs-uboot", 0x00000, 0x40000},
-			{"os-image", 0x40000, 0x200000},
-			{"file-system", 0x240000, 0xc00000},
+			{"os-image", 0x40000, 0x300000},
+			{"file-system", 0x340000, 0xb00000},
 			{"default-mac", 0xe40000, 0x00200},
 			{"pin", 0xe40200, 0x00200},
 			{"product-info", 0xe40400, 0x00200},
@@ -1247,8 +1247,8 @@ static struct device_info boards[] = {
 
 		.partitions = {
 			{"fs-uboot", 0x00000, 0x40000},
-			{"os-image", 0x40000, 0x200000},
-			{"file-system", 0x240000, 0xc00000},
+			{"os-image", 0x40000, 0x300000},
+			{"file-system", 0x340000, 0xb00000},
 			{"default-mac", 0xe40000, 0x00200},
 			{"pin", 0xe40200, 0x00200},
 			{"product-info", 0xe40400, 0x00200},
-- 
2.20.1




More information about the openwrt-devel mailing list