[openwrt/openwrt] ath79: Convert calibration data to nvmem

LEDE Commits lede-commits at lists.infradead.org
Sat May 20 04:46:00 PDT 2023


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2f4b6d0f89f1e6874a6452962d165884fca3cf3b

commit 2f4b6d0f89f1e6874a6452962d165884fca3cf3b
Author: Jan Forman <jforman at tuta.io>
AuthorDate: Mon Oct 31 22:15:56 2022 +0100

    ath79: Convert calibration data to nvmem
    
    For D-link DIR-859 and DIR-869
    Replace the mtd-cal-data by an nvmem-cell.
    Add the PCIe node for the ath10k radio to the devicetree.
    Thanks to DragonBlue for this patch
    
    Signed-off-by: Jan Forman <jforman at tuta.io>
---
 .../linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi  | 37 ++++++++++++++++++++--
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  1 -
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  4 ---
 3 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi
index 65948ecb22..556ba604a6 100644
--- a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi
+++ b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi
@@ -26,6 +26,14 @@
 
 &pcie {
 	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x0000 0 0 0 0>;
+
+		nvmem-cells = <&calibration_ath10k>, <&macaddr_devdata_94>;
+		nvmem-cell-names = "calibration", "mac-address-ascii";
+	};
 };
 
 &spi {
@@ -57,6 +65,18 @@
 				label = "devdata";
 				reg = <0x050000 0x10000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_devdata_94: macaddr at 94 {
+					reg = <0x94 0x11>;
+				};
+
+				macaddr_devdata_b0: macaddr at b0 {
+					reg = <0xb0 0x11>;
+				};
 			};
 
 			partition at 60000 {
@@ -71,10 +91,22 @@
 				reg = <0x070000 0xf80000>;
 			};
 
-			art: partition at ff0000 {
+			partition at ff0000 {
 				label = "art";
 				reg = <0xff0000 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 0x844>;
+				};	
 			};
 		};
 	};
@@ -114,5 +146,6 @@
 &wmac {
 	status = "okay";
 
-	qca,no-eeprom;
+	nvmem-cells = <&calibration_ath9k>, <&macaddr_devdata_b0>;
+	nvmem-cell-names = "calibration", "mac-address-ascii";
 };
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 022f5e2947..a57479b87c 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
@@ -30,7 +30,6 @@ case "$FIRMWARE" in
 	dlink,dir-842-c1|\
 	dlink,dir-842-c2|\
 	dlink,dir-842-c3|\
-	dlink,dir-859-a1|\
 	nec,wf1200cr|\
 	nec,wg1200cr|\
 	wd,mynet-n600|\
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 4db311fde0..f0a3755de9 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
@@ -68,10 +68,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) -1)
 		;;
-	dlink,dir-859-a1)
-		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(mtd_get_mac_ascii devdata "wlan5mac")
-		;;
 	engenius,ecb1200|\
 	engenius,ecb1750)
 		caldata_extract "art" 0x5000 0x844




More information about the lede-commits mailing list