[openwrt/openwrt] ath79: TP-Link EAP245 v3: convert radios to nvmem-cells

LEDE Commits lede-commits at lists.infradead.org
Thu Jun 16 12:42:36 PDT 2022


svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d4b3b23942336e22ef36ccbcf584efa6a55cc408

commit d4b3b23942336e22ef36ccbcf584efa6a55cc408
Author: Sander Vanheule <sander at svanheule.net>
AuthorDate: Sun Jun 5 12:58:24 2022 +0200

    ath79: TP-Link EAP245 v3: convert radios to nvmem-cells
    
    Replace the mtd-cal-data phandle by an nvmem-cell reference from the art
    partition for the 2.4GHz ath9k radio.
    
    Add the PCIe node for the ath10k radio to the devicetree, and refer to
    the art partition for the calibration data using an nvmem-cell.
    
    Use mac-address-increment to ensure the MAC address is set correctly,
    and remove the device from the caldata extraction and patching script.
    
    Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 .../linux/ath79/dts/qca9563_tplink_eap245-v3.dts   | 29 +++++++++++++++++++---
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  4 ---
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
index 768a48bd69..6819d2d822 100644
--- a/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_eap245-v3.dts
@@ -46,6 +46,16 @@
 
 &pcie {
 	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0 0 0 0 0>;
+
+		mac-address-increment = <1>;
+
+		nvmem-cells = <&macaddr_info_8>, <&calibration_ath10k>;
+		nvmem-cell-names = "mac-address", "calibration";
+	};
 };
 
 &spi {
@@ -85,10 +95,22 @@
 				read-only;
 			};
 
-			art: partition at a0000 {
+			partition at a0000 {
 				label = "art";
 				reg = <0x0a0000 0x010000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				calibration_ath9k: calibration at 1000 {
+					reg = <0x1000 0x440>;
+				};
+
+				calibration_ath10k: calibration at 5000 {
+					reg = <0x5000 0x2f20>;
+				};
 			};
 
 			partition at b0000 {
@@ -151,9 +173,8 @@
 &wmac {
 	status = "okay";
 
-	mtd-cal-data = <&art 0x1000>;
-	nvmem-cells = <&macaddr_info_8>;
-	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&macaddr_info_8>, <&calibration_ath9k>;
+	nvmem-cell-names = "mac-address", "calibration";
 };
 
 &info {
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 1c80966efe..ee53f31638 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
@@ -256,10 +256,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
 		;;
-	tplink,eap245-v3)
-		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
-		;;
 	xiaomi,aiot-ac2350)
 		caldata_extract "art" 0x5000 0x2f20
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \




More information about the lede-commits mailing list