From: Tomasz Maciej Nowak Date: Mon, 4 May 2026 17:48:39 +0000 (+0200) Subject: ath79: wlr-7100: fix MAC assignment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7f5fb4381e924e29cce33db14dab9d89ad8ecd6;p=thirdparty%2Fopenwrt.git ath79: wlr-7100: fix MAC assignment Partially revert 5e3a602def72. Unfortunately the ethaddr value in U-Boot environment is enclosed in double quotes which makes it longer than ETH_ALEN, thus nvmem returns EINVAL. Switch back to handling the MAC addresses in user space. Fixes: 5e3a602def72 ("ath79: sitecom,wlrx100: use nvmem") Reviewed-by: Rosen Penev Signed-off-by: Tomasz Maciej Nowak --- diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts index da5eba26de9..a8589b769f7 100644 --- a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts +++ b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts @@ -11,7 +11,6 @@ compatible = "sitecom,wlr-7100", "qca,ar9344"; aliases { - label-mac-device = ð0; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -59,9 +58,6 @@ phy-mode = "rgmii"; phy-handle = <&phy0>; - nvmem-cells = <&macaddr_uboot_ethaddr 0>; - nvmem-cell-names = "mac-address"; - gmac-config { device = <&gmac>; rgmii-gmac0 = <1>; @@ -93,8 +89,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0x0000 0 0 0 0>; - nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>; - nvmem-cell-names = "calibration", "mac-address"; + nvmem-cells = <&cal_art_5000>; + nvmem-cell-names = "calibration"; }; }; @@ -121,7 +117,7 @@ read-only; }; - uenv: partition@30000 { + partition@30000 { label = "u-boot-env"; reg = <0x030000 0x010000>; read-only; @@ -129,10 +125,6 @@ nvmem-layout { compatible = "u-boot,env"; env-size = <0x1000>; - - macaddr_uboot_ethaddr: ethaddr { - #nvmem-cell-cells = <1>; - }; }; }; @@ -188,8 +180,8 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>; - nvmem-cell-names = "calibration", "mac-address"; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; led { led-sources = <14>; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 161ecbbbc67..ee8fe2edd11 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -806,7 +806,11 @@ ath79_setup_macs() lan_mac=$(mtd_get_mac_binary board-data 0x807E) label_mac=$lan_mac ;; - sitecom,wlr-7100|\ + sitecom,wlr-7100) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) + label_mac=$lan_mac + ;; sitecom,wlr-8100) wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr) ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 0ef322e898e..cde032c0fd2 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -103,6 +103,11 @@ case "$board" in siemens,ws-ap3610) mtd_get_mac_ascii cfg1 RADIOADDR${PHYNBR} > /sys${DEVPATH}/macaddress ;; + sitecom,wlr-7100) + [ "$PHYNBR" -eq 0 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" -eq 1 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" > /sys${DEVPATH}/macaddress tplink,deco-s4-v2) base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) [ "$PHYNBR" -eq 0 ] && \