From d7178cdd6ea5badfdce8686b27fd6a3ab575a9cd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Jun 2024 16:25:24 -0700 Subject: [PATCH] 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 --- .../linux/ramips/dts/mt7621_edimax_rx21s.dtsi | 19 +++++++++++++++++++ .../mt7621/base-files/etc/board.d/02_network | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi b/target/linux/ramips/dts/mt7621_edimax_rx21s.dtsi index 8e7652cac7..3a235070bf 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 c6e440b8e9..c16196e1c0 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|\