diff mbox

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

Message ID 1446863354-3263-3-git-send-email-leitec@staticky.com
State Superseded
Headers show

Commit Message

Claudio Leite Nov. 7, 2015, 2:29 a.m. UTC
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@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 mbox

Patch

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@0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition@80000 {
-+		label = "u-boot environment";
++		label = "u_env";
 +		reg = <0x80000 0x20000>;
 +	};
 +
++	partition@a0000 {
++		label = "s_env";
++		reg = <0xa0000 0x20000>;
++	};
++
 +	partition@200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1a00000>;
++	};
++
++	partition@4a0000 {
++		label = "rootfs1";
++		reg = <0x4a0000 0x1760000>;
++	};
++
++	partition@1c00000 {
++		label = "kernel2";
++		reg = <0x1c00000 0x1a00000>;
++	};
++
++	partition@1ea0000 {
++		label = "rootfs2";
++		reg = <0x1ea0000 0x1760000>;
 +	};
 +
-+	partition@400000 {
-+		label = "root";
-+		reg = <0x400000 0x1c00000>;
++	partition@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@0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
-+		read-only;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition@80000 {
-+		label = "u-boot environment";
-+		reg = <0x80000 0x20000>;
++		label = "u_env";
++		reg = <0x80000 0x4000>;
++	};
++
++	partition@84000 {
++		label = "s_env";
++		reg = <0x84000 0x4000>;
 +	};
 +
 +	partition@200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1400000>;
++	};
++
++	partition@490000 {
++		label = "rootfs1";
++		reg = <0x490000 0x1170000>;
++	};
++
++	partition@1600000 {
++		label = "kernel2";
++		reg = <0x1600000 0x1400000>;
++	};
++
++	partition@1890000 {
++		label = "rootfs2";
++		reg = <0x1890000 0x1170000>;
 +	};
 +
-+	partition@400000 {
-+		label = "root";
-+		reg = <0x400000 0x1200000>;
++	partition@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@0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition@80000 {
-+		label = "u-boot environment";
++		label = "u_env";
 +		reg = <0x80000 0x20000>;
 +	};
 +
++	partition@a0000 {
++		label = "s_env";
++		reg = <0xa0000 0x20000>;
++	};
++
 +	partition@200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1a00000>;
++	};
++
++	partition@4a0000 {
++		label = "rootfs1";
++		reg = <0x4a0000 0x1760000>;
++	};
++
++	partition@1c00000 {
++		label = "kernel2";
++		reg = <0x1c00000 0x1a00000>;
++	};
++
++	partition@1ea0000 {
++		label = "rootfs2";
++		reg = <0x1ea0000 0x1760000>;
 +	};
 +
-+	partition@400000 {
-+		label = "root";
-+		reg = <0x400000 0x1c00000>;
++	partition@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@0 {
 +		label = "u-boot";
-+		reg = <0x0000000 0x80000>;
-+		read-only;
++		reg = <0x0 0x80000>;
 +	};
 +
 +	partition@80000 {
-+		label = "u-boot environment";
-+		reg = <0x80000 0x20000>;
++		label = "u_env";
++		reg = <0x80000 0x4000>;
++	};
++
++	partition@84000 {
++		label = "s_env";
++		reg = <0x84000 0x4000>;
 +	};
 +
 +	partition@200000 {
-+		label = "kernel";
-+		reg = <0x200000 0x200000>;
++		label = "kernel1";
++		reg = <0x200000 0x1400000>;
++	};
++
++	partition@490000 {
++		label = "rootfs1";
++		reg = <0x490000 0x1170000>;
++	};
++
++	partition@1600000 {
++		label = "kernel2";
++		reg = <0x1600000 0x1400000>;
++	};
++
++	partition@1890000 {
++		label = "rootfs2";
++		reg = <0x1890000 0x1170000>;
 +	};
 +
-+	partition@400000 {
-+		label = "root";
-+		reg = <0x400000 0x1200000>;
++	partition@2a00000 {
++		label = "syscfg";
++		reg = <0x2a00000  0x1600000>;
 +	};
 +};
 +