diff mbox series

[v3,4/6] ath79: D-Link DAP-2660 A1: convert ath10k caldata to nvmem

Message ID 058c7127f1e98e10b36b3b549965e6f308f47b6e.1655542439.git.sander@svanheule.net
State Accepted
Delegated to: Sander Vanheule
Headers show
Series ath79: convert QCA955x-based D-Link DAP-2xxx to nvmem | expand

Commit Message

Sander Vanheule June 18, 2022, 8:55 a.m. UTC
Add the PCIe node for the ath10k radio to the devicetree, and refer to
the art partition for the calibration data using nvmem-cells.

MAC address assignment is moved to '10_fix_wifi_mac', so the device can
then be removed from the caldata extraction script '11-ath10k-caldata'.

Cc: Sebastian Schaper <openwrt@sebastianschaper.net>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
---
 .../linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts  | 14 ++++++++++++++
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  1 -
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
index 039007942631..93e2fc0d974d 100644
--- a/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
+++ b/target/linux/ath79/dts/qca9557_dlink_dap-2660-a1.dts
@@ -79,4 +79,18 @@ 
 
 &pcie0 {
 	status = "okay";
+
+	wifi@0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0 0 0 0 0>;
+
+		nvmem-cells = <&cal_ath10k>;
+		nvmem-cell-names = "calibration";
+	};
+};
+
+&art {
+	cal_ath10k: calibration@5000 {
+		reg = <0x5000 0x844>;
+	};
 };
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 1ce3f00c7e4f..079b9ab150d4 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
@@ -67,7 +67,6 @@  case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
 		;;
-	dlink,dap-2660-a1|\
 	dlink,dap-2695-a1|\
 	dlink,dap-3662-a1)
 		caldata_extract "art" 0x5000 0x844
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 d5a2471a99a9..fbd5344a1e82 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
@@ -26,12 +26,12 @@  case "$board" in
 	dlink,dap-3320-a1)
 		mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
-	dlink,dap-2660-a1|\
 	dlink,dap-2695-a1|\
 	dlink,dap-3662-a1)
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
+	dlink,dap-2660-a1|\
 	dlink,dap-2680-a1)
 		[ "$PHYNBR" -eq 0 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac_a" > /sys${DEVPATH}/macaddress