Skip to content

Commit a233811

Browse files
Anilkumar KolliKalle Valo
authored andcommitted
ath11k: Add qcn9074 mhi controller config
Add MHI config for QCN9074 also populate ath11k_hw_params for QCN9074. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1612946530-28504-6-git-send-email-akolli@codeaurora.org
1 parent 5f67d30 commit a233811

4 files changed

Lines changed: 122 additions & 8 deletions

File tree

‎drivers/net/wireless/ath/ath11k/core.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
147147
.cold_boot_calib = false,
148148
.supports_suspend = true,
149149
},
150+
{
151+
.name = "qcn9074 hw1.0",
152+
.hw_rev = ATH11K_HW_QCN9074_HW10,
153+
.fw = {
154+
.dir = "QCN9074/hw1.0",
155+
.board_size = 256 * 1024,
156+
.cal_size = 256 * 1024,
157+
},
158+
.max_radios = 1,
159+
.single_pdev_only = false,
160+
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074,
161+
},
150162
};
151163

152164
int ath11k_core_suspend(struct ath11k_base *ab)

‎drivers/net/wireless/ath/ath11k/core.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ enum ath11k_hw_rev {
105105
ATH11K_HW_IPQ8074,
106106
ATH11K_HW_QCA6390_HW20,
107107
ATH11K_HW_IPQ6018_HW10,
108+
ATH11K_HW_QCN9074_HW10,
108109
};
109110

110111
enum ath11k_firmware_mode {

‎drivers/net/wireless/ath/ath11k/mhi.c‎

Lines changed: 108 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
#include "core.h"
88
#include "debug.h"
99
#include "mhi.h"
10+
#include "pci.h"
1011

1112
#define MHI_TIMEOUT_DEFAULT_MS 90000
1213

13-
static struct mhi_channel_config ath11k_mhi_channels[] = {
14+
static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
1415
{
1516
.num = 0,
1617
.name = "LOOPBACK",
@@ -69,7 +70,7 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
6970
},
7071
};
7172

72-
static struct mhi_event_config ath11k_mhi_events[] = {
73+
static struct mhi_event_config ath11k_mhi_events_qca6390[] = {
7374
{
7475
.num_elements = 32,
7576
.irq_moderation_ms = 0,
@@ -92,15 +93,108 @@ static struct mhi_event_config ath11k_mhi_events[] = {
9293
},
9394
};
9495

95-
static struct mhi_controller_config ath11k_mhi_config = {
96+
static struct mhi_controller_config ath11k_mhi_config_qca6390 = {
9697
.max_channels = 128,
9798
.timeout_ms = 2000,
9899
.use_bounce_buf = false,
99100
.buf_len = 0,
100-
.num_channels = ARRAY_SIZE(ath11k_mhi_channels),
101-
.ch_cfg = ath11k_mhi_channels,
102-
.num_events = ARRAY_SIZE(ath11k_mhi_events),
103-
.event_cfg = ath11k_mhi_events,
101+
.num_channels = ARRAY_SIZE(ath11k_mhi_channels_qca6390),
102+
.ch_cfg = ath11k_mhi_channels_qca6390,
103+
.num_events = ARRAY_SIZE(ath11k_mhi_events_qca6390),
104+
.event_cfg = ath11k_mhi_events_qca6390,
105+
};
106+
107+
static struct mhi_channel_config ath11k_mhi_channels_qcn9074[] = {
108+
{
109+
.num = 0,
110+
.name = "LOOPBACK",
111+
.num_elements = 32,
112+
.event_ring = 1,
113+
.dir = DMA_TO_DEVICE,
114+
.ee_mask = 0x14,
115+
.pollcfg = 0,
116+
.doorbell = MHI_DB_BRST_DISABLE,
117+
.lpm_notify = false,
118+
.offload_channel = false,
119+
.doorbell_mode_switch = false,
120+
.auto_queue = false,
121+
},
122+
{
123+
.num = 1,
124+
.name = "LOOPBACK",
125+
.num_elements = 32,
126+
.event_ring = 1,
127+
.dir = DMA_FROM_DEVICE,
128+
.ee_mask = 0x14,
129+
.pollcfg = 0,
130+
.doorbell = MHI_DB_BRST_DISABLE,
131+
.lpm_notify = false,
132+
.offload_channel = false,
133+
.doorbell_mode_switch = false,
134+
.auto_queue = false,
135+
},
136+
{
137+
.num = 20,
138+
.name = "IPCR",
139+
.num_elements = 32,
140+
.event_ring = 1,
141+
.dir = DMA_TO_DEVICE,
142+
.ee_mask = 0x14,
143+
.pollcfg = 0,
144+
.doorbell = MHI_DB_BRST_DISABLE,
145+
.lpm_notify = false,
146+
.offload_channel = false,
147+
.doorbell_mode_switch = false,
148+
.auto_queue = false,
149+
},
150+
{
151+
.num = 21,
152+
.name = "IPCR",
153+
.num_elements = 32,
154+
.event_ring = 1,
155+
.dir = DMA_FROM_DEVICE,
156+
.ee_mask = 0x14,
157+
.pollcfg = 0,
158+
.doorbell = MHI_DB_BRST_DISABLE,
159+
.lpm_notify = false,
160+
.offload_channel = false,
161+
.doorbell_mode_switch = false,
162+
.auto_queue = true,
163+
},
164+
};
165+
166+
static struct mhi_event_config ath11k_mhi_events_qcn9074[] = {
167+
{
168+
.num_elements = 32,
169+
.irq_moderation_ms = 0,
170+
.irq = 1,
171+
.data_type = MHI_ER_CTRL,
172+
.mode = MHI_DB_BRST_DISABLE,
173+
.hardware_event = false,
174+
.client_managed = false,
175+
.offload_channel = false,
176+
},
177+
{
178+
.num_elements = 256,
179+
.irq_moderation_ms = 1,
180+
.irq = 2,
181+
.mode = MHI_DB_BRST_DISABLE,
182+
.priority = 1,
183+
.hardware_event = false,
184+
.client_managed = false,
185+
.offload_channel = false,
186+
},
187+
};
188+
189+
static struct mhi_controller_config ath11k_mhi_config_qcn9074 = {
190+
.max_channels = 30,
191+
.timeout_ms = 10000,
192+
.use_bounce_buf = false,
193+
.buf_len = 0,
194+
.num_channels = ARRAY_SIZE(ath11k_mhi_channels_qcn9074),
195+
.ch_cfg = ath11k_mhi_channels_qcn9074,
196+
.num_events = ARRAY_SIZE(ath11k_mhi_events_qcn9074),
197+
.event_cfg = ath11k_mhi_events_qcn9074,
104198
};
105199

106200
void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab)
@@ -221,6 +315,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
221315
{
222316
struct ath11k_base *ab = ab_pci->ab;
223317
struct mhi_controller *mhi_ctrl;
318+
struct mhi_controller_config *ath11k_mhi_config;
224319
int ret;
225320

226321
mhi_ctrl = mhi_alloc_controller();
@@ -254,7 +349,12 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
254349
mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
255350
mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
256351

257-
ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config);
352+
if (ab->hw_rev == ATH11K_HW_QCA6390_HW20)
353+
ath11k_mhi_config = &ath11k_mhi_config_qca6390;
354+
else if (ab->hw_rev == ATH11K_HW_QCN9074_HW10)
355+
ath11k_mhi_config = &ath11k_mhi_config_qcn9074;
356+
357+
ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config);
258358
if (ret) {
259359
ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret);
260360
mhi_free_controller(mhi_ctrl);

‎drivers/net/wireless/ath/ath11k/qmi.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02
2222
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01
2323
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02
24+
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07
2425
#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32
2526
#define ATH11K_QMI_RESP_LEN_MAX 8192
2627
#define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 52

0 commit comments

Comments
 (0)