From: Rosen Penev Date: Sun, 16 Jun 2024 23:25:24 +0000 (-0700) Subject: ramips: edimax,rx21s: use nvmem for ethaddr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7178cdd6ea5badfdce8686b27fd6a3ab575a9cd;p=thirdparty%2Fopenwrt.git ramips: edimax,rx21s: use nvmem for ethaddr Userspace handling is deprecated. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/14182 Signed-off-by: Robert Marko --- diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 8e7652cac7e..3a235070bf3 100644 --- a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi +++ b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi @@ -78,6 +78,13 @@ label = "u-boot-env"; reg = <0x30000 0x10000>; read-only; + + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_uboot_ethaddr: ethaddr { + }; + }; }; partition@40000 { @@ -160,21 +167,33 @@ port@1 { status = "okay"; label = "lan4"; + + nvmem-cells = <&macaddr_uboot_ethaddr>; + nvmem-cell-names = "mac-address"; }; port@2 { status = "okay"; label = "lan3"; + + nvmem-cells = <&macaddr_uboot_ethaddr>; + nvmem-cell-names = "mac-address"; }; port@3 { status = "okay"; label = "lan2"; + + nvmem-cells = <&macaddr_uboot_ethaddr>; + nvmem-cell-names = "mac-address"; }; port@4 { status = "okay"; label = "lan1"; + + nvmem-cells = <&macaddr_uboot_ethaddr>; + nvmem-cell-names = "mac-address"; }; }; }; 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 c6e440b8e9e..c16196e1c09 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 @@ -261,7 +261,6 @@ ramips_setup_macs() ;; edimax,ra21s|\ edimax,rg21s) - lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) ;; elecom,wrc-2533ghbk2-t|\