diff mbox series

[v2,10/19] ath11k: Add QMI changes for WCN6750

Message ID 1642337235-8618-11-git-send-email-quic_mpubbise@quicinc.com (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series add support for WCN6750 | expand

Commit Message

Manikanta Pubbisetty Jan. 16, 2022, 12:47 p.m. UTC
In the case of WCN6750, FW doesn't request for DDR memory
via QMI, instead it uses a fixed 12MB reserved Memory region
in the DDR which is called as MSA region. As a result, QMI
message sequence is not same as other ath11k supported devices.

Also, M3 firmware will be bundled into the FW and will be
downloaded to the target as part of Q6 boot.

This is the QMI flow in the case of WCN6750,

1) QMI firmware indication REQ/RESP
2) QMI host capability REQ/RESP
3) QMI target capability REQ/RESP
4) QMI device info REQ/RESP
5) QMI BDF download
6) QMI FW ready

Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1

Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 73 +++++++++++++++++++++++------------
 1 file changed, 48 insertions(+), 25 deletions(-)

Comments

Kalle Valo Jan. 28, 2022, 10:50 a.m. UTC | #1
Manikanta Pubbisetty <quic_mpubbise@quicinc.com> writes:

> In the case of WCN6750, FW doesn't request for DDR memory
> via QMI, instead it uses a fixed 12MB reserved Memory region
> in the DDR which is called as MSA region. As a result, QMI
> message sequence is not same as other ath11k supported devices.
>
> Also, M3 firmware will be bundled into the FW and will be
> downloaded to the target as part of Q6 boot.
>
> This is the QMI flow in the case of WCN6750,
>
> 1) QMI firmware indication REQ/RESP
> 2) QMI host capability REQ/RESP
> 3) QMI target capability REQ/RESP
> 4) QMI device info REQ/RESP
> 5) QMI BDF download
> 6) QMI FW ready
>
> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>

[...]

> @@ -2490,6 +2497,13 @@ static int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base *ab)
>  	struct qmi_txn txn;
>  	int ret = 0;
>  
> +	/* In the case of WCN6750, M3 is bundled into the FW
> +	 * binary, and will be downloaded as part of Q6 boot.
> +	 */
> +	if (!ab->bus_params.m3_fw_support &&
> +	    ab->bus_params.hybrid_bus_type)
> +		return 0;

A check like this makes me think if it's just better to m3_fw_support to
ath11k_hw_params. That way you could disable m3 for WCN6750 via
hw_params.
Manikanta Pubbisetty Feb. 21, 2022, 8:02 a.m. UTC | #2
On 1/28/2022 4:20 PM, Kalle Valo wrote:
> Manikanta Pubbisetty <quic_mpubbise@quicinc.com> writes:
> 
>> In the case of WCN6750, FW doesn't request for DDR memory
>> via QMI, instead it uses a fixed 12MB reserved Memory region
>> in the DDR which is called as MSA region. As a result, QMI
>> message sequence is not same as other ath11k supported devices.
>>
>> Also, M3 firmware will be bundled into the FW and will be
>> downloaded to the target as part of Q6 boot.
>>
>> This is the QMI flow in the case of WCN6750,
>>
>> 1) QMI firmware indication REQ/RESP
>> 2) QMI host capability REQ/RESP
>> 3) QMI target capability REQ/RESP
>> 4) QMI device info REQ/RESP
>> 5) QMI BDF download
>> 6) QMI FW ready
>>
>> Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00573-QCAMSLSWPLZ-1
>> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>> Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
>> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
> 
> [...]
> 
>> @@ -2490,6 +2497,13 @@ static int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base *ab)
>>   	struct qmi_txn txn;
>>   	int ret = 0;
>>   
>> +	/* In the case of WCN6750, M3 is bundled into the FW
>> +	 * binary, and will be downloaded as part of Q6 boot.
>> +	 */
>> +	if (!ab->bus_params.m3_fw_support &&
>> +	    ab->bus_params.hybrid_bus_type)
>> +		return 0;
> 
> A check like this makes me think if it's just better to m3_fw_support to
> ath11k_hw_params. That way you could disable m3 for WCN6750 via
> hw_params.
> 

You are right, it's better to have a hw_param instead.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index ee59cb9..4745ff9 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -1793,10 +1793,6 @@  static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab)
 	req->client_id = QMI_WLANFW_CLIENT_ID;
 	req->fw_ready_enable_valid = 1;
 	req->fw_ready_enable = 1;
-	req->request_mem_enable_valid = 1;
-	req->request_mem_enable = 1;
-	req->fw_mem_ready_enable_valid = 1;
-	req->fw_mem_ready_enable = 1;
 	req->cal_done_enable_valid = 1;
 	req->cal_done_enable = 1;
 	req->fw_init_done_enable_valid = 1;
@@ -1805,6 +1801,17 @@  static int ath11k_qmi_fw_ind_register_send(struct ath11k_base *ab)
 	req->pin_connect_result_enable_valid = 0;
 	req->pin_connect_result_enable = 0;
 
+	/* WCN6750 doesn't request for DDR memory via QMI,
+	 * instead it uses a fixed 12MB reserved memory
+	 * region in DDR.
+	 */
+	if (!ab->bus_params.hybrid_bus_type) {
+		req->request_mem_enable_valid = 1;
+		req->request_mem_enable = 1;
+		req->fw_mem_ready_enable_valid = 1;
+		req->fw_mem_ready_enable = 1;
+	}
+
 	ret = qmi_txn_init(handle, &txn,
 			   qmi_wlanfw_ind_register_resp_msg_v01_ei, resp);
 	if (ret < 0)
@@ -2490,6 +2497,13 @@  static int ath11k_qmi_wlanfw_m3_info_send(struct ath11k_base *ab)
 	struct qmi_txn txn;
 	int ret = 0;
 
+	/* In the case of WCN6750, M3 is bundled into the FW
+	 * binary, and will be downloaded as part of Q6 boot.
+	 */
+	if (!ab->bus_params.m3_fw_support &&
+	    ab->bus_params.hybrid_bus_type)
+		return 0;
+
 	memset(&req, 0, sizeof(req));
 	memset(&resp, 0, sizeof(resp));
 
@@ -2821,27 +2835,6 @@  ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi,
 	return 0;
 }
 
-static int ath11k_qmi_event_server_arrive(struct ath11k_qmi *qmi)
-{
-	struct ath11k_base *ab = qmi->ab;
-	int ret;
-
-	ret = ath11k_qmi_fw_ind_register_send(ab);
-	if (ret < 0) {
-		ath11k_warn(ab, "failed to send qmi firmware indication: %d\n",
-			    ret);
-		return ret;
-	}
-
-	ret = ath11k_qmi_host_cap_send(ab);
-	if (ret < 0) {
-		ath11k_warn(ab, "failed to send qmi host cap: %d\n", ret);
-		return ret;
-	}
-
-	return ret;
-}
-
 static int ath11k_qmi_event_mem_request(struct ath11k_qmi *qmi)
 {
 	struct ath11k_base *ab = qmi->ab;
@@ -2892,6 +2885,36 @@  static int ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi)
 	return ret;
 }
 
+static int ath11k_qmi_event_server_arrive(struct ath11k_qmi *qmi)
+{
+	struct ath11k_base *ab = qmi->ab;
+	int ret;
+
+	ret = ath11k_qmi_fw_ind_register_send(ab);
+	if (ret < 0) {
+		ath11k_warn(ab, "failed to send qmi firmware indication: %d\n",
+			    ret);
+		return ret;
+	}
+
+	ret = ath11k_qmi_host_cap_send(ab);
+	if (ret < 0) {
+		ath11k_warn(ab, "failed to send qmi host cap: %d\n", ret);
+		return ret;
+	}
+
+	if (!ab->bus_params.hybrid_bus_type)
+		return ret;
+
+	ret = ath11k_qmi_event_load_bdf(qmi);
+	if (ret < 0) {
+		ath11k_warn(ab, "qmi failed to download BDF:%d\n", ret);
+		return ret;
+	}
+
+	return ret;
+}
+
 static void ath11k_qmi_msg_mem_request_cb(struct qmi_handle *qmi_hdl,
 					  struct sockaddr_qrtr *sq,
 					  struct qmi_txn *txn,