Skip to content

Commit

Permalink
ramips: fix and clean up D-Link MAC address
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lucky1openwrt authored and hauke committed Feb 22, 2024
1 parent 788122c commit e222c80
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 97 deletions.
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-1935-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-878-r1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
/ {
compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc";
model = "D-Link DIR-882 A1";

aliases {
label-mac-device = &gmac0;
};
};

&leds {
Expand All @@ -27,13 +23,3 @@
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";
};
14 changes: 0 additions & 14 deletions target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
/ {
compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc";
model = "D-Link DIR-882 R1";

aliases {
label-mac-device = &gmac0;
};
};

&leds {
Expand All @@ -27,13 +23,3 @@
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";
};
17 changes: 13 additions & 4 deletions target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/ {
aliases {
label-mac-device = &gmac0;
led-boot = &led_power_orange;
led-failsafe = &led_power_green;
led-running = &led_power_green;
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -95,10 +96,18 @@
};
};

&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 {
Expand Down
14 changes: 5 additions & 9 deletions target/linux/ramips/dts/mt7621_dlink_dir-xx60-a1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@
reg = <0xe000 0x6>;
#nvmem-cell-cells = <1>;
};

macaddr_factory_e006: macaddr@e006 {
reg = <0xe006 0x6>;
};
};
};

Expand Down Expand Up @@ -154,8 +150,8 @@
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 {
Expand All @@ -168,8 +164,8 @@
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 {
Expand All @@ -188,7 +184,7 @@
label = "wan";
phy-handle = <&ethphy4>;

nvmem-cells = <&macaddr_factory_e006>;
nvmem-cells = <&macaddr_factory_e000 3>;
nvmem-cell-names = "mac-address";
};

Expand Down
2 changes: 2 additions & 0 deletions target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
};

macaddr_factory_e000: macaddr@e000 {
compatible = "mac-base";
reg = <0xe000 0x6>;
#nvmem-cell-cells = <1>;
};

macaddr_factory_e006: macaddr@e006 {
Expand Down
2 changes: 2 additions & 0 deletions target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
};

macaddr_factory_e000: macaddr@e000 {
compatible = "mac-base";
reg = <0xe000 0x6>;
#nvmem-cell-cells = <1>;
};

macaddr_factory_e006: macaddr@e006 {
Expand Down

0 comments on commit e222c80

Please sign in to comment.