ramips: set WAN address in DTS for ASUS RT-AC51U/RT-AC54U
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 18 May 2020 19:38:00 +0000 (21:38 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 18 May 2020 19:51:06 +0000 (21:51 +0200)
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>
target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts
target/linux/ramips/dts/mt7620a_asus_rt-ac54u.dts
target/linux/ramips/mt7620/base-files/etc/board.d/02_network

index 1dd0e5cfe0006b4c3d2aae68c1c8b2cdfbe1d55b..eccbdee717a98e7384cd90e413e83f7197bf14f4 100644 (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 {
index 09e9b780de1a2ad8128e9673498dbe2b66162704..f7e64994d8c7923368296a9b1f725ace6bb6b6d8 100644 (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 {
index 417d3d02718e4885d472aa77268fdd2d3e167bc8..b780d48179457a871fd34e130fde1ecae55364fd 100755 (executable)
@@ -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)