[openwrt/openwrt] mpc85xx: convert mtd-mac-address to nvmem implementation

LEDE Commits lede-commits at lists.infradead.org
Mon Jul 19 05:51:51 PDT 2021


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8ec21d6bb2101d801f1ee915d1cd0412c6585078

commit 8ec21d6bb2101d801f1ee915d1cd0412c6585078
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Fri Apr 2 23:52:21 2021 +0200

    mpc85xx: convert mtd-mac-address to nvmem implementation
    
    Define nvmem-cells and convert mtd-mac-address to nvmem implementation.
    The conversion is done with an automated script.
    
    Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 .../mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts   | 16 ++++++++++++++--
 .../files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts        | 13 ++++++++++++-
 2 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
index 10bb353683..97f5b7c7b7 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
@@ -165,7 +165,8 @@
 			status = "okay";
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
-			mtd-mac-address = <&hwinfo 0>;
+			nvmem-cells = <&macaddr_hwinfo_0>;
+			nvmem-cell-names = "mac-address";
 		};
 
 		enet1: ethernet at b1000 {
@@ -176,7 +177,8 @@
 			status = "okay";
 			phy-handle = <&phy1>;
 			phy-connection-type = "rgmii-id";
-			mtd-mac-address = <&hwinfo 0>;
+			nvmem-cells = <&macaddr_hwinfo_0>;
+			nvmem-cell-names = "mac-address";
 			mac-address-increment = <1>;
 		};
 
@@ -234,3 +236,13 @@
 	};
 };
 /include/ "fsl/p1020si-post.dtsi"
+
+&hwinfo {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_hwinfo_0: macaddr at 0 {
+		reg = <0x0 0x6>;
+	};
+};
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 29b49a9357..1976b4af96 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -119,7 +119,8 @@
 		enet0: ethernet at b0000 {
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
-			mtd-mac-address = <&uboot 0x4fc00>;
+			nvmem-cells = <&macaddr_uboot_4fc00>;
+			nvmem-cell-names = "mac-address";
 		};
 
 		enet1: ethernet at b1000 {
@@ -290,3 +291,13 @@
 		/delete-node/ crypto at 30000; /* Pulled in by p1010si-post */
 	};
 };
+
+&uboot {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_uboot_4fc00: macaddr at 4fc00 {
+		reg = <0x4fc00 0x6>;
+	};
+};



More information about the lede-commits mailing list