[openwrt/openwrt] mediatek: convert mtd-mac-address to nvmem for MT7629 RFB

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


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/05ccca031e1654d5cdff912dd7276cca40d37e44

commit 05ccca031e1654d5cdff912dd7276cca40d37e44
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Fri Aug 20 14:42:56 2021 +0200

    mediatek: convert mtd-mac-address to nvmem for MT7629 RFB
    
    This conversion appears to have been overlooked since it's in a
    kernel patch.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../patches-5.10/101-dts-update-mt7629-rfb.patch   | 39 +++++++++++++++----
 .../130-dts-mt7629-add-snand-support.patch         |  2 +-
 ...-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch |  2 +-
 .../patches-5.4/0005-dts-mt7629-add-gsw.patch      | 45 ++++++++++++++++------
 ...010-dts-mt7629-rfb-fix-firmware-partition.patch |  2 +-
 .../0307-dts-mt7629-add-snand-support.patch        |  2 +-
 ...-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch |  2 +-
 7 files changed, 70 insertions(+), 24 deletions(-)

diff --git a/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch b/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch
index 8d3e283315..254b5f9eb7 100644
--- a/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch
+++ b/target/linux/mediatek/patches-5.10/101-dts-update-mt7629-rfb.patch
@@ -8,23 +8,28 @@
  	};
  
  	gpio-keys {
-@@ -69,6 +70,7 @@
- 	gmac0: mac at 0 {
+@@ -70,6 +71,10 @@
  		compatible = "mediatek,eth-mac";
  		reg = <0>;
-+		mtd-mac-address = <&factory 0x2a>;
  		phy-mode = "2500base-x";
++
++		nvmem-cells = <&macaddr_factory_2a>;
++		nvmem-cell-names = "mac-address";
++
  		fixed-link {
  			speed = <2500>;
-@@ -80,6 +82,7 @@
- 	gmac1: mac at 1 {
- 		compatible = "mediatek,eth-mac";
+ 			full-duplex;
+@@ -82,6 +87,9 @@
  		reg = <1>;
-+		mtd-mac-address = <&factory 0x24>;
  		phy-mode = "gmii";
  		phy-handle = <&phy0>;
++
++		nvmem-cells = <&macaddr_factory_24>;
++		nvmem-cell-names = "mac-address";
  	};
-@@ -133,8 +136,9 @@
+ 
+ 	mdio: mdio-bus {
+@@ -133,8 +141,9 @@
  			};
  
  			partition at b0000 {
@@ -35,3 +40,21 @@
  			};
  		};
  	};
+@@ -272,3 +281,17 @@
+ 	pinctrl-0 = <&watchdog_pins>;
+ 	status = "okay";
+ };
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	macaddr_factory_24: macaddr at 24 {
++		reg = <0x24 0x6>;
++	};
++
++	macaddr_factory_2a: macaddr at 2a {
++		reg = <0x2a 0x6>;
++	};
++};
diff --git a/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch b/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch
index 479694b400..8febc65d1b 100644
--- a/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch
+++ b/target/linux/mediatek/patches-5.10/130-dts-mt7629-add-snand-support.patch
@@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou at mediatek.com>
  				     "mediatek,mt7622-spi";
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -249,6 +249,52 @@
+@@ -254,6 +254,52 @@
  	};
  };
  
diff --git a/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch b/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
index 799cc31ab7..252ef080f5 100644
--- a/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
+++ b/target/linux/mediatek/patches-5.10/603-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
@@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu <Chuanjia.Liu at mediatek.com>
 
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -144,9 +144,10 @@
+@@ -149,9 +149,10 @@
  	};
  };
  
diff --git a/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch b/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch
index 773a69f052..4028bad4df 100644
--- a/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch
+++ b/target/linux/mediatek/patches-5.4/0005-dts-mt7629-add-gsw.patch
@@ -22,27 +22,31 @@
  	memory at 40000000 {
  		device_type = "memory";
  		reg = <0x40000000 0x10000000>;
-@@ -69,6 +77,7 @@
- 	gmac0: mac at 0 {
+@@ -70,6 +78,10 @@
  		compatible = "mediatek,eth-mac";
  		reg = <0>;
-+		mtd-mac-address = <&factory 0x2a>;
  		phy-mode = "2500base-x";
++
++		nvmem-cells = <&macaddr_factory_2a>;
++		nvmem-cell-names = "mac-address";
++
  		fixed-link {
  			speed = <2500>;
-@@ -80,6 +89,7 @@
- 	gmac1: mac at 1 {
- 		compatible = "mediatek,eth-mac";
+ 			full-duplex;
+@@ -82,6 +94,9 @@
  		reg = <1>;
-+		mtd-mac-address = <&factory 0x24>;
  		phy-mode = "gmii";
  		phy-handle = <&phy0>;
++
++		nvmem-cells = <&macaddr_factory_24>;
++		nvmem-cell-names = "mac-address";
  	};
-@@ -93,6 +103,26 @@
- 		};
+ 
+ 	mdio: mdio-bus {
+@@ -94,6 +109,26 @@
  	};
  };
-+
+ 
 +&gsw {
 +	mediatek,mdio = <&mdio>;
 +	mediatek,portmap = "llllw";
@@ -62,6 +66,25 @@
 +		};
 +	};
 +};
- 
++
  &i2c {
  	pinctrl-names = "default";
+ 	pinctrl-0 = <&i2c_pins>;
+@@ -272,3 +307,17 @@
+ 	pinctrl-0 = <&watchdog_pins>;
+ 	status = "okay";
+ };
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++
++	macaddr_factory_24: macaddr at 24 {
++		reg = <0x24 0x6>;
++	};
++
++	macaddr_factory_2a: macaddr at 2a {
++		reg = <0x2a 0x6>;
++	};
++};
diff --git a/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch b/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch
index 5d0a19ed4c..2c48e5706f 100644
--- a/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch
+++ b/target/linux/mediatek/patches-5.4/0010-dts-mt7629-rfb-fix-firmware-partition.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -163,8 +163,9 @@
+@@ -168,8 +168,9 @@
  			};
  
  			partition at b0000 {
diff --git a/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch b/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch
index 753c1117b9..233face4c5 100644
--- a/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch
+++ b/target/linux/mediatek/patches-5.4/0307-dts-mt7629-add-snand-support.patch
@@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou at mediatek.com>
  				     "mediatek,mt7622-spi";
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -276,6 +276,52 @@
+@@ -281,6 +281,52 @@
  	};
  };
  
diff --git a/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
index b20e1fce6c..f166aa75de 100644
--- a/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
+++ b/target/linux/mediatek/patches-5.4/0994-ARM-dts-mediatek-Update-mt7629-PCIe-node.patch
@@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu <Chuanjia.Liu at mediatek.com>
 
 --- a/arch/arm/boot/dts/mt7629-rfb.dts
 +++ b/arch/arm/boot/dts/mt7629-rfb.dts
-@@ -171,9 +171,10 @@
+@@ -176,9 +176,10 @@
  	};
  };
  



More information about the lede-commits mailing list