[openwrt/openwrt] apm821xx: convert legacy nand partition layout

LEDE Commits lede-commits at lists.infradead.org
Sat Feb 5 05:01:55 PST 2022


chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f095822699cc397f86d2c24616aaaa7f814dc8d9

commit f095822699cc397f86d2c24616aaaa7f814dc8d9
Author: Christian Lamparter <chunkeey at gmail.com>
AuthorDate: Sun Jan 16 20:13:24 2022 +0100

    apm821xx: convert legacy nand partition layout
    
    in order to get nvmem-cells to work on AP and routers
    (Netgears WNDR4700). The nvmem-cell needs to be within
    a fixed-partition dt-node.
    
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 target/linux/apm821xx/dts/apm82181.dtsi         |  3 ---
 target/linux/apm821xx/dts/meraki-mr24.dts       | 24 ++++++++++++++----------
 target/linux/apm821xx/dts/meraki-mx60.dts       | 15 ++++++++++-----
 target/linux/apm821xx/dts/netgear-wndap6x0.dtsi | 17 +++++++++++------
 target/linux/apm821xx/dts/netgear-wndr4700.dts  | 17 ++++++++++-------
 5 files changed, 45 insertions(+), 31 deletions(-)

diff --git a/target/linux/apm821xx/dts/apm82181.dtsi b/target/linux/apm821xx/dts/apm82181.dtsi
index f7c4c65401..5f80467d74 100644
--- a/target/linux/apm821xx/dts/apm82181.dtsi
+++ b/target/linux/apm821xx/dts/apm82181.dtsi
@@ -251,9 +251,6 @@
 						nand-ecc-algo = "hamming";
 						nand-ecc-step-size = <256>;
 						nand-ecc-strength = <1>;
-
-						#address-cells = <1>;
-						#size-cells = <1>;
 					};
 				};
 			};
diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts
index a876e77511..4b43c683e1 100644
--- a/target/linux/apm821xx/dts/meraki-mr24.dts
+++ b/target/linux/apm821xx/dts/meraki-mr24.dts
@@ -38,13 +38,17 @@
 	status = "okay";
 };
 
-&EBC0 {
+&ndfc {
 	/* Ikarem has 32MB of NAND */
-	ndfc at 1,0 {
-		status = "okay";
-		/* 32 MiB NAND Flash */
-		nand {
-			nand-is-boot-medium;
+	status = "okay";
+
+	nand {
+		nand-is-boot-medium;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
 
 			partition at 0 {
 				label = "u-boot";
@@ -59,10 +63,10 @@
 				 * blocks (64KiB) in order to have spares
 				 * around for bad block management
 				 */
-				label = "u-boot-env";
-				reg = <0x00150000 0x00010000>;
-				read-only;
-			};
+					label = "u-boot-env";
+					reg = <0x00150000 0x00010000>;
+					read-only;
+				};
 
 			partition at 160000 {
 				/*
diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts
index 05274e9d42..79e055c2ea 100644
--- a/target/linux/apm821xx/dts/meraki-mx60.dts
+++ b/target/linux/apm821xx/dts/meraki-mx60.dts
@@ -42,12 +42,17 @@
 	dr_mode = "host";
 };
 
-&EBC0 {
+&ndfc {
 	/* Buckminster has 1GiB of NAND */
-	ndfc at 1,0 {
-		status = "okay";
-		nand {
-			nand-is-boot-medium;
+	status = "okay";
+
+	nand {
+		nand-is-boot-medium;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
 
 			partition at 0 {
 				label = "u-boot";
diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi
index c18c73d956..c6f112d240 100644
--- a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi
+++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi
@@ -28,12 +28,17 @@
 	status = "okay";
 };
 
-&EBC0 {
-	ndfc at 1,0 {
-		status = "okay";
-		/* 32 MiB SLC NAND Flash */
-		nand {
-			nand-is-boot-medium;
+&ndfc {
+	status = "okay";
+	/* 32 MiB SLC NAND Flash */
+
+	nand {
+		nand-is-boot-medium;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
 
 			partition at 0 {
 				label = "u-boot";
diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts
index 3f93153d4d..63c96bd82a 100644
--- a/target/linux/apm821xx/dts/netgear-wndr4700.dts
+++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts
@@ -169,13 +169,16 @@
 	dr_mode = "host";
 };
 
-&EBC0 {
-	ndfc: ndfc at 1,0 {
-
-		status = "okay";
-		/* 128 MiB Nand Flash */
-		nand {
-			nand-is-boot-medium;
+&ndfc {
+	status = "okay";
+	/* 128 MiB Nand Flash */
+	nand {
+		nand-is-boot-medium;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
 
 			partition at 0 {
 				label = "uboot";



More information about the lede-commits mailing list