mediatek: convert mtd-mac-address to nvmem implementation
authorAnsuel Smith <ansuelsmth@gmail.com>
Fri, 2 Apr 2021 21:53:02 +0000 (23:53 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 19 Jul 2021 12:51:22 +0000 (14:51 +0200)
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@gmail.com>
target/linux/mediatek/dts/mt7622-buffalo-wsr-2533dhp2.dts
target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts
target/linux/mediatek/dts/mt7622-linksys-e8450.dts
target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr-ubootmod.dts
target/linux/mediatek/dts/mt7622-ubnt-unifi-6-lr.dts

index 62e2e7f4cb21a7ba319ef7ef05b9e5840717147a..6d77be532b1488255716a88f94b45b7a993b41fa 100644 (file)
 
                phy-connection-type = "2500base-x";
 
-               mtd-mac-address = <&factory 0x4>;
-               mtd-mac-address-increment = <(-1)>;
+               nvmem-cells = <&macaddr_factory_4>;
+               nvmem-cell-names = "mac-address";
+               mac-address-increment = <(-1)>;
 
                fixed-link {
                        speed = <2500>;
 &rtc {
        status = "disabled";
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index d6cadd320c113c1cd3799b5affc59af1e69f6710..9df736eb01e9a996205512fcbe4fa8f927e4fcfb 100644 (file)
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0x7fff4>;
+       nvmem-cells = <&macaddr_factory_7fff4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wan {
-       mtd-mac-address = <&factory 0x7fffa>;
+       nvmem-cells = <&macaddr_factory_7fffa>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_7fff4: macaddr@7fff4 {
+               reg = <0x7fff4 0x6>;
+       };
+
+       macaddr_factory_7fffa: macaddr@7fffa {
+               reg = <0x7fffa 0x6>;
+       };
 };
index b30b5d245525b697ad0a3e19475a4fd515eb5df4..8552dbf1a92b117a4934b4e3761ebea1a8eb1d69 100644 (file)
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0x7fff4>;
+       nvmem-cells = <&macaddr_factory_7fff4>;
+       nvmem-cell-names = "mac-address";
 };
 
 &wan {
-       mtd-mac-address = <&factory 0x7fffa>;
+       nvmem-cells = <&macaddr_factory_7fffa>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_7fff4: macaddr@7fff4 {
+               reg = <0x7fff4 0x6>;
+       };
+
+       macaddr_factory_7fffa: macaddr@7fffa {
+               reg = <0x7fffa 0x6>;
+       };
 };
index b2f741ea3b71aa4f340e3eaf4feb0695b98cc5fa..e573d30912f4660b951d26663d6bc8f3d75c2f4c 100644 (file)
@@ -49,7 +49,8 @@
 
 &wmac {
        mediatek,mtd-eeprom = <&factory 0x0>;
-       mtd-mac-address = <&eeprom 0x0>;
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
        status = "okay";
 };
 
        wifi@0,0 {
                reg = <0x0 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x20000>;
-               mtd-mac-address = <&eeprom 0x6>;
+               nvmem-cells = <&macaddr_eeprom_6>;
+               nvmem-cell-names = "mac-address";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&eeprom 0x0>;
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&eeprom {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_eeprom_0: macaddr@0 {
+               reg = <0x0 0x6>;
+       };
+
+       macaddr_eeprom_6: macaddr@6 {
+               reg = <0x6 0x6>;
+       };
 };
index 8603de392a6a71447ba34dfd4c556c496c97a14d..9b676b43c1bd17602db6a7b4475c8227afb33b3b 100644 (file)
@@ -65,7 +65,8 @@
 
 &wmac {
        mediatek,mtd-eeprom = <&factory 0x0>;
-       mtd-mac-address = <&eeprom 0x0>;
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
        status = "okay";
 };
 
        wifi@0,0 {
                reg = <0x0 0 0 0 0>;
                mediatek,mtd-eeprom = <&factory 0x20000>;
-               mtd-mac-address = <&eeprom 0x6>;
+               nvmem-cells = <&macaddr_eeprom_6>;
+               nvmem-cell-names = "mac-address";
                ieee80211-freq-limit = <5000000 6000000>;
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&eeprom 0x0>;
+       nvmem-cells = <&macaddr_eeprom_0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&eeprom {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_eeprom_0: macaddr@0 {
+               reg = <0x0 0x6>;
+       };
+
+       macaddr_eeprom_6: macaddr@6 {
+               reg = <0x6 0x6>;
+       };
 };