ramips: convert mtd-mac-address to nvmem for D-Link DIR-8xx
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 18 Aug 2021 23:16:39 +0000 (01:16 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Fri, 20 Aug 2021 16:10:48 +0000 (18:10 +0200)
Convert this series by moving the definitions to the individual
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/dts/mt7621_dlink_dir-853-a3.dts
target/linux/ramips/dts/mt7621_dlink_dir-853-r1.dts
target/linux/ramips/dts/mt7621_dlink_dir-860l-b1.dts
target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi

index e866fb12427af33f394fbb6bf05c80dca2214f98..49d0c050f59f9a9f7320caf88b2ecba0cba8455a 100644 (file)
@@ -11,6 +11,7 @@
 
        aliases {
                label-mac-device = &gmac0;
+
                led-boot = &led_power_orange;
                led-failsafe = &led_power_blue;
                led-running = &led_power_blue;
index 09e46b011e39c3dca7f292983605e76a1b59517c..c0ad172939aba804ac5bf82e38f191e882098638 100644 (file)
@@ -13,6 +13,7 @@
 
        aliases {
                label-mac-device = &wan;
+
                led-boot = &led_power_orange;
                led-failsafe = &led_power_blue;
                led-running = &led_power_blue;
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
+
                mediatek,mtd-eeprom = <&factory 0x0>;
+
                /* 5 GHz (phy1) does not take the address from calibration data,
                   but setting it manually here works */
-               mtd-mac-address = <&factory 0x4>;
+               nvmem-cells = <&macaddr_factory_4>;
+               nvmem-cell-names = "mac-address";
        };
 };
 
 &gmac0 {
-       mtd-mac-address = <&factory 0x4>;
-       mtd-mac-address-increment = <(-1)>;
+       nvmem-cells = <&macaddr_factory_4>;
+       nvmem-cell-names = "mac-address";
+       mac-address-increment = <(-1)>;
 };
 
 &switch0 {
                wan: port@4 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&factory 0x4>;
-                       mtd-mac-address-increment = <(-2)>;
+                       nvmem-cells = <&macaddr_factory_4>;
+                       nvmem-cell-names = "mac-address";
+                       mac-address-increment = <(-2)>;
                };
        };
 };
                function = "gpio";
        };
 };
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_4: macaddr@4 {
+               reg = <0x4 0x6>;
+       };
+};
index 26f142dcffd2f14cb14d90c28fb7023dc9caae72..7a48a931e71e346617980eb88207e9ecabd1ff64 100644 (file)
@@ -8,11 +8,12 @@
        model = "D-Link DIR-860L B1";
 
        aliases {
+               label-mac-device = &gmac0;
+
                led-boot = &led_power_green;
                led-failsafe = &led_power_green;
                led-running = &led_power_green;
                led-upgrade = &led_power_green;
-               label-mac-device = &gmac0;
        };
 
        leds {
index e02eb9eebf375ac06a585c1246997fe3c650637e..0f09fae246005a9775fce7e494df5e9144983dcf 100644 (file)
@@ -6,4 +6,32 @@
 / {
        compatible = "dlink,dir-867-a1", "mediatek,mt7621-soc";
        model = "D-Link DIR-867 A1";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
+};
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
 };
index 1f1d5824f2f0f120c2805e102e47e540c57abe05..9c73ffa12365e180e951786b19cb0aa45b5987c8 100644 (file)
@@ -6,4 +6,32 @@
 / {
        compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc";
        model = "D-Link DIR-878 A1";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
+};
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
 };
index 01739fc258c03654a47bc104fad3372e7e016b6d..3db056f68f49a74c85cc73420fae0e1a076dd43a 100644 (file)
@@ -6,6 +6,10 @@
 / {
        compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc";
        model = "D-Link DIR-882 A1";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
 };
 
 &leds {
                linux,default-trigger = "usbport";
        };
 };
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
+};
index 9b0cd8e7be8fae46abec6a7de500678c80696c2a..6cfa28b7cf215bad742a76f618b47e94833786d3 100644 (file)
@@ -6,6 +6,10 @@
 / {
        compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc";
        model = "D-Link DIR-882 R1";
+
+       aliases {
+               label-mac-device = &gmac0;
+       };
 };
 
 &leds {
                linux,default-trigger = "usbport";
        };
 };
+
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000>;
+       nvmem-cell-names = "mac-address";
+};
+
+&wan {
+       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cell-names = "mac-address";
+};
+
+&factory {
+       compatible = "nvmem-cells";
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       macaddr_factory_e000: macaddr@e000 {
+               reg = <0xe000 0x6>;
+       };
+
+       macaddr_factory_e006: macaddr@e006 {
+               reg = <0xe006 0x6>;
+       };
+};
index 7ab0e8bd5d0fa82bbeb0f26c1659e8b6ed8f082d..556ca8b0037df189cfbd39dc87112c74dbc33572 100644 (file)
@@ -7,7 +7,6 @@
 
 / {
        aliases {
-               label-mac-device = &gmac0;
                led-boot = &led_power_orange;
                led-failsafe = &led_power_green;
                led-running = &led_power_green;
        };
 };
 
-&gmac0 {
-       mtd-mac-address = <&factory 0xe000>;
-};
-
 &switch0 {
        ports {
                port@0 {
                        label = "lan1";
                };
 
-               port@4 {
+               wan: port@4 {
                        status = "okay";
                        label = "wan";
-                       mtd-mac-address = <&factory 0xe006>;
                };
        };
 };