ath79: wlr-7100: fix MAC assignment

Partially revert 5e3a602def. 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: 5e3a602def ("ath79: sitecom,wlrx100: use nvmem")
Reviewed-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
This commit is contained in:
Tomasz Maciej Nowak
2026-05-04 19:48:39 +02:00
committed by Robert Marko
parent 57cfe86c06
commit a7f5fb4381
3 changed files with 15 additions and 14 deletions
@@ -11,7 +11,6 @@
compatible = "sitecom,wlr-7100", "qca,ar9344";
aliases {
label-mac-device = &eth0;
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>;
@@ -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)
;;
@@ -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 ] && \