[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015182637.955753-12-quic_rajkbhag@quicinc.com>
Date: Tue, 15 Oct 2024 23:56:26 +0530
From: Raj Kumar Bhagat <quic_rajkbhag@...cinc.com>
To: <ath12k@...ts.infradead.org>
CC: <linux-wireless@...r.kernel.org>, Kalle Valo <kvalo@...nel.org>,
"Rob
Herring" <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
"Conor
Dooley" <conor+dt@...nel.org>,
Jeff Johnson <jjohnson@...nel.org>,
"Bjorn
Andersson" <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
Balamurugan S <quic_bselvara@...cinc.com>,
"P Praneesh" <quic_ppranees@...cinc.com>,
Raj Kumar Bhagat
<quic_rajkbhag@...cinc.com>
Subject: [PATCH v2 11/22] wifi: ath12k: remap CMEM register space for IPQ5332
From: Balamurugan S <quic_bselvara@...cinc.com>
In IPQ5332 CMEM region is outside of WCSS register block. Hence, add
hardware param cmem_remap for IPQ5332. This parameter would be used
by Ath12k AHB driver to remap the CMEM registers to a new space for
accessing them.
Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.3.1-00130-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
Signed-off-by: Balamurugan S <quic_bselvara@...cinc.com>
Co-developed-by: P Praneesh <quic_ppranees@...cinc.com>
Signed-off-by: P Praneesh <quic_ppranees@...cinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@...cinc.com>
---
drivers/net/wireless/ath/ath12k/core.h | 7 +++++++
drivers/net/wireless/ath/ath12k/hal.h | 4 ++++
drivers/net/wireless/ath/ath12k/hw.c | 9 +++++++++
drivers/net/wireless/ath/ath12k/hw.h | 1 +
4 files changed, 21 insertions(+)
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 126c9fed1fad..535ad8aeb453 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -722,6 +722,11 @@ struct ath12k_pdev {
struct mlo_timestamp timestamp;
};
+struct cmem_remap {
+ u32 base;
+ u32 size;
+};
+
struct ath12k_fw_pdev {
u32 pdev_id;
u32 phy_id;
@@ -787,6 +792,8 @@ struct ath12k_base {
void __iomem *mem;
unsigned long mem_len;
+ void __iomem *mem_cmem;
+
struct {
enum ath12k_bus bus;
const struct ath12k_hif_ops *ops;
diff --git a/drivers/net/wireless/ath/ath12k/hal.h b/drivers/net/wireless/ath/ath12k/hal.h
index 69579f118b81..2184da129966 100644
--- a/drivers/net/wireless/ath/ath12k/hal.h
+++ b/drivers/net/wireless/ath/ath12k/hal.h
@@ -372,6 +372,10 @@ struct ath12k_base;
* ath12k_hal_rx_desc_get_err().
*/
+#define HAL_IPQ5332_CMEM_REG_BASE 0xC100000
+#define HAL_IPQ5332_CMEM_SIZE 0x40000
+#define HAL_IPQ5332_CMEM_BASE 0x100000
+
enum hal_srng_ring_id {
HAL_SRNG_RING_ID_REO2SW0 = 0,
HAL_SRNG_RING_ID_REO2SW1,
diff --git a/drivers/net/wireless/ath/ath12k/hw.c b/drivers/net/wireless/ath/ath12k/hw.c
index a4e0c21ac4b7..bf1b62debacf 100644
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
@@ -1223,6 +1223,11 @@ static const struct ath12k_hw_hal_params ath12k_hw_hal_params_ipq5332 = {
HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW4_EN,
};
+static const struct cmem_remap ath12k_cmem_remap_ipq5332 = {
+ .base = HAL_IPQ5332_CMEM_REG_BASE,
+ .size = HAL_IPQ5332_CMEM_SIZE,
+};
+
static const struct ath12k_hw_params ath12k_hw_params[] = {
{
.name = "qcn9274 hw1.0",
@@ -1301,6 +1306,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_aspm = false,
.m3_fw_support = true,
+ .cmem_remap = NULL,
},
{
.name = "wcn7850 hw2.0",
@@ -1383,6 +1389,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_aspm = true,
.m3_fw_support = true,
+ .cmem_remap = NULL,
},
{
.name = "qcn9274 hw2.0",
@@ -1461,6 +1468,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_aspm = false,
.m3_fw_support = true,
+ .cmem_remap = NULL,
},
{
.name = "ipq5332 hw1.0",
@@ -1534,6 +1542,7 @@ static const struct ath12k_hw_params ath12k_hw_params[] = {
.supports_aspm = false,
.m3_fw_support = false,
+ .cmem_remap = &ath12k_cmem_remap_ipq5332,
},
};
diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h
index 22bd0a91b3e9..e30bec688b74 100644
--- a/drivers/net/wireless/ath/ath12k/hw.h
+++ b/drivers/net/wireless/ath/ath12k/hw.h
@@ -222,6 +222,7 @@ struct ath12k_hw_params {
u32 iova_mask;
bool m3_fw_support;
+ const struct cmem_remap *cmem_remap;
};
struct ath12k_hw_ops {
--
2.34.1
Powered by blists - more mailing lists