]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Enable IPQ5424 WiFi device support
authorSowmiya Sree Elavalagan <sowmiya.elavalagan@oss.qualcomm.com>
Tue, 7 Apr 2026 05:26:33 +0000 (10:56 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 8 Apr 2026 00:28:22 +0000 (17:28 -0700)
Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the
firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can
directly communicate with the Trusted Management Engine - Lite (TME-L),
eliminating the need for SCM calls for userpd bring-up.

Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and
skip the SCM call as Q6 will directly authenticate the userpd firmware.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sowmiya Sree Elavalagan <sowmiya.elavalagan@oss.qualcomm.com>
Co-developed-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com>
Co-developed-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>
Signed-off-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Link: https://patch.msgid.link/20260407-ath12k-ipq5424-v5-6-8e96aa660ec4@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/ahb.c
drivers/net/wireless/ath/ath12k/ahb.h
drivers/net/wireless/ath/ath12k/wifi7/ahb.c

index 9a4d34e4910441ef4450dd09d857e090450a9032..2dcf0a52e4c15b936907c70ceba392bbfdb72bb6 100644 (file)
@@ -382,8 +382,12 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
                ATH12K_AHB_UPD_SWID;
 
        /* Load FW image to a reserved memory location */
-       ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region, mem_phys, mem_size,
-                           &mem_phys);
+       if (ab_ahb->scm_auth_enabled)
+               ret = qcom_mdt_load(dev, fw, fw_name, pasid, mem_region,
+                                   mem_phys, mem_size, &mem_phys);
+       else
+               ret = qcom_mdt_load_no_init(dev, fw, fw_name, mem_region,
+                                           mem_phys, mem_size, &mem_phys);
        if (ret) {
                ath12k_err(ab, "Failed to load MDT segments: %d\n", ret);
                goto err_fw;
@@ -414,11 +418,13 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
                goto err_fw2;
        }
 
-       /* Authenticate FW image using peripheral ID */
-       ret = qcom_scm_pas_auth_and_reset(pasid);
-       if (ret) {
-               ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
-               goto err_fw2;
+       if (ab_ahb->scm_auth_enabled) {
+               /* Authenticate FW image using peripheral ID */
+               ret = qcom_scm_pas_auth_and_reset(pasid);
+               if (ret) {
+                       ath12k_err(ab, "failed to boot the remote processor %d\n", ret);
+                       goto err_fw2;
+               }
        }
 
        /* Instruct Q6 to spawn userPD thread */
@@ -475,13 +481,15 @@ static void ath12k_ahb_power_down(struct ath12k_base *ab, bool is_suspend)
 
        qcom_smem_state_update_bits(ab_ahb->stop_state, BIT(ab_ahb->stop_bit), 0);
 
-       pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
-               ATH12K_AHB_UPD_SWID;
-       /* Release the firmware */
-       ret = qcom_scm_pas_shutdown(pasid);
-       if (ret)
-               ath12k_err(ab, "scm pas shutdown failed for userPD%d: %d\n",
-                          ab_ahb->userpd_id, ret);
+       if (ab_ahb->scm_auth_enabled) {
+               pasid = (u32_encode_bits(ab_ahb->userpd_id, ATH12K_USERPD_ID_MASK)) |
+                        ATH12K_AHB_UPD_SWID;
+               /* Release the firmware */
+               ret = qcom_scm_pas_shutdown(pasid);
+               if (ret)
+                       ath12k_err(ab, "scm pas shutdown failed for userPD%d\n",
+                                  ab_ahb->userpd_id);
+       }
 }
 
 static void ath12k_ahb_init_qmi_ce_config(struct ath12k_base *ab)
index be9e31b3682d6cc939727af21ffbedf8cdfc943f..0fa15daaa3e6c97ad50c20e2e5da2bf10b282cc5 100644 (file)
@@ -68,6 +68,7 @@ struct ath12k_ahb {
        int userpd_irq_num[ATH12K_USERPD_MAX_IRQ];
        const struct ath12k_ahb_ops *ahb_ops;
        const struct ath12k_ahb_device_family_ops *device_family_ops;
+       bool scm_auth_enabled;
 };
 
 struct ath12k_ahb_driver {
index a6c5f7689edd1a90d0f10651cf74885ee699355d..6a8b8b2a56f902938a6c3243bdfeee852c68e340 100644 (file)
@@ -19,6 +19,9 @@ static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {
        { .compatible = "qcom,ipq5332-wifi",
          .data = (void *)ATH12K_HW_IPQ5332_HW10,
        },
+       { .compatible = "qcom,ipq5424-wifi",
+         .data = (void *)ATH12K_HW_IPQ5424_HW10,
+       },
        { }
 };
 
@@ -38,6 +41,11 @@ static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
        switch (hw_rev) {
        case ATH12K_HW_IPQ5332_HW10:
                ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
+               ab_ahb->scm_auth_enabled = true;
+               break;
+       case ATH12K_HW_IPQ5424_HW10:
+               ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
+               ab_ahb->scm_auth_enabled = false;
                break;
        default:
                return -EOPNOTSUPP;