aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorShiji Yang <yangshiji66@qq.com>2024-02-01 19:39:51 +0800
committerChristian Marangi <ansuelsmth@gmail.com>2024-02-01 17:09:02 +0100
commit7e71eef5edbbe3670621cfdacb3731e1bd9a8ec0 (patch)
treeb4eb888378a5da682ce0492dab624ecc9b2888b1 /target/linux
parent348e0ee157637a7b6da61d56638f9e843645d673 (diff)
downloadupstream-7e71eef5edbbe3670621cfdacb3731e1bd9a8ec0.tar.gz
upstream-7e71eef5edbbe3670621cfdacb3731e1bd9a8ec0.tar.bz2
upstream-7e71eef5edbbe3670621cfdacb3731e1bd9a8ec0.zip
ath79: convert ath10k pre-calibration data to NVMEM (ASCII MAC)
This patch converts ath10k pre-calibration data to NVMEM format for wave 2 devices with mtd ASCII MAC address. The "pre-calibration" NVMEM cell size is 0x2f20. All unportable MAC address settings have been moved to '10_fix_wifi_mac' scripts. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ath79/dts/qca9561_nec_wf1200cr.dts12
-rw-r--r--target/linux/ath79/dts/qca9563_nec_wg1200cr.dts12
-rw-r--r--target/linux/ath79/dts/qca9563_phicomm_k2t.dts17
-rw-r--r--target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts17
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata21
-rw-r--r--target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac13
6 files changed, 71 insertions, 21 deletions
diff --git a/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts
index 90aac30d7f4..8f67299c489 100644
--- a/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts
+++ b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts
@@ -105,6 +105,16 @@
label = "art";
reg = <0x7f0000 0x010000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+ };
};
};
};
@@ -156,6 +166,8 @@
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&precal_art_5000>;
+ nvmem-cell-names = "pre-calibration";
};
};
diff --git a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts
index 26c1932154f..22ba567694a 100644
--- a/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts
+++ b/target/linux/ath79/dts/qca9563_nec_wg1200cr.dts
@@ -120,6 +120,16 @@
label = "art";
reg = <0x7f0000 0x010000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+ };
};
};
};
@@ -157,6 +167,8 @@
wifi@0,0 {
compatible = "pci168c,0056";
reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&precal_art_5000>;
+ nvmem-cell-names = "pre-calibration";
};
};
diff --git a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
index 9dbb291295f..5befbb16086 100644
--- a/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
+++ b/target/linux/ath79/dts/qca9563_phicomm_k2t.dts
@@ -48,6 +48,13 @@
&pcie {
status = "okay";
+
+ wifi@0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&precal_art_5000>;
+ nvmem-cell-names = "pre-calibration";
+ };
};
&spi {
@@ -91,6 +98,16 @@
label = "art";
reg = <0xff0000 0x010000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+ };
};
};
};
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 e4bb88807eb..9c731ad9969 100644
--- a/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts
@@ -53,6 +53,13 @@
&pcie {
status = "okay";
+
+ wifi@0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0x0000 0 0 0 0>;
+ nvmem-cells = <&precal_art_5000>;
+ nvmem-cell-names = "pre-calibration";
+ };
};
&mdio0 {
@@ -106,6 +113,16 @@
label = "art";
reg = <0x1f0000 0x10000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+ };
};
partition@200000 {
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 6145487393c..c5256a23bb5 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -3,7 +3,6 @@
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
-. /lib/functions/k2t.sh
board=$(board_name)
@@ -182,26 +181,6 @@ case "$FIRMWARE" in
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
- nec,wf1200cr|\
- nec,wg1200cr)
- caldata_extract "art" 0x5000 0x2f20
- ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
- ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
- /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
- ;;
- phicomm,k2t)
- caldata_extract "art" 0x5000 0x2f20
- ath10k_patch_mac $(k2t_get_mac "5g_mac")
- ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
- /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
- ;;
- tplink,deco-s4-v2)
- caldata_extract "art" 0x5000 0x2f20
- base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
- ath10k_patch_mac $(macaddr_add $base_mac 2)
- ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
- /lib/firmware/ath10k/QCA9888/hw2.0/board.bin
- ;;
esac
;;
*)
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 42b69d2ca0c..d3392aa61e7 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
@@ -59,7 +59,14 @@ case "$board" in
[ "$PHYNBR" -eq 1 ] && \
macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress
;;
+ nec,wf1200cr|\
+ nec,wg1200cr)
+ [ "$PHYNBR" -eq 0 ] && \
+ mtd_get_mac_ascii devdata wlan5mac > /sys${DEVPATH}/macaddress
+ ;;
phicomm,k2t)
+ [ "$PHYNBR" -eq 0 ] && \
+ k2t_get_mac "5g_mac" > /sys${DEVPATH}/macaddress
# The K2T factory firmware does use LAN mac address as the 2.4G wifi mac address
[ "$PHYNBR" -eq 1 ] && \
k2t_get_mac "lan_mac" > /sys${DEVPATH}/macaddress
@@ -67,6 +74,12 @@ case "$board" in
siemens,ws-ap3610)
mtd_get_mac_ascii cfg1 RADIOADDR${PHYNBR} > /sys${DEVPATH}/macaddress
;;
+ tplink,deco-s4-v2)
+ base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
+ [ "$PHYNBR" -eq 0 ] && \
+ macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress
+
+ ;;
trendnet,tew-823dru)
# set the 2.4G interface mac address to LAN MAC
[ "$PHYNBR" -eq 1 ] && \