diff --git a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi index 1520aaf5b1..31347723cf 100644 --- a/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi +++ b/target/linux/ramips/dts/mt7621_h3c_tx180x.dtsi @@ -8,6 +8,7 @@ / { aliases { + label-mac-device = &gmac1; led-boot = &led_status_amber; led-failsafe = &led_status_green; led-running = &led_status_green; @@ -52,10 +53,18 @@ }; }; +&gmac0 { + nvmem-cells = <&macaddr_uboot_ethaddr 1>; + nvmem-cell-names = "mac-address"; +}; + &gmac1 { status = "okay"; label = "wan"; phy-handle = <ðphy4>; + + nvmem-cells = <&macaddr_uboot_ethaddr 0>; + nvmem-cell-names = "mac-address"; }; ðphy4 { @@ -84,6 +93,15 @@ partition@80000 { label = "u-boot-env"; reg = <0x0080000 0x0080000>; + + nvmem-layout { + compatible = "u-boot,env"; + env-size = <0x20000>; + + macaddr_uboot_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; + }; }; partition@100000 { diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 18e979df61..493811893b 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -270,13 +270,6 @@ ramips_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac ;; - h3c,tx1800-plus|\ - h3c,tx1801-plus|\ - h3c,tx1806) - label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - lan_mac=$(macaddr_add "$label_mac" 1) - wan_mac=$label_mac - ;; iodata,wnpr2600g) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac