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@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2021-08-20 14:42:56 +02:00
parent adb3e46616
commit 05ccca031e
7 changed files with 70 additions and 24 deletions

View File

@ -8,23 +8,28 @@
};
gpio-keys {
@@ -69,6 +70,7 @@
gmac0: mac@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@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@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@24 {
+ reg = <0x24 0x6>;
+ };
+
+ macaddr_factory_2a: macaddr@2a {
+ reg = <0x2a 0x6>;
+ };
+};

View File

@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou@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 @@
};
};

View File

@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu <Chuanjia.Liu@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 @@
};
};

View File

@ -22,27 +22,31 @@
memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
@@ -69,6 +77,7 @@
gmac0: mac@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@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@24 {
+ reg = <0x24 0x6>;
+ };
+
+ macaddr_factory_2a: macaddr@2a {
+ reg = <0x2a 0x6>;
+ };
+};

View File

@ -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@b0000 {

View File

@ -42,7 +42,7 @@ Signed-off-by: Xiangsheng Hou <xiangsheng.hou@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 @@
};
};

View File

@ -135,7 +135,7 @@ Signed-off-by: chuanjia.liu <Chuanjia.Liu@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 @@
};
};