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

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


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/32adbfc789f6113fa6a297de71d36df32fcb8324

commit 32adbfc789f6113fa6a297de71d36df32fcb8324
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Sun Jul 18 19:37:39 2021 +0200

    bmips: 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>
---
 target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts  | 13 ++++++++++++-
 target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts   | 18 +++++++++++++++---
 target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts  | 18 +++++++++++++++---
 target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts     | 15 +++++++++++++--
 target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts | 13 ++++++++++++-
 target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts   | 18 +++++++++++++++---
 6 files changed, 82 insertions(+), 13 deletions(-)

diff --git a/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts b/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts
index 094dca1585..95fda0843c 100644
--- a/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts
+++ b/target/linux/bmips/dts/bcm63168-comtrend-vr-3032u.dts
@@ -44,7 +44,8 @@
 &ethernet {
 	status = "okay";
 
-	mtd-mac-address = <&cferom 0x6a0>;
+	nvmem-cells = <&macaddr_cferom_6a0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &leds {
@@ -224,3 +225,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cferom {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cferom_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};
diff --git a/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts b/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts
index 0a53ece140..a54d632770 100644
--- a/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts
+++ b/target/linux/bmips/dts/bcm6318-comtrend-ar-5315u.dts
@@ -42,8 +42,9 @@
 		pci-bus = <1>;
 		pci-dev = <0>;
 
-		mtd-mac-address = <&cfe 0x6a0>;
-		mtd-mac-address-increment = <1>;
+		nvmem-cells = <&macaddr_cfe_6a0>;
+		nvmem-cell-names = "mac-address";
+		mac-address-increment = <1>;
 
 		brcm,sprom-fixups = <6 0x1c00>,
 				    <65 0x1255>,
@@ -66,7 +67,8 @@
 &ethernet {
 	status = "okay";
 
-	mtd-mac-address = <&cfe 0x6a0>;
+	nvmem-cells = <&macaddr_cfe_6a0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &hsspi {
@@ -243,3 +245,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cfe {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cfe_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};
diff --git a/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts b/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts
index 06fe1f9009..47db0809e1 100644
--- a/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts
+++ b/target/linux/bmips/dts/bcm6328-comtrend-ar-5387un.dts
@@ -34,8 +34,9 @@
 		pci-bus = <1>;
 		pci-dev = <0>;
 
-		mtd-mac-address = <&cfe 0x6a0>;
-		mtd-mac-address-increment = <1>;
+		nvmem-cells = <&macaddr_cfe_6a0>;
+		nvmem-cell-names = "mac-address";
+		mac-address-increment = <1>;
 
 		brcm,sprom-fixups = <2 0x05bb>,
 				    <65 0x1204>,
@@ -71,7 +72,8 @@
 &ethernet {
 	status = "okay";
 
-	mtd-mac-address = <&cfe 0x6a0>;
+	nvmem-cells = <&macaddr_cfe_6a0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &hsspi {
@@ -200,3 +202,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cfe {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cfe_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};
diff --git a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
index 1ec5a71515..6c8b093edf 100644
--- a/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
+++ b/target/linux/bmips/dts/bcm6358-huawei-hg556a-b.dts
@@ -125,8 +125,9 @@
 
 		pci-dev = <1>;
 
-		mtd-mac-address = <&cfe 0x6a0>;
-		mtd-mac-address-increment = <1>;
+		nvmem-cells = <&macaddr_cfe_6a0>;
+		nvmem-cell-names = "mac-address";
+		mac-address-increment = <1>;
 
 		ath,eeprom = <&cal_data 0x1e000>;
 		ath,endian-check;
@@ -187,3 +188,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cfe {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cfe_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};
diff --git a/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts b/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts
index 9e5b1610dc..b99fecaaa6 100644
--- a/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts
+++ b/target/linux/bmips/dts/bcm6362-netgear-dgnd3700-v2.dts
@@ -67,7 +67,8 @@
 &ethernet {
 	status = "okay";
 
-	mtd-mac-address = <&cferom 0x6a0>;
+	nvmem-cells = <&macaddr_cferom_6a0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &leds {
@@ -245,3 +246,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cferom {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cferom_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};
diff --git a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts
index b4d2047cd8..29d8dfd56e 100644
--- a/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts
+++ b/target/linux/bmips/dts/bcm6368-comtrend-vr-3025u.dts
@@ -63,8 +63,9 @@
 		pci-bus = <0>;
 		pci-dev = <1>;
 
-		mtd-mac-address = <&cfe 0x6a0>;
-		mtd-mac-address-increment = <1>;
+		nvmem-cells = <&macaddr_cfe_6a0>;
+		nvmem-cell-names = "mac-address";
+		mac-address-increment = <1>;
 
 		brcm,sprom-fixups = <97 0xfeb3>,
 				    <98 0x1618>,
@@ -82,7 +83,8 @@
 &ethernet {
 	status = "okay";
 
-	mtd-mac-address = <&cfe 0x6a0>;
+	nvmem-cells = <&macaddr_cfe_6a0>;
+	nvmem-cell-names = "mac-address";
 };
 
 &ohci {
@@ -165,3 +167,13 @@
 &usbh {
 	status = "okay";
 };
+
+&cfe {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_cfe_6a0: macaddr at 6a0 {
+		reg = <0x6a0 0x6>;
+	};
+};



More information about the lede-commits mailing list