diff options
| author | Tomasz Maciej Nowak | 2026-05-04 17:48:39 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-05-13 22:42:06 +0000 |
| commit | 510cf4738669ad421bfd81c262bfd1e3e53127fd (patch) | |
| tree | fbeeae0de4bc89cdefe837c850399221a1f0b757 | |
| parent | ca43162854e7055afdadd0b7db3b44dcfd02a504 (diff) | |
| download | openwrt-510cf4738669ad421bfd81c262bfd1e3e53127fd.tar.gz | |
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 <rosenp@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
(cherry picked from commit a7f5fb4381e924e29cce33db14dab9d89ad8ecd6)
3 files changed, 15 insertions, 14 deletions
diff --git a/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts b/target/linux/ath79/dts/ar1022_sitecom_wlr-7100.dts index da5eba26de..a8589b769f 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 161ecbbbc6..ee8fe2edd1 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 0ef322e898..cde032c0fd 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 ] && \ |