ramips: set WAN address in DTS for ASUS RT-AC51U/RT-AC54U

The location 0x28 in factory partition is the common one used for
ethernet address on this architecture. Despite, it contains the label
MAC address for the devices at hand.

Consequently, this patch moves 0x28 to the &ethernet node in DTS files
(setting the WAN MAC address there) and sets up the lan_mac from 0x22
in 02_network. As a benefit, this allows to use label-mac-device in
DTS instead of ucidef_set_label_macaddr.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
master
Adrian Schmutzler 2020-05-18 21:38:00 +02:00
parent a1f0fd8cba
commit be9eab9bca
3 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@
model = "Asus RT-AC51U";
aliases {
label-mac-device = &ethernet;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
@ -37,7 +38,7 @@
};
&ethernet {
mtd-mac-address = <&factory 0x22>;
mtd-mac-address = <&factory 0x28>;
};
&state_default {

View File

@ -8,6 +8,7 @@
model = "Asus RT-AC54U";
aliases {
label-mac-device = &ethernet;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
@ -38,7 +39,7 @@
};
&ethernet {
mtd-mac-address = <&factory 0x22>;
mtd-mac-address = <&factory 0x28>;
};
&state_default {

View File

@ -273,8 +273,7 @@ ramips_setup_macs()
;;
asus,rt-ac51u|\
asus,rt-ac54u)
wan_mac=$(mtd_get_mac_binary factory 0x28)
label_mac=$wan_mac
lan_mac=$(mtd_get_mac_binary factory 0x22)
;;
dlink,dch-m225)
lan_mac=$(mtd_get_mac_ascii factory lanmac)