ramips: fix and clean up D-Link MAC address
authorAlan Luck <luckyhome2008@gmail.com>
Thu, 15 Feb 2024 05:31:12 +0000 (16:31 +1100)
committerHauke Mehrtens <hauke@hauke-m.de>
Thu, 22 Feb 2024 21:53:30 +0000 (22:53 +0100)
add back WIFI eprom addresses pointer in mt7621_dlink_dir-xx60-a1.dtsi
Change MAC address pointer from factory_e006 to factory_e000 + 3
same as used in D-link firmware 1.11 DIR-1960-A1
DIR-1960-A1,DIR-2640-A1,DIR-2660-A1,DIR-3060-A1

Clean-up MAC addresses in D-Link NOR devices DTS's
Change WIFI MAC Addressees to the same as NAND cousins macaddr_factory_e000 + ?
as later devices don't have the MAC address in factory configuration
same as used in D-Link firmware 1.30 DIR-878-A1
DIR-867-A1,DIR-878-A1,DIR-878-R1,DIR-882-A1,DIR-882-R1,DIR-1935-A1

* D-link software differs between source of wan address

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.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-878-r1.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
target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi
target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi
target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi

index 0ce07141a377e1db4eea0819230658427a8415fc..60b5b35621ee25dbe70ef2825aa08eaeff5b5c4a 100644 (file)
@@ -6,18 +6,4 @@
 / {
        compatible = "dlink,dir-1935-a1", "mediatek,mt7621-soc";
        model = "D-Link DIR-1935 A1";
-
-       aliases {
-               label-mac-device = &gmac0;
-       };
-};
-
-&gmac0 {
-       nvmem-cells = <&macaddr_factory_e000>;
-       nvmem-cell-names = "mac-address";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
 };
index ab5a110333507b14e21f7a42c9590a743aa74961..e02eb9eebf375ac06a585c1246997fe3c650637e 100644 (file)
@@ -6,18 +6,4 @@
 / {
        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";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
 };
index f9ed0ddcefdfd6b9ddc092675e4a5002d8eee3a6..1f1d5824f2f0f120c2805e102e47e540c57abe05 100644 (file)
@@ -6,18 +6,4 @@
 / {
        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";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
 };
index 1a17dddc115bfebd56d3156aea5a146cb77e0415..0bacd6569f8e37a7ff5cd053be16664f989f805b 100644 (file)
@@ -6,18 +6,4 @@
 / {
        compatible = "dlink,dir-878-r1", "mediatek,mt7621-soc";
        model = "D-Link DIR-878 R1";
-
-       aliases {
-               label-mac-device = &gmac0;
-       };
-};
-
-&gmac0 {
-       nvmem-cells = <&macaddr_factory_e000>;
-       nvmem-cell-names = "mac-address";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
 };
index 2f45eda02d282ad0caeae68c24dc230bf980ae23..01739fc258c03654a47bc104fad3372e7e016b6d 100644 (file)
@@ -6,10 +6,6 @@
 / {
        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";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
-};
index 019ad7edcf30a7aa9058d68d27eef2f991ce1d37..9b0cd8e7be8fae46abec6a7de500678c80696c2a 100644 (file)
@@ -6,10 +6,6 @@
 / {
        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";
-};
-
-&gmac1 {
-       nvmem-cells = <&macaddr_factory_e006>;
-       nvmem-cell-names = "mac-address";
-};
index b94a0784feb6341def65509f26a717fffc22aca3..11d673dc8719159fd460e509e9dc388490fec218 100644 (file)
@@ -8,6 +8,7 @@
 
 / {
        aliases {
+               label-mac-device = &gmac0;
                led-boot = &led_power_orange;
                led-failsafe = &led_power_green;
                led-running = &led_power_green;
@@ -71,8 +72,8 @@
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               nvmem-cells = <&eeprom_factory_0>;
-               nvmem-cell-names = "eeprom";
+               nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <2400000 2500000>;
 
                led {
@@ -85,8 +86,8 @@
        wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               nvmem-cells = <&eeprom_factory_8000>;
-               nvmem-cell-names = "eeprom";
+               nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 2>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <5000000 6000000>;
 
                led {
        };
 };
 
+&gmac0 {
+       nvmem-cells = <&macaddr_factory_e000 0>;
+       nvmem-cell-names = "mac-address";
+};
+
 &gmac1 {
        status = "okay";
        label = "wan";
        phy-handle = <&ethphy4>;
+
+       nvmem-cells = <&macaddr_factory_e006 0>;
+       nvmem-cell-names = "mac-address";
 };
 
 &mdio {
index ddc3e1ad30afa30f2ffecb033674a81670dd4a74..7b7228b8c36d6a0aa707a0af4c4aa70ec6c98588 100644 (file)
                                        reg = <0xe000 0x6>;
                                        #nvmem-cell-cells = <1>;
                                };
-
-                               macaddr_factory_e006: macaddr@e006 {
-                                       reg = <0xe006 0x6>;
-                               };
                        };
                };
 
        wifi0: wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               nvmem-cells = <&macaddr_factory_e000 1>;
-               nvmem-cell-names = "eeprom";
+               nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 1>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <2400000 2500000>;
 
                led {
        wifi1: wifi@0,0 {
                compatible = "mediatek,mt76";
                reg = <0x0000 0 0 0 0>;
-               nvmem-cells = <&macaddr_factory_e000 2>;
-               nvmem-cell-names = "eeprom";
+               nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 2>;
+               nvmem-cell-names = "eeprom", "mac-address";
                ieee80211-freq-limit = <5000000 6000000>;
 
                led {
        label = "wan";
        phy-handle = <&ethphy4>;
 
-       nvmem-cells = <&macaddr_factory_e006>;
+       nvmem-cells = <&macaddr_factory_e000 3>;
        nvmem-cell-names = "mac-address";
 };
 
index ea6b9f23e8e3e5f797c744ad1532927ecc93b307..96a6b286fe6c72b01d3ec45c330623b1d2bedb2a 100644 (file)
@@ -44,7 +44,9 @@
                                        };
 
                                        macaddr_factory_e000: macaddr@e000 {
+                                               compatible = "mac-base";
                                                reg = <0xe000 0x6>;
+                                               #nvmem-cell-cells = <1>;
                                        };
 
                                        macaddr_factory_e006: macaddr@e006 {
index dd13e7aeebb1ea25d59dfbf750d510c2831d900a..6d77044aa45d6eea57a140aa26e6d8c44c53dfee 100644 (file)
@@ -50,7 +50,9 @@
                                        };
 
                                        macaddr_factory_e000: macaddr@e000 {
+                                               compatible = "mac-base";
                                                reg = <0xe000 0x6>;
+                                               #nvmem-cell-cells = <1>;
                                        };
 
                                        macaddr_factory_e006: macaddr@e006 {