[openwrt/openwrt] ipq40xx: meraki: convert to nvmem for calibration

LEDE Commits lede-commits at lists.infradead.org
Thu Oct 23 04:14:18 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/9089b716be3530621b67c67ded315e80ae6845b5

commit 9089b716be3530621b67c67ded315e80ae6845b5
Author: Hal Martin <hal.martin at gmail.com>
AuthorDate: Wed Oct 22 18:16:00 2025 +0200

    ipq40xx: meraki: convert to nvmem for calibration
    
    This commit changes the Meraki MR33 and MR74 device trees to use nvmem
    for ART calibration.
    
    The WiFi BDF was moved from insect-common.dtsi to the respective
    device files in preparation for additional insect-family devices being added.
    
    Signed-off-by: Hal Martin <hal.martin at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/20474
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../etc/hotplug.d/firmware/11-ath10k-caldata       | 19 -----------
 .../boot/dts/qcom/qcom-ipq4029-insect-common.dtsi  | 39 +++++++++++++++++-----
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts   |  8 +++++
 .../arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts   |  8 +++++
 4 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 4a1a0ff311..a91d0c6d35 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -7,15 +7,6 @@
 board=$(board_name)
 
 case "$FIRMWARE" in
-"ath10k/cal-pci-0000:01:00.0.bin")
-	case "$board" in
-	meraki,mr33 |\
-	meraki,mr74)
-		caldata_extract_ubi "ART" 0x9000 0x844
-		caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844
-		;;
-	esac
-	;;
 "ath10k/pre-cal-pci-0000:01:00.0.bin")
 	case "$board" in
 	asus,map-ac2200)
@@ -111,11 +102,6 @@ case "$FIRMWARE" in
 		caldata_extract_mmc "0:ART" 0x1000 0x2f20
 		ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
 		;;
-	meraki,mr33 |\
-	meraki,mr74)
-		caldata_extract_ubi "ART" 0x1000 0x2f20
-		caldata_valid "202f" || caldata_extract "ART" 0x1000 0x2f20
-		;;
 	mikrotik,cap-ac |\
 	mikrotik,hap-ac2 |\
 	mikrotik,hap-ac3 |\
@@ -210,11 +196,6 @@ case "$FIRMWARE" in
 		caldata_extract_mmc "0:ART" 0x5000 0x2f20
 		ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
 		;;
-	meraki,mr33 |\
-	meraki,mr74)
-		caldata_extract_ubi "ART" 0x5000 0x2f20
-		caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20
-		;;
 	mikrotik,cap-ac |\
 	mikrotik,hap-ac2 |\
 	mikrotik,hap-ac3 |\
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi
index 71df9d365a..46cc68435f 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-insect-common.dtsi
@@ -267,11 +267,36 @@
 				 * confuse the u-boot and it might not
 				 * find the kernel partition anymore.
 				 */
+				volumes {
+					ubi_art: ubi-volume-art {
+						volname = "ART";
+					};
+				};
 			};
 		};
 	};
 };
 
+&ubi_art {
+	nvmem-layout {
+		compatible = "fixed-layout";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		precal_factory_1000: precal at 1000 {
+			reg = <0x1000 0x2f20>;
+		};
+
+		precal_factory_5000: precal at 5000 {
+			reg = <0x5000 0x2f20>;
+		};
+
+		cal_factory_9000: cal at 9000 {
+			reg = <0x9000 0x844>;
+		};
+	};
+};
+
 &pcie0 {
 	status = "okay";
 	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
@@ -282,8 +307,8 @@
 	wifi at 0,0 {
 		compatible = "qcom,ath10k";
 		reg = <0x00010000 0 0 0 0>;
-		nvmem-cells = <&mac_address 1>;
-		nvmem-cell-names = "mac-address";
+		nvmem-cells = <&mac_address 1>, <&cal_factory_9000>;
+		nvmem-cell-names = "mac-address", "calibration";
 	};
 };
 
@@ -385,16 +410,14 @@
 
 &wifi0 {
 	status = "okay";
-	qcom,ath10k-calibration-variant = "Meraki-MR33";
-	nvmem-cells = <&mac_address 2>;
-	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&mac_address 2>, <&precal_factory_1000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
 };
 
 &wifi1 {
 	status = "okay";
-	qcom,ath10k-calibration-variant = "Meraki-MR33";
-	nvmem-cells = <&mac_address 3>;
-	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&mac_address 3>, <&precal_factory_5000>;
+	nvmem-cell-names = "mac-address", "pre-calibration";
 };
 
 &mdio {
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
index 953caa8b60..a1fad08559 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr33.dts
@@ -11,3 +11,11 @@
 &tricolor {
 	enable-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
 };
+
+&wifi0 {
+	qcom,ath10k-calibration-variant = "Meraki-MR33";
+};
+
+&wifi1 {
+	qcom,ath10k-calibration-variant = "Meraki-MR33";
+};
diff --git a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
index 9f89330b66..2df9e912a2 100644
--- a/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
+++ b/target/linux/ipq40xx/files-6.12/arch/arm/boot/dts/qcom/qcom-ipq4029-mr74.dts
@@ -11,3 +11,11 @@
 &tricolor {
 	enable-gpios = <&tlmm 14 GPIO_ACTIVE_LOW>;
 };
+
+&wifi0 {
+	qcom,ath10k-calibration-variant = "Meraki-MR33";
+};
+
+&wifi1 {
+	qcom,ath10k-calibration-variant = "Meraki-MR33";
+};




More information about the lede-commits mailing list