From: Rosen Penev Date: Wed, 11 Mar 2026 05:14:32 +0000 (-0700) Subject: ramips: elecom,wrc-2533ghbk: use nvmem for mac addresses X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beca714ce5d69494038b6d7d034a3265400312fe;p=thirdparty%2Fopenwrt.git ramips: elecom,wrc-2533ghbk: use nvmem for mac addresses Userspace handling is deprecated. Since the u-boot ethaddr variable is quoted, we cannot use it. Use mac-base instead to specify in dts. 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_elecom_wrc-2533ghbk.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi index cdb94dcdc1b..545a2031b8f 100644 --- a/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi +++ b/target/linux/ramips/dts/mt7621_elecom_wrc-2533ghbk.dtsi @@ -12,6 +12,7 @@ led-failsafe = &led_power; led-running = &led_power; led-upgrade = &led_power; + label-mac-device = &gmac1; }; leds { @@ -109,6 +110,12 @@ reg = <0x0 0x4da8>; }; + macaddr_factory_4: mac-address@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + eeprom_factory_8000: eeprom@8000 { reg = <0x8000 0x4da8>; }; @@ -118,10 +125,18 @@ }; }; +&gmac0 { + nvmem-cells = <&eeprom_factory_0 (-1)>; + nvmem-cell-names = "mac-address"; +}; + &gmac1 { status = "okay"; label = "wan"; phy-handle = <ðphy0>; + + nvmem-cells = <&eeprom_factory_0 (-2)>; + nvmem-cell-names = "mac-address"; }; ðphy0 { 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 c16196e1c09..25a8beecfee 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 @@ -263,12 +263,6 @@ ramips_setup_macs() edimax,rg21s) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) ;; - elecom,wrc-2533ghbk2-t|\ - elecom,wrc-2533ghbk-i) - lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) - label_mac=$wan_mac - ;; iodata,wnpr2600g) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) label_mac=$wan_mac