[openwrt/openwrt] ath79: tplink,deco-s4-v2: use nvmem for cal
LEDE Commits
lede-commits at lists.infradead.org
Wed Dec 18 11:27:07 PST 2024
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/eec6ec4755075cf40add30a00dabeecd07ddb6cf
commit eec6ec4755075cf40add30a00dabeecd07ddb6cf
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Jun 16 12:40:53 2024 -0700
ath79: tplink,deco-s4-v2: use nvmem for cal
Userspace handling is deprecated. MAC address stuff needs to remain
handled in userspace as it's encrypted. Maybe an NVMEM driver can be
written in the future...
Signed-off-by: Rosen Penev <rosenp at gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17276
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts | 7 ++++++-
.../generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 5 -----
.../generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 ++-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts b/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts
index 7cbc77f64b..147a880de8 100644
--- a/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts
@@ -121,6 +121,10 @@
#address-cells = <1>;
#size-cells = <1>;
+ cal_art_1000: calibration at 1000 {
+ reg = <0x1000 0x440>;
+ };
+
precal_art_5000: pre-calibration at 5000 {
reg = <0x5000 0x2f20>;
};
@@ -146,5 +150,6 @@
&wmac {
status = "okay";
- qca,no-eeprom;
+ nvmem-cells = <&cal_art_1000>;
+ nvmem-cell-names = "calibration";
};
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 17639ad439..675522823f 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -58,11 +58,6 @@ case "$FIRMWARE" in
caldata_extract "art" 0x1000 0x440
ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr)
;;
- tplink,deco-s4-v2)
- caldata_extract "art" 0x1000 0x440
- base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
- ath9k_patch_mac $(macaddr_add $base_mac 1)
- ;;
*)
caldata_die "board $board is not supported yet"
;;
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 5155d240a8..b10599cc15 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
@@ -110,7 +110,8 @@ case "$board" in
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
[ "$PHYNBR" -eq 0 ] && \
macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
-
+ [ "$PHYNBR" -eq 1 ] && \
+ macaddr_add $base_mac 1 > /sys${DEVPATH}/macaddress
;;
trendnet,tew-823dru)
# set the 2.4G interface mac address to LAN MAC
More information about the lede-commits
mailing list