[OpenWrt-Devel] [PATCH 2/7] kirkwood: match factory partitions on EA[34]500

Claudio Leite leitec at staticky.com
Fri Nov 6 21:29:09 EST 2015


Linksys uses a dual firmware layout, where the bootloader
will switch to the other stored image when one fails to
boot three consecutive times.

In order to make this firmware compatible with the factory
images and the stock bootloader we must match this layout.

Signed-off-by: Claudio Leite <leitec at staticky.com>
---
 package/boot/uboot-envtools/files/kirkwood         |  2 +-
 .../linux/kirkwood/patches-3.18/160-ea4500.patch   | 36 +++++++++++++++-----
 .../linux/kirkwood/patches-3.18/170-ea3500.patch   | 39 ++++++++++++++++------
 target/linux/kirkwood/patches-4.3/140-ea4500.patch | 36 +++++++++++++++-----
 target/linux/kirkwood/patches-4.3/150-ea3500.patch | 39 ++++++++++++++++------
 5 files changed, 115 insertions(+), 37 deletions(-)

diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood
index 98f85da..1066371 100644
--- a/package/boot/uboot-envtools/files/kirkwood
+++ b/package/boot/uboot-envtools/files/kirkwood
@@ -15,7 +15,7 @@ board=$(kirkwood_board_name)
 
 case "$board" in
 "ea3500")
-	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x20000"
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000"
 	;;
 "ea4500" | \
 "guruplug-server-plus" | \
diff --git a/target/linux/kirkwood/patches-3.18/160-ea4500.patch b/target/linux/kirkwood/patches-3.18/160-ea4500.patch
index 386b5ea..9027070 100644
--- a/target/linux/kirkwood/patches-3.18/160-ea4500.patch
+++ b/target/linux/kirkwood/patches-3.18/160-ea4500.patch
@@ -10,7 +10,7 @@
  	kirkwood-ib62x0.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/kirkwood-ea4500.dts
-@@ -0,0 +1,167 @@
+@@ -0,0 +1,187 @@
 +/*
 + * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500
 + *
@@ -140,22 +140,42 @@
 +
 +	partition at 0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition at 80000 {
-+		label = "u-boot environment";
++		label = "u_env";
 +		reg = <0x80000 0x20000>;
 +	};
 +
++	partition at a0000 {
++		label = "s_env";
++		reg = <0xa0000 0x20000>;
++	};
++
 +	partition at 200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1a00000>;
++	};
++
++	partition at 4a0000 {
++		label = "rootfs1";
++		reg = <0x4a0000 0x1760000>;
++	};
++
++	partition at 1c00000 {
++		label = "kernel2";
++		reg = <0x1c00000 0x1a00000>;
++	};
++
++	partition at 1ea0000 {
++		label = "rootfs2";
++		reg = <0x1ea0000 0x1760000>;
 +	};
 +
-+	partition at 400000 {
-+		label = "root";
-+		reg = <0x400000 0x1c00000>;
++	partition at 3600000 {
++		label = "syscfg";
++		reg = <0x3600000 0x4a00000>;
 +	};
 +};
 +
diff --git a/target/linux/kirkwood/patches-3.18/170-ea3500.patch b/target/linux/kirkwood/patches-3.18/170-ea3500.patch
index 84645de..db69659 100644
--- a/target/linux/kirkwood/patches-3.18/170-ea3500.patch
+++ b/target/linux/kirkwood/patches-3.18/170-ea3500.patch
@@ -10,7 +10,7 @@
  	kirkwood-guruplug-server-plus.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/kirkwood-ea3500.dts
-@@ -0,0 +1,160 @@
+@@ -0,0 +1,179 @@
 +/*
 + * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500
 + *
@@ -132,23 +132,42 @@
 +
 +	partition at 0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
-+		read-only;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition at 80000 {
-+		label = "u-boot environment";
-+		reg = <0x80000 0x20000>;
++		label = "u_env";
++		reg = <0x80000 0x4000>;
++	};
++
++	partition at 84000 {
++		label = "s_env";
++		reg = <0x84000 0x4000>;
 +	};
 +
 +	partition at 200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1400000>;
++	};
++
++	partition at 490000 {
++		label = "rootfs1";
++		reg = <0x490000 0x1170000>;
++	};
++
++	partition at 1600000 {
++		label = "kernel2";
++		reg = <0x1600000 0x1400000>;
++	};
++
++	partition at 1890000 {
++		label = "rootfs2";
++		reg = <0x1890000 0x1170000>;
 +	};
 +
-+	partition at 400000 {
-+		label = "root";
-+		reg = <0x400000 0x1200000>;
++	partition at 2a00000 {
++		label = "syscfg";
++		reg = <0x2a00000  0x1600000>;
 +	};
 +};
 +
diff --git a/target/linux/kirkwood/patches-4.3/140-ea4500.patch b/target/linux/kirkwood/patches-4.3/140-ea4500.patch
index 4409394..7fd56a7 100644
--- a/target/linux/kirkwood/patches-4.3/140-ea4500.patch
+++ b/target/linux/kirkwood/patches-4.3/140-ea4500.patch
@@ -10,7 +10,7 @@
  	kirkwood-ib62x0.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/kirkwood-ea4500.dts
-@@ -0,0 +1,167 @@
+@@ -0,0 +1,187 @@
 +/*
 + * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500
 + *
@@ -140,22 +140,42 @@
 +
 +	partition at 0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition at 80000 {
-+		label = "u-boot environment";
++		label = "u_env";
 +		reg = <0x80000 0x20000>;
 +	};
 +
++	partition at a0000 {
++		label = "s_env";
++		reg = <0xa0000 0x20000>;
++	};
++
 +	partition at 200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1a00000>;
++	};
++
++	partition at 4a0000 {
++		label = "rootfs1";
++		reg = <0x4a0000 0x1760000>;
++	};
++
++	partition at 1c00000 {
++		label = "kernel2";
++		reg = <0x1c00000 0x1a00000>;
++	};
++
++	partition at 1ea0000 {
++		label = "rootfs2";
++		reg = <0x1ea0000 0x1760000>;
 +	};
 +
-+	partition at 400000 {
-+		label = "root";
-+		reg = <0x400000 0x1c00000>;
++	partition at 3600000 {
++		label = "syscfg";
++		reg = <0x3600000 0x4a00000>;
 +	};
 +};
 +
diff --git a/target/linux/kirkwood/patches-4.3/150-ea3500.patch b/target/linux/kirkwood/patches-4.3/150-ea3500.patch
index a2d71e3..13abd02 100644
--- a/target/linux/kirkwood/patches-4.3/150-ea3500.patch
+++ b/target/linux/kirkwood/patches-4.3/150-ea3500.patch
@@ -10,7 +10,7 @@
  	kirkwood-guruplug-server-plus.dtb \
 --- /dev/null
 +++ b/arch/arm/boot/dts/kirkwood-ea3500.dts
-@@ -0,0 +1,160 @@
+@@ -0,0 +1,179 @@
 +/*
 + * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500
 + *
@@ -132,23 +132,42 @@
 +
 +	partition at 0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
-+		read-only;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition at 80000 {
-+		label = "u-boot environment";
-+		reg = <0x80000 0x20000>;
++		label = "u_env";
++		reg = <0x80000 0x4000>;
++	};
++
++	partition at 84000 {
++		label = "s_env";
++		reg = <0x84000 0x4000>;
 +	};
 +
 +	partition at 200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1400000>;
++	};
++
++	partition at 490000 {
++		label = "rootfs1";
++		reg = <0x490000 0x1170000>;
++	};
++
++	partition at 1600000 {
++		label = "kernel2";
++		reg = <0x1600000 0x1400000>;
++	};
++
++	partition at 1890000 {
++		label = "rootfs2";
++		reg = <0x1890000 0x1170000>;
 +	};
 +
-+	partition at 400000 {
-+		label = "root";
-+		reg = <0x400000 0x1200000>;
++	partition at 2a00000 {
++		label = "syscfg";
++		reg = <0x2a00000  0x1600000>;
 +	};
 +};
 +
-- 
2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list