diff mbox series

[v2,15/22] wifi: ath12k: add BDF address in hardware parameter

Message ID 20241015182637.955753-16-quic_rajkbhag@quicinc.com
State New
Headers show
Series wifi: ath12k: add Ath12k AHB driver support for IPQ5332 | expand

Commit Message

Raj Kumar Bhagat Oct. 15, 2024, 6:26 p.m. UTC
The Ath2k AHB device (IPQ5332) firmware requests BDF_MEM_REGION_TYPE
memory during QMI memory requests. This memory is part of the
HOST_DDR_REGION_TYPE. Therefore, add the BDF memory address to the
hardware parameter and provide this memory address to the firmware
during QMI memory requests.

Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1

Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/hw.c  | 4 ++++
 drivers/net/wireless/ath/ath12k/hw.h  | 1 +
 drivers/net/wireless/ath/ath12k/qmi.c | 8 ++++++++
 3 files changed, 13 insertions(+)

Comments

Konrad Dybcio Nov. 4, 2024, 2:16 p.m. UTC | #1
On 15.10.2024 8:26 PM, Raj Kumar Bhagat wrote:
> The Ath2k AHB device (IPQ5332) firmware requests BDF_MEM_REGION_TYPE
> memory during QMI memory requests. This memory is part of the
> HOST_DDR_REGION_TYPE. Therefore, add the BDF memory address to the
> hardware parameter and provide this memory address to the firmware
> during QMI memory requests.

Sounds like something to put in the device tree, no?

Konrad
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index 4117a4b718e3..8fc191b0b467 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -1320,6 +1320,7 @@  static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.cmem_remap = NULL,
 		.ce_ie_addr = NULL,
 		.ce_remap = NULL,
+		.bdf_addr = 0,
 	},
 	{
 		.name = "wcn7850 hw2.0",
@@ -1405,6 +1406,7 @@  static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.cmem_remap = NULL,
 		.ce_ie_addr = NULL,
 		.ce_remap = NULL,
+		.bdf_addr = 0,
 	},
 	{
 		.name = "qcn9274 hw2.0",
@@ -1486,6 +1488,7 @@  static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.cmem_remap = NULL,
 		.ce_ie_addr = NULL,
 		.ce_remap = NULL,
+		.bdf_addr = 0,
 	},
 	{
 		.name = "ipq5332 hw1.0",
@@ -1562,6 +1565,7 @@  static const struct ath12k_hw_params ath12k_hw_params[] = {
 		.cmem_remap = &ath12k_cmem_remap_ipq5332,
 		.ce_ie_addr = &ath12k_ce_ie_addr_ipq5332,
 		.ce_remap = &ath12k_ce_remap_ipq5332,
+		.bdf_addr = 0x4B500000,
 	},
 };
 
diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h
index 580c7be109e0..038fe1b30d11 100644
--- a/drivers/net/wireless/ath/ath12k/hw.h
+++ b/drivers/net/wireless/ath/ath12k/hw.h
@@ -225,6 +225,7 @@  struct ath12k_hw_params {
 	const struct cmem_remap *cmem_remap;
 	const struct ce_ie_addr *ce_ie_addr;
 	const struct ce_remap *ce_remap;
+	u32 bdf_addr;
 };
 
 struct ath12k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index ec8859031824..b5cad6656722 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2491,6 +2491,14 @@  static int ath12k_qmi_assign_target_mem_chunk(struct ath12k_base *ab)
 			ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
 			idx++;
 			break;
+		case BDF_MEM_REGION_TYPE:
+			ab->qmi.target_mem[idx].paddr = ab->hw_params->bdf_addr;
+			ab->qmi.target_mem[idx].v.ioaddr = NULL;
+			ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size;
+			ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
+			idx++;
+			break;
+
 		case CALDB_MEM_REGION_TYPE:
 			/* Cold boot calibration is not enabled in Ath12k. Hence,
 			 * assign paddr = 0.