From: Hal Martin Date: Wed, 22 Oct 2025 16:16:00 +0000 (+0200) Subject: ipq40xx: meraki: convert to nvmem for calibration X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F20474%2Fhead;p=thirdparty%2Fopenwrt.git 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 Link: https://github.com/openwrt/openwrt/pull/20474 Signed-off-by: Robert Marko --- 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 4a1a0ff3111..a91d0c6d35e 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 71df9d365a3..46cc68435f6 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@1000 { + reg = <0x1000 0x2f20>; + }; + + precal_factory_5000: precal@5000 { + reg = <0x5000 0x2f20>; + }; + + cal_factory_9000: cal@9000 { + reg = <0x9000 0x844>; + }; + }; +}; + &pcie0 { status = "okay"; perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; @@ -282,8 +307,8 @@ wifi@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 953caa8b60a..a1fad08559e 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 9f89330b661..2df9e912a25 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"; +};