From 12ee46b2f272e8d685276dc8fac0a6df60279e8d Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Mon, 18 May 2020 21:38:00 +0200 Subject: [PATCH] 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 ðernet 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 --- target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts | 3 ++- target/linux/ramips/mt7620/base-files/etc/board.d/02_network | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts index fe72abe0cf..eb19f7da99 100644 --- a/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts +++ b/target/linux/ramips/dts/mt7620a_asus_rt-ac51u.dts @@ -10,6 +10,7 @@ model = "Asus RT-AC51U"; aliases { + label-mac-device = ðernet; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -118,7 +119,7 @@ ðernet { status = "okay"; - mtd-mac-address = <&factory 0x22>; + mtd-mac-address = <&factory 0x28>; mediatek,portmap = "wllll"; }; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 1d37db58c7..5bd2aeb603 100755 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -273,8 +273,7 @@ ramips_setup_macs() label_mac=$(mtd_get_mac_binary factory 0x4) ;; asus,rt-ac51u) - 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)