summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRosen Penev2024-06-22 17:46:07 +0000
committerHauke Mehrtens2025-12-02 22:02:46 +0000
commit55b5e44673d1e3e624602e462d855d1b8fde9a51 (patch)
tree966dc0f6bdf9c9063046f4ec12ccc706277ee6ec
parentd0fcbddaadbfde60cc91bd3f44b3b9de36c3cc89 (diff)
downloadopenwrt-55b5e44673d1e3e624602e462d855d1b8fde9a51.tar.gz
ath79: ews511ap: use nvmem
Userspace handling is deprecated. This is a weird one. It should be using u-boot,env, but the variable name is unknown. Keep it as is. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: https://github.com/openwrt/openwrt/pull/20520 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/ath79/dts/qca9531_engenius_ews511ap.dts24
-rw-r--r--target/linux/ath79/generic/base-files/etc/board.d/02_network6
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac4
3 files changed, 22 insertions, 12 deletions
diff --git a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
index f84f8b084b..ba51982156 100644
--- a/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
+++ b/target/linux/ath79/dts/qca9531_engenius_ews511ap.dts
@@ -82,8 +82,8 @@
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&cal_art_5000>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_e9 1>;
+ nvmem-cell-names = "calibration", "mac-address";
};
};
@@ -109,6 +109,18 @@
ubootenv: partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_uboot_e9: macaddr@e9 {
+ compatible = "mac-base";
+ reg = <0xe9 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@50000 {
@@ -144,6 +156,14 @@
status = "okay";
phy-handle = <&swphy4>;
+
+ nvmem-cells = <&macaddr_uboot_e9 0>;
+ nvmem-cell-names = "mac-address";
+};
+
+&eth1 {
+ nvmem-cells = <&macaddr_uboot_e9 1>;
+ nvmem-cell-names = "mac-address";
};
&wmac {
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 fef96060a8..fa158b839c 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
@@ -739,12 +739,6 @@ ath79_setup_macs()
engenius,esr900)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
;;
- engenius,ews511ap)
- lan_mac=$(mtd_get_mac_text "u-boot-env" 0xe9)
- eth1_mac=$(macaddr_add "$lan_mac" 1)
- ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac"
- ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac"
- ;;
hak5,lan-turtle|\
hak5,packet-squirrel)
label_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
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 291241b6ee..6153599907 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
@@ -52,10 +52,6 @@ case "$board" in
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii u-boot-env athaddr > /sys${DEVPATH}/macaddress
;;
- engenius,ews511ap)
- [ "$PHYNBR" -eq 0 ] && \
- macaddr_add $(cat /sys/class/net/eth0/address) 1 > /sys${DEVPATH}/macaddress
- ;;
enterasys,ws-ap3705i)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_ascii u-boot-env0 RADIOADDR1 > /sys${DEVPATH}/macaddress