ramips: add eth0 MAC address for Edimax RG21S
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 17 Dec 2019 12:43:25 +0000 (13:43 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Sun, 22 Dec 2019 00:20:33 +0000 (01:20 +0100)
So far, lan/wan MAC address for Edimax RG21S are only read using
mtd_get_mac_ascii, so eth0.1 and eth0.2 addresses are set, but
eth0 address is random. Since the device's LAN address is the same
as for 2.4 GHz, though, this patch set's the eth0 address based
on the 2.4 GHz one, which can be extracted by mtd-mac-address.

This will also allow to move the label MAC address setup to DT.

The setup of lan_mac and wan_mac are kept in 02_network, so those
locations are still in use, too.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/dts/mt7621_edimax_rg21s.dts
target/linux/ramips/mt7621/base-files/etc/board.d/02_network

index be38beef12c1f77eb1f73faf04bf3a8d9b87fa45..f1adf38e3eb04e17fd5d7b8760bbd53a86e58861 100644 (file)
@@ -15,6 +15,7 @@
                led-failsafe = &led_power;
                led-running = &led_power;
                led-upgrade = &led_power;
+               label-mac-device = &ethernet;
        };
 
        chosen {
 };
 
 &ethernet {
+       mtd-mac-address = <&factory 0x4>;
+
        mediatek,portmap = "wllll";
        port@5 {
                status = "disabled";
index aad9a60bfe4207faa4cd9a5111af1df39dc084be..5c6b5659cb719c992ddae658d8d3ae1504abed1f 100755 (executable)
@@ -201,7 +201,6 @@ ramips_setup_macs()
        edimax,rg21s)
                lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
                wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
-               label_mac=$(mtd_get_mac_binary factory 0x4)
                ;;
        hiwifi,hc5962)
                lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")