[OpenWrt-Devel] [PATCH v2 2/9] kirkwood: rework Linksys EA[34]500 DTS

Claudio Leite leitec at staticky.com
Mon Nov 9 17:51:45 EST 2015


- Use board engineering names rather than marketing names

- 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>
---
v2 changes: use engineering names

 package/boot/uboot-envtools/files/kirkwood         |  2 +-
 .../linux/kirkwood/patches-3.18/160-ea4500.patch   | 64 ++++++++++++++--------
 .../linux/kirkwood/patches-3.18/170-ea3500.patch   | 63 +++++++++++++--------
 .../kirkwood/patches-3.18/180-goflexhome.patch     |  6 +-
 target/linux/kirkwood/patches-4.3/140-ea4500.patch | 64 ++++++++++++++--------
 target/linux/kirkwood/patches-4.3/150-ea3500.patch | 63 +++++++++++++--------
 .../kirkwood/patches-4.3/160-goflexhome.patch      |  6 +-
 7 files changed, 173 insertions(+), 95 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..7a60fa5 100644
--- a/target/linux/kirkwood/patches-3.18/160-ea4500.patch
+++ b/target/linux/kirkwood/patches-3.18/160-ea4500.patch
@@ -1,18 +1,18 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -120,6 +120,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
- 	kirkwood-ds411.dtb \
- 	kirkwood-ds411j.dtb \
- 	kirkwood-ds411slim.dtb \
-+	kirkwood-ea4500.dtb \
- 	kirkwood-goflexnet.dtb \
- 	kirkwood-guruplug-server-plus.dtb \
- 	kirkwood-ib62x0.dtb \
+@@ -128,6 +128,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
+ 	kirkwood-is2.dtb \
+ 	kirkwood-km_kirkwood.dtb \
+ 	kirkwood-laplug.dtb \
++	kirkwood-linksys-viper.dtb \
+ 	kirkwood-lschlv2.dtb \
+ 	kirkwood-lsxhl.dtb \
+ 	kirkwood-mplcec4.dtb \
 --- /dev/null
-+++ b/arch/arm/boot/dts/kirkwood-ea4500.dts
-@@ -0,0 +1,167 @@
++++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts
+@@ -0,0 +1,187 @@
 +/*
-+ * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500
++ * kirkwood-linksys-viper.dts - Device Tree file for Linksys E4200v2/EA4500
 + *
 + * (c) 2013 Jonas Gorski <jogo at openwrt.org>
 + * (c) 2013 Deutsche Telekom Innovation Laboratories
@@ -29,8 +29,8 @@
 +#include "kirkwood-6282.dtsi"
 +
 +/ {
-+	model = "Linksys EA4500";
-+	compatible = "linksys,ea4500", "marvell,kirkwood-88f6282", "marvell,kirkwood";
++	model = "Linksys E4200v2 / EA4500";
++	compatible = "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 +
 +	memory {
 +		device_type = "memory";
@@ -111,12 +111,12 @@
 +		pinctrl-names = "default";
 +
 +		white-health {
-+			label = "ea4500:white:health";
++			label = "viper:white:health";
 +			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
 +		};
 +
 +		white-pulse {
-+			label = "ea4500:white:pulse";
++			label = "viper:white:pulse";
 +			gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
 +		};
 +	};
@@ -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..6a03c41 100644
--- a/target/linux/kirkwood/patches-3.18/170-ea3500.patch
+++ b/target/linux/kirkwood/patches-3.18/170-ea3500.patch
@@ -1,18 +1,18 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -120,6 +120,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
- 	kirkwood-ds411.dtb \
- 	kirkwood-ds411j.dtb \
- 	kirkwood-ds411slim.dtb \
-+	kirkwood-ea3500.dtb \
- 	kirkwood-ea4500.dtb \
- 	kirkwood-goflexnet.dtb \
- 	kirkwood-guruplug-server-plus.dtb \
+@@ -128,6 +128,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
+ 	kirkwood-is2.dtb \
+ 	kirkwood-km_kirkwood.dtb \
+ 	kirkwood-laplug.dtb \
++	kirkwood-linksys-audi.dtb \
+ 	kirkwood-linksys-viper.dtb \
+ 	kirkwood-lschlv2.dtb \
+ 	kirkwood-lsxhl.dtb \
 --- /dev/null
-+++ b/arch/arm/boot/dts/kirkwood-ea3500.dts
-@@ -0,0 +1,160 @@
++++ b/arch/arm/boot/dts/kirkwood-linksys-audi.dts
+@@ -0,0 +1,179 @@
 +/*
-+ * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500
++ * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500
 + *
 + * (c) 2013 Jonas Gorski <jogo at openwrt.org>
 + * (c) 2013 Deutsche Telekom Innovation Laboratories
@@ -31,7 +31,7 @@
 +
 +/ {
 +	model = "Linksys EA3500";
-+	compatible = "linksys,ea3500", "marvell,kirkwood-88f6282", "marvell,kirkwood";
++	compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 +
 +	memory {
 +		device_type = "memory";
@@ -108,7 +108,7 @@
 +		pinctrl-names = "default";
 +
 +		green-power {
-+			label = "ea3500:green:power";
++			label = "audi:green:power";
 +			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
 +		};
 +	};
@@ -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-3.18/180-goflexhome.patch b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
index e54c853..0560073 100644
--- a/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
+++ b/target/linux/kirkwood/patches-3.18/180-goflexhome.patch
@@ -1,9 +1,9 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -122,6 +122,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
+@@ -120,6 +120,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += kirkwood-
+ 	kirkwood-ds411.dtb \
+ 	kirkwood-ds411j.dtb \
  	kirkwood-ds411slim.dtb \
- 	kirkwood-ea3500.dtb \
- 	kirkwood-ea4500.dtb \
 +	kirkwood-goflexhome.dtb \
  	kirkwood-goflexnet.dtb \
  	kirkwood-guruplug-server-plus.dtb \
diff --git a/target/linux/kirkwood/patches-4.3/140-ea4500.patch b/target/linux/kirkwood/patches-4.3/140-ea4500.patch
index 4409394..d1a9726 100644
--- a/target/linux/kirkwood/patches-4.3/140-ea4500.patch
+++ b/target/linux/kirkwood/patches-4.3/140-ea4500.patch
@@ -1,18 +1,18 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -168,6 +168,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
- 	kirkwood-ds411.dtb \
- 	kirkwood-ds411j.dtb \
- 	kirkwood-ds411slim.dtb \
-+	kirkwood-ea4500.dtb \
- 	kirkwood-goflexnet.dtb \
- 	kirkwood-guruplug-server-plus.dtb \
- 	kirkwood-ib62x0.dtb \
+@@ -176,6 +176,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
+ 	kirkwood-is2.dtb \
+ 	kirkwood-km_kirkwood.dtb \
+ 	kirkwood-laplug.dtb \
++	kirkwood-linksys-viper.dtb \
+ 	kirkwood-lschlv2.dtb \
+ 	kirkwood-lswvl.dtb \
+ 	kirkwood-lswxl.dtb \
 --- /dev/null
-+++ b/arch/arm/boot/dts/kirkwood-ea4500.dts
-@@ -0,0 +1,167 @@
++++ b/arch/arm/boot/dts/kirkwood-linksys-viper.dts
+@@ -0,0 +1,187 @@
 +/*
-+ * kirkwood-ea4500.dts - Device Tree file for Linksys EA4500
++ * kirkwood-linksys-viper.dts - Device Tree file for Linksys EA4500
 + *
 + * (c) 2013 Jonas Gorski <jogo at openwrt.org>
 + * (c) 2013 Deutsche Telekom Innovation Laboratories
@@ -29,8 +29,8 @@
 +#include "kirkwood-6282.dtsi"
 +
 +/ {
-+	model = "Linksys EA4500";
-+	compatible = "linksys,ea4500", "marvell,kirkwood-88f6282", "marvell,kirkwood";
++	model = "Linksys E4200v2 / EA4500";
++	compatible = "linksys,viper", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 +
 +	memory {
 +		device_type = "memory";
@@ -111,12 +111,12 @@
 +		pinctrl-names = "default";
 +
 +		white-health {
-+			label = "ea4500:white:health";
++			label = "viper:white:health";
 +			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
 +		};
 +
 +		white-pulse {
-+			label = "ea4500:white:pulse";
++			label = "viper:white:pulse";
 +			gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
 +		};
 +	};
@@ -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..a30ade1 100644
--- a/target/linux/kirkwood/patches-4.3/150-ea3500.patch
+++ b/target/linux/kirkwood/patches-4.3/150-ea3500.patch
@@ -1,18 +1,18 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -168,6 +168,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
- 	kirkwood-ds411.dtb \
- 	kirkwood-ds411j.dtb \
- 	kirkwood-ds411slim.dtb \
-+	kirkwood-ea3500.dtb \
- 	kirkwood-ea4500.dtb \
- 	kirkwood-goflexnet.dtb \
- 	kirkwood-guruplug-server-plus.dtb \
+@@ -176,6 +176,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
+ 	kirkwood-is2.dtb \
+ 	kirkwood-km_kirkwood.dtb \
+ 	kirkwood-laplug.dtb \
++	kirkwood-linksys-audi.dtb \
+ 	kirkwood-linksys-viper.dtb \
+ 	kirkwood-lschlv2.dtb \
+ 	kirkwood-lswvl.dtb \
 --- /dev/null
-+++ b/arch/arm/boot/dts/kirkwood-ea3500.dts
-@@ -0,0 +1,160 @@
++++ b/arch/arm/boot/dts/kirkwood-linksys-audi.dts
+@@ -0,0 +1,179 @@
 +/*
-+ * kirkwood-ea3500.dts - Device Tree file for Linksys EA3500
++ * kirkwood-linksys-audi.dts - Device Tree file for Linksys EA3500
 + *
 + * (c) 2013 Jonas Gorski <jogo at openwrt.org>
 + * (c) 2013 Deutsche Telekom Innovation Laboratories
@@ -31,7 +31,7 @@
 +
 +/ {
 +	model = "Linksys EA3500";
-+	compatible = "linksys,ea3500", "marvell,kirkwood-88f6282", "marvell,kirkwood";
++	compatible = "linksys,audi", "marvell,kirkwood-88f6282", "marvell,kirkwood";
 +
 +	memory {
 +		device_type = "memory";
@@ -108,7 +108,7 @@
 +		pinctrl-names = "default";
 +
 +		green-power {
-+			label = "ea3500:green:power";
++			label = "audi:green:power";
 +			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
 +		};
 +	};
@@ -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/160-goflexhome.patch b/target/linux/kirkwood/patches-4.3/160-goflexhome.patch
index cdecbd1..a4307c7 100644
--- a/target/linux/kirkwood/patches-4.3/160-goflexhome.patch
+++ b/target/linux/kirkwood/patches-4.3/160-goflexhome.patch
@@ -1,9 +1,9 @@
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -170,6 +170,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
+@@ -168,6 +168,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
+ 	kirkwood-ds411.dtb \
+ 	kirkwood-ds411j.dtb \
  	kirkwood-ds411slim.dtb \
- 	kirkwood-ea3500.dtb \
- 	kirkwood-ea4500.dtb \
 +	kirkwood-goflexhome.dtb \
  	kirkwood-goflexnet.dtb \
  	kirkwood-guruplug-server-plus.dtb \
-- 
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