Skip to content

Commit d276b4c

Browse files
musashino205robimarko
authored andcommitted
Revert "ath79: elecom,wab: use nvmem"
This reverts commit 70e41d0. "ethaddr" is stored into the "u-boot-env" (stock: "Config") partition and it's quoted with double-quotations, but that format is not supported by the current NVMEM u-boot-env driver (and mac_pton() function) and the MAC address won't be parsed to byte array. This causes random MAC addresses on the adapters, so revert the above commit. Signed-off-by: INAGAKI Hiroshi <[email protected]> Link: openwrt/openwrt#17116 (cherry picked from commit af611bc) Link: openwrt/openwrt#17117 Signed-off-by: Robert Marko <[email protected]>
1 parent c981096 commit d276b4c

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

target/linux/ath79/dts/qca955x_elecom_wab.dtsi

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/ {
1010
aliases {
11-
label-mac-device = &eth0;
1211
led-boot = &led_status;
1312
led-failsafe = &led_status;
1413
led-upgrade = &led_status;
@@ -108,9 +107,6 @@
108107
phy-mode = "rgmii-rxid";
109108
pll-data = <0xae000000 0x80000101 0x80001313>;
110109

111-
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
112-
nvmem-cell-names = "mac-address";
113-
114110
gmac-config {
115111
device = <&gmac>;
116112

@@ -148,8 +144,8 @@
148144
wifi@0,0 {
149145
compatible = "qcom,ath10k";
150146
reg = <0x0000 0 0 0 0>;
151-
nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
152-
nvmem-cell-names = "calibration", "mac-address";
147+
nvmem-cells = <&cal_art_5000>;
148+
nvmem-cell-names = "calibration";
153149
};
154150
};
155151

@@ -173,14 +169,9 @@
173169
};
174170

175171
partition@40000 {
176-
compatible = "u-boot,env";
177172
label = "u-boot-env";
178173
reg = <0x40000 0x10000>;
179174
read-only;
180-
181-
macaddr_uboot_ethaddr: ethaddr {
182-
#nvmem-cell-cells = <1>;
183-
};
184175
};
185176

186177
partition@50000 {
@@ -261,6 +252,6 @@
261252
&wmac {
262253
status = "okay";
263254

264-
nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
265-
nvmem-cell-names = "calibration", "mac-address";
255+
nvmem-cells = <&cal_art_1000>;
256+
nvmem-cell-names = "calibration";
266257
};

target/linux/ath79/generic/base-files/etc/board.d/02_network

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,9 @@ ath79_setup_macs()
717717
lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
718718
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
719719
;;
720+
elecom,wab-i1750-ps|\
721+
elecom,wab-s1167-ps|\
722+
elecom,wab-s600-ps|\
720723
engenius,ecb1200|\
721724
engenius,ecb1750)
722725
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)

target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ case "$board" in
4242
[ "$PHYNBR" -eq 1 ] && \
4343
mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
4444
;;
45+
elecom,wab-i1750-ps|\
46+
elecom,wab-s1167-ps|\
47+
elecom,wab-s600-ps)
48+
# set the 5G MAC address (= ethaddr + 1)
49+
[ "$PHYNBR" -eq 0 ] && \
50+
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
51+
# set the 2.4G MAC address (= ethaddr)
52+
[ "$PHYNBR" -eq 1 ] && \
53+
mtd_get_mac_ascii u-boot-env "ethaddr" > /sys${DEVPATH}/macaddress
54+
;;
4555
engenius,ecb1200|\
4656
engenius,ecb1750)
4757
[ "$PHYNBR" -eq 0 ] && \

0 commit comments

Comments
 (0)