[openwrt/openwrt] ramips: convert mtd-mac-address to nvmem for UniElec devices

LEDE Commits lede-commits at lists.infradead.org
Fri Aug 20 09:14:17 PDT 2021


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8a78d6129975bb6faf168c5b51c05186e9f90856

commit 8a78d6129975bb6faf168c5b51c05186e9f90856
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Fri Aug 20 00:18:12 2021 +0200

    ramips: convert mtd-mac-address to nvmem for UniElec devices
    
    Convert this series by moving the definitions to the individual
    devices.
    
    Now all devices on ramips are converted.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../ramips/dts/mt7621_unielec_u7621-01-16m.dts      | 21 +++++++++++++++++++++
 .../linux/ramips/dts/mt7621_unielec_u7621-01.dtsi   |  8 +-------
 .../ramips/dts/mt7621_unielec_u7621-06-16m.dts      | 21 +++++++++++++++++++++
 .../ramips/dts/mt7621_unielec_u7621-06-64m.dts      | 21 +++++++++++++++++++++
 .../linux/ramips/dts/mt7621_unielec_u7621-06.dtsi   |  8 +-------
 .../ramips/dts/mt7628an_unielec_u7628-01-16m.dts    | 15 +++++++++++++++
 .../linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi |  4 ----
 7 files changed, 80 insertions(+), 18 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts
index d063f08711..84172cdd17 100644
--- a/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts
+++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01-16m.dts
@@ -46,3 +46,24 @@
 		};
 	};
 };
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&wan {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_e000: macaddr at e000 {
+		reg = <0xe000 0x6>;
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi
index b9b16fbb4b..1d070c7909 100644
--- a/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi
+++ b/target/linux/ramips/dts/mt7621_unielec_u7621-01.dtsi
@@ -72,17 +72,11 @@
 	};
 };
 
-&gmac0 {
-	mtd-mac-address = <&factory 0xe000>;
-};
-
 &switch0 {
 	ports {
-		port at 0 {
+		wan: port at 0 {
 			status = "okay";
 			label = "wan";
-			mtd-mac-address = <&factory 0xe000>;
-			mac-address-increment = <1>;
 		};
 
 		port at 1 {
diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts
index e9789cff5d..41aa2dce5e 100644
--- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts
+++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-16m.dts
@@ -51,3 +51,24 @@
 		};
 	};
 };
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&wan {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_e000: macaddr at e000 {
+		reg = <0xe000 0x6>;
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts
index 74e4d6625b..a66969a803 100644
--- a/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts
+++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06-64m.dts
@@ -52,3 +52,24 @@
 		};
 	};
 };
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&wan {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+	mac-address-increment = <1>;
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_e000: macaddr at e000 {
+		reg = <0xe000 0x6>;
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi
index 29e6251721..8dad53812f 100644
--- a/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi
+++ b/target/linux/ramips/dts/mt7621_unielec_u7621-06.dtsi
@@ -73,10 +73,6 @@
 	status = "okay";
 };
 
-&gmac0 {
-	mtd-mac-address = <&factory 0xe000>;
-};
-
 &switch0 {
 	ports {
 		port at 0 {
@@ -99,11 +95,9 @@
 			label = "lan4";
 		};
 
-		port at 4 {
+		wan: port at 4 {
 			status = "okay";
 			label = "wan";
-			mtd-mac-address = <&factory 0xe000>;
-			mac-address-increment = <1>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts
index c25a31f0ab..8037b3a304 100644
--- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts
+++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01-16m.dts
@@ -51,3 +51,18 @@
 		};
 	};
 };
+
+&ethernet {
+	nvmem-cells = <&macaddr_factory_28>;
+	nvmem-cell-names = "mac-address";
+};
+
+&factory {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_factory_28: macaddr at 28 {
+		reg = <0x28 0x6>;
+	};
+};
diff --git a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi
index 805d5debf5..f25e28abd8 100644
--- a/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi
+++ b/target/linux/ramips/dts/mt7628an_unielec_u7628-01.dtsi
@@ -85,10 +85,6 @@
 	status = "okay";
 };
 
-&ethernet {
-	mtd-mac-address = <&factory 0x28>;
-};
-
 &wmac {
 	status = "okay";
 



More information about the lede-commits mailing list