xref: /linux/drivers/net/wireless/ath/ath12k/hw.c (revision bca5cfbb694d66a1c482d0c347eee80f6afbc870)
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
2 /*
3  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4  * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
5  */
6 
7 #include <linux/types.h>
8 #include <linux/bitops.h>
9 #include <linux/bitfield.h>
10 
11 #include "debug.h"
12 #include "core.h"
13 #include "ce.h"
14 #include "hw.h"
15 #include "mhi.h"
16 #include "dp_rx.h"
17 
18 static const guid_t wcn7850_uuid = GUID_INIT(0xf634f534, 0x6147, 0x11ec,
19 					     0x90, 0xd6, 0x02, 0x42,
20 					     0xac, 0x12, 0x00, 0x03);
21 
22 static u8 ath12k_hw_qcn9274_mac_from_pdev_id(int pdev_idx)
23 {
24 	return pdev_idx;
25 }
26 
27 static int ath12k_hw_mac_id_to_pdev_id_qcn9274(const struct ath12k_hw_params *hw,
28 					       int mac_id)
29 {
30 	return mac_id;
31 }
32 
33 static int ath12k_hw_mac_id_to_srng_id_qcn9274(const struct ath12k_hw_params *hw,
34 					       int mac_id)
35 {
36 	return 0;
37 }
38 
39 static u8 ath12k_hw_get_ring_selector_qcn9274(struct sk_buff *skb)
40 {
41 	return smp_processor_id();
42 }
43 
44 static bool ath12k_dp_srng_is_comp_ring_qcn9274(int ring_num)
45 {
46 	if (ring_num < 3 || ring_num == 4)
47 		return true;
48 
49 	return false;
50 }
51 
52 static int ath12k_hw_mac_id_to_pdev_id_wcn7850(const struct ath12k_hw_params *hw,
53 					       int mac_id)
54 {
55 	return 0;
56 }
57 
58 static int ath12k_hw_mac_id_to_srng_id_wcn7850(const struct ath12k_hw_params *hw,
59 					       int mac_id)
60 {
61 	return mac_id;
62 }
63 
64 static u8 ath12k_hw_get_ring_selector_wcn7850(struct sk_buff *skb)
65 {
66 	return skb_get_queue_mapping(skb);
67 }
68 
69 static bool ath12k_dp_srng_is_comp_ring_wcn7850(int ring_num)
70 {
71 	if (ring_num == 0 || ring_num == 2 || ring_num == 4)
72 		return true;
73 
74 	return false;
75 }
76 
77 static const struct ath12k_hw_ops qcn9274_ops = {
78 	.get_hw_mac_from_pdev_id = ath12k_hw_qcn9274_mac_from_pdev_id,
79 	.mac_id_to_pdev_id = ath12k_hw_mac_id_to_pdev_id_qcn9274,
80 	.mac_id_to_srng_id = ath12k_hw_mac_id_to_srng_id_qcn9274,
81 	.rxdma_ring_sel_config = ath12k_dp_rxdma_ring_sel_config_qcn9274,
82 	.get_ring_selector = ath12k_hw_get_ring_selector_qcn9274,
83 	.dp_srng_is_tx_comp_ring = ath12k_dp_srng_is_comp_ring_qcn9274,
84 };
85 
86 static const struct ath12k_hw_ops wcn7850_ops = {
87 	.get_hw_mac_from_pdev_id = ath12k_hw_qcn9274_mac_from_pdev_id,
88 	.mac_id_to_pdev_id = ath12k_hw_mac_id_to_pdev_id_wcn7850,
89 	.mac_id_to_srng_id = ath12k_hw_mac_id_to_srng_id_wcn7850,
90 	.rxdma_ring_sel_config = ath12k_dp_rxdma_ring_sel_config_wcn7850,
91 	.get_ring_selector = ath12k_hw_get_ring_selector_wcn7850,
92 	.dp_srng_is_tx_comp_ring = ath12k_dp_srng_is_comp_ring_wcn7850,
93 };
94 
95 #define ATH12K_TX_RING_MASK_0 0x1
96 #define ATH12K_TX_RING_MASK_1 0x2
97 #define ATH12K_TX_RING_MASK_2 0x4
98 #define ATH12K_TX_RING_MASK_3 0x8
99 #define ATH12K_TX_RING_MASK_4 0x10
100 
101 #define ATH12K_RX_RING_MASK_0 0x1
102 #define ATH12K_RX_RING_MASK_1 0x2
103 #define ATH12K_RX_RING_MASK_2 0x4
104 #define ATH12K_RX_RING_MASK_3 0x8
105 
106 #define ATH12K_RX_ERR_RING_MASK_0 0x1
107 
108 #define ATH12K_RX_WBM_REL_RING_MASK_0 0x1
109 
110 #define ATH12K_REO_STATUS_RING_MASK_0 0x1
111 
112 #define ATH12K_HOST2RXDMA_RING_MASK_0 0x1
113 
114 #define ATH12K_RX_MON_RING_MASK_0 0x1
115 #define ATH12K_RX_MON_RING_MASK_1 0x2
116 #define ATH12K_RX_MON_RING_MASK_2 0x4
117 
118 #define ATH12K_TX_MON_RING_MASK_0 0x1
119 #define ATH12K_TX_MON_RING_MASK_1 0x2
120 
121 #define ATH12K_RX_MON_STATUS_RING_MASK_0 0x1
122 #define ATH12K_RX_MON_STATUS_RING_MASK_1 0x2
123 #define ATH12K_RX_MON_STATUS_RING_MASK_2 0x4
124 
125 /* Target firmware's Copy Engine configuration. */
126 static const struct ce_pipe_config ath12k_target_ce_config_wlan_qcn9274[] = {
127 	/* CE0: host->target HTC control and raw streams */
128 	{
129 		.pipenum = __cpu_to_le32(0),
130 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
131 		.nentries = __cpu_to_le32(32),
132 		.nbytes_max = __cpu_to_le32(2048),
133 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
134 		.reserved = __cpu_to_le32(0),
135 	},
136 
137 	/* CE1: target->host HTT + HTC control */
138 	{
139 		.pipenum = __cpu_to_le32(1),
140 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
141 		.nentries = __cpu_to_le32(32),
142 		.nbytes_max = __cpu_to_le32(2048),
143 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
144 		.reserved = __cpu_to_le32(0),
145 	},
146 
147 	/* CE2: target->host WMI */
148 	{
149 		.pipenum = __cpu_to_le32(2),
150 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
151 		.nentries = __cpu_to_le32(32),
152 		.nbytes_max = __cpu_to_le32(2048),
153 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
154 		.reserved = __cpu_to_le32(0),
155 	},
156 
157 	/* CE3: host->target WMI (mac0) */
158 	{
159 		.pipenum = __cpu_to_le32(3),
160 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
161 		.nentries = __cpu_to_le32(32),
162 		.nbytes_max = __cpu_to_le32(2048),
163 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
164 		.reserved = __cpu_to_le32(0),
165 	},
166 
167 	/* CE4: host->target HTT */
168 	{
169 		.pipenum = __cpu_to_le32(4),
170 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
171 		.nentries = __cpu_to_le32(256),
172 		.nbytes_max = __cpu_to_le32(256),
173 		.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
174 		.reserved = __cpu_to_le32(0),
175 	},
176 
177 	/* CE5: target->host Pktlog */
178 	{
179 		.pipenum = __cpu_to_le32(5),
180 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
181 		.nentries = __cpu_to_le32(32),
182 		.nbytes_max = __cpu_to_le32(2048),
183 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
184 		.reserved = __cpu_to_le32(0),
185 	},
186 
187 	/* CE6: Reserved for target autonomous hif_memcpy */
188 	{
189 		.pipenum = __cpu_to_le32(6),
190 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
191 		.nentries = __cpu_to_le32(32),
192 		.nbytes_max = __cpu_to_le32(16384),
193 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
194 		.reserved = __cpu_to_le32(0),
195 	},
196 
197 	/* CE7: host->target WMI (mac1) */
198 	{
199 		.pipenum = __cpu_to_le32(7),
200 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
201 		.nentries = __cpu_to_le32(32),
202 		.nbytes_max = __cpu_to_le32(2048),
203 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
204 		.reserved = __cpu_to_le32(0),
205 	},
206 
207 	/* CE8: Reserved for target autonomous hif_memcpy */
208 	{
209 		.pipenum = __cpu_to_le32(8),
210 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
211 		.nentries = __cpu_to_le32(32),
212 		.nbytes_max = __cpu_to_le32(16384),
213 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
214 		.reserved = __cpu_to_le32(0),
215 	},
216 
217 	/* CE9, 10 and 11: Reserved for MHI */
218 
219 	/* CE12: Target CV prefetch */
220 	{
221 		.pipenum = __cpu_to_le32(12),
222 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
223 		.nentries = __cpu_to_le32(32),
224 		.nbytes_max = __cpu_to_le32(2048),
225 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
226 		.reserved = __cpu_to_le32(0),
227 	},
228 
229 	/* CE13: Target CV prefetch */
230 	{
231 		.pipenum = __cpu_to_le32(13),
232 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
233 		.nentries = __cpu_to_le32(32),
234 		.nbytes_max = __cpu_to_le32(2048),
235 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
236 		.reserved = __cpu_to_le32(0),
237 	},
238 
239 	/* CE14: WMI logging/CFR/Spectral/Radar */
240 	{
241 		.pipenum = __cpu_to_le32(14),
242 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
243 		.nentries = __cpu_to_le32(32),
244 		.nbytes_max = __cpu_to_le32(2048),
245 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
246 		.reserved = __cpu_to_le32(0),
247 	},
248 
249 	/* CE15: Reserved */
250 };
251 
252 /* Target firmware's Copy Engine configuration. */
253 static const struct ce_pipe_config ath12k_target_ce_config_wlan_wcn7850[] = {
254 	/* CE0: host->target HTC control and raw streams */
255 	{
256 		.pipenum = __cpu_to_le32(0),
257 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
258 		.nentries = __cpu_to_le32(32),
259 		.nbytes_max = __cpu_to_le32(2048),
260 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
261 		.reserved = __cpu_to_le32(0),
262 	},
263 
264 	/* CE1: target->host HTT + HTC control */
265 	{
266 		.pipenum = __cpu_to_le32(1),
267 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
268 		.nentries = __cpu_to_le32(32),
269 		.nbytes_max = __cpu_to_le32(2048),
270 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
271 		.reserved = __cpu_to_le32(0),
272 	},
273 
274 	/* CE2: target->host WMI */
275 	{
276 		.pipenum = __cpu_to_le32(2),
277 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
278 		.nentries = __cpu_to_le32(32),
279 		.nbytes_max = __cpu_to_le32(2048),
280 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
281 		.reserved = __cpu_to_le32(0),
282 	},
283 
284 	/* CE3: host->target WMI */
285 	{
286 		.pipenum = __cpu_to_le32(3),
287 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
288 		.nentries = __cpu_to_le32(32),
289 		.nbytes_max = __cpu_to_le32(2048),
290 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
291 		.reserved = __cpu_to_le32(0),
292 	},
293 
294 	/* CE4: host->target HTT */
295 	{
296 		.pipenum = __cpu_to_le32(4),
297 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
298 		.nentries = __cpu_to_le32(256),
299 		.nbytes_max = __cpu_to_le32(256),
300 		.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
301 		.reserved = __cpu_to_le32(0),
302 	},
303 
304 	/* CE5: target->host Pktlog */
305 	{
306 		.pipenum = __cpu_to_le32(5),
307 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
308 		.nentries = __cpu_to_le32(32),
309 		.nbytes_max = __cpu_to_le32(2048),
310 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
311 		.reserved = __cpu_to_le32(0),
312 	},
313 
314 	/* CE6: Reserved for target autonomous hif_memcpy */
315 	{
316 		.pipenum = __cpu_to_le32(6),
317 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
318 		.nentries = __cpu_to_le32(32),
319 		.nbytes_max = __cpu_to_le32(16384),
320 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
321 		.reserved = __cpu_to_le32(0),
322 	},
323 
324 	/* CE7 used only by Host */
325 	{
326 		.pipenum = __cpu_to_le32(7),
327 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H),
328 		.nentries = __cpu_to_le32(0),
329 		.nbytes_max = __cpu_to_le32(0),
330 		.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
331 		.reserved = __cpu_to_le32(0),
332 	},
333 
334 	/* CE8 target->host used only by IPA */
335 	{
336 		.pipenum = __cpu_to_le32(8),
337 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
338 		.nentries = __cpu_to_le32(32),
339 		.nbytes_max = __cpu_to_le32(16384),
340 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
341 		.reserved = __cpu_to_le32(0),
342 	},
343 	/* CE 9, 10, 11 are used by MHI driver */
344 };
345 
346 /* Map from service/endpoint to Copy Engine.
347  * This table is derived from the CE_PCI TABLE, above.
348  * It is passed to the Target at startup for use by firmware.
349  */
350 static const struct service_to_pipe ath12k_target_service_to_ce_map_wlan_qcn9274[] = {
351 	{
352 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
353 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
354 		__cpu_to_le32(3),
355 	},
356 	{
357 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
358 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
359 		__cpu_to_le32(2),
360 	},
361 	{
362 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
363 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
364 		__cpu_to_le32(3),
365 	},
366 	{
367 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
368 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
369 		__cpu_to_le32(2),
370 	},
371 	{
372 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
373 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
374 		__cpu_to_le32(3),
375 	},
376 	{
377 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
378 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
379 		__cpu_to_le32(2),
380 	},
381 	{
382 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
383 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
384 		__cpu_to_le32(3),
385 	},
386 	{
387 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
388 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
389 		__cpu_to_le32(2),
390 	},
391 	{
392 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
393 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
394 		__cpu_to_le32(3),
395 	},
396 	{
397 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
398 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
399 		__cpu_to_le32(2),
400 	},
401 	{
402 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
403 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
404 		__cpu_to_le32(0),
405 	},
406 	{
407 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
408 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
409 		__cpu_to_le32(1),
410 	},
411 	{
412 		__cpu_to_le32(ATH12K_HTC_SVC_ID_TEST_RAW_STREAMS),
413 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
414 		__cpu_to_le32(0),
415 	},
416 	{
417 		__cpu_to_le32(ATH12K_HTC_SVC_ID_TEST_RAW_STREAMS),
418 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
419 		__cpu_to_le32(1),
420 	},
421 	{
422 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
423 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
424 		__cpu_to_le32(4),
425 	},
426 	{
427 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
428 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
429 		__cpu_to_le32(1),
430 	},
431 	{
432 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL_MAC1),
433 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
434 		__cpu_to_le32(7),
435 	},
436 	{
437 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL_MAC1),
438 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
439 		__cpu_to_le32(2),
440 	},
441 	{
442 		__cpu_to_le32(ATH12K_HTC_SVC_ID_PKT_LOG),
443 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
444 		__cpu_to_le32(5),
445 	},
446 	{
447 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL_DIAG),
448 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
449 		__cpu_to_le32(14),
450 	},
451 
452 	/* (Additions here) */
453 
454 	{ /* must be last */
455 		__cpu_to_le32(0),
456 		__cpu_to_le32(0),
457 		__cpu_to_le32(0),
458 	},
459 };
460 
461 static const struct service_to_pipe ath12k_target_service_to_ce_map_wlan_wcn7850[] = {
462 	{
463 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
464 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
465 		__cpu_to_le32(3),
466 	},
467 	{
468 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
469 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
470 		__cpu_to_le32(2),
471 	},
472 	{
473 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
474 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
475 		__cpu_to_le32(3),
476 	},
477 	{
478 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
479 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
480 		__cpu_to_le32(2),
481 	},
482 	{
483 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
484 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
485 		__cpu_to_le32(3),
486 	},
487 	{
488 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
489 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
490 		__cpu_to_le32(2),
491 	},
492 	{
493 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
494 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
495 		__cpu_to_le32(3),
496 	},
497 	{
498 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
499 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
500 		__cpu_to_le32(2),
501 	},
502 	{
503 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
504 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
505 		__cpu_to_le32(3),
506 	},
507 	{
508 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
509 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
510 		__cpu_to_le32(2),
511 	},
512 	{
513 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
514 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
515 		__cpu_to_le32(0),
516 	},
517 	{
518 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
519 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
520 		__cpu_to_le32(2),
521 	},
522 	{
523 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
524 		__cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
525 		__cpu_to_le32(4),
526 	},
527 	{
528 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
529 		__cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
530 		__cpu_to_le32(1),
531 	},
532 
533 	/* (Additions here) */
534 
535 	{ /* must be last */
536 		__cpu_to_le32(0),
537 		__cpu_to_le32(0),
538 		__cpu_to_le32(0),
539 	},
540 };
541 
542 static const struct ce_pipe_config ath12k_target_ce_config_wlan_ipq5332[] = {
543 	/* host->target HTC control and raw streams */
544 	{
545 		.pipenum = __cpu_to_le32(0),
546 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
547 		.nentries = __cpu_to_le32(32),
548 		.nbytes_max = __cpu_to_le32(2048),
549 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
550 		.reserved = __cpu_to_le32(0),
551 	},
552 	/* target->host HTT */
553 	{
554 		.pipenum = __cpu_to_le32(1),
555 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
556 		.nentries = __cpu_to_le32(32),
557 		.nbytes_max = __cpu_to_le32(2048),
558 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
559 		.reserved = __cpu_to_le32(0),
560 	},
561 	/* target->host WMI  + HTC control */
562 	{
563 		.pipenum = __cpu_to_le32(2),
564 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
565 		.nentries = __cpu_to_le32(32),
566 		.nbytes_max = __cpu_to_le32(2048),
567 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
568 		.reserved = __cpu_to_le32(0),
569 	},
570 	/* host->target WMI */
571 	{
572 		.pipenum = __cpu_to_le32(3),
573 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
574 		.nentries = __cpu_to_le32(32),
575 		.nbytes_max = __cpu_to_le32(2048),
576 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
577 		.reserved = __cpu_to_le32(0),
578 	},
579 	/* host->target HTT */
580 	{
581 		.pipenum = __cpu_to_le32(4),
582 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
583 		.nentries = __cpu_to_le32(256),
584 		.nbytes_max = __cpu_to_le32(256),
585 		.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
586 		.reserved = __cpu_to_le32(0),
587 	},
588 	/* Target -> host PKTLOG */
589 	{
590 		.pipenum = __cpu_to_le32(5),
591 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
592 		.nentries = __cpu_to_le32(32),
593 		.nbytes_max = __cpu_to_le32(2048),
594 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
595 		.reserved = __cpu_to_le32(0),
596 	},
597 	/* Reserved for target autonomous HIF_memcpy */
598 	{
599 		.pipenum = __cpu_to_le32(6),
600 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
601 		.nentries = __cpu_to_le32(32),
602 		.nbytes_max = __cpu_to_le32(16384),
603 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
604 		.reserved = __cpu_to_le32(0),
605 	},
606 	/* CE7 Reserved for CV Prefetch */
607 	{
608 		.pipenum = __cpu_to_le32(7),
609 		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
610 		.nentries = __cpu_to_le32(32),
611 		.nbytes_max = __cpu_to_le32(2048),
612 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
613 		.reserved = __cpu_to_le32(0),
614 	},
615 	/* CE8 Reserved for target generic HIF memcpy */
616 	{
617 		.pipenum = __cpu_to_le32(8),
618 		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
619 		.nentries = __cpu_to_le32(32),
620 		.nbytes_max = __cpu_to_le32(16384),
621 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
622 		.reserved = __cpu_to_le32(0),
623 	},
624 	/* CE9 WMI logging/CFR/Spectral/Radar/ */
625 	{
626 		.pipenum = __cpu_to_le32(9),
627 		.pipedir = __cpu_to_le32(PIPEDIR_IN),
628 		.nentries = __cpu_to_le32(32),
629 		.nbytes_max = __cpu_to_le32(2048),
630 		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
631 		.reserved = __cpu_to_le32(0),
632 	},
633 	/* Unused TBD */
634 	{
635 		.pipenum = __cpu_to_le32(10),
636 		.pipedir = __cpu_to_le32(PIPEDIR_NONE),
637 		.nentries = __cpu_to_le32(0),
638 		.nbytes_max = __cpu_to_le32(0),
639 		.flags = __cpu_to_le32(0),
640 		.reserved = __cpu_to_le32(0),
641 	},
642 	/* Unused TBD */
643 	{
644 		.pipenum = __cpu_to_le32(11),
645 		.pipedir = __cpu_to_le32(PIPEDIR_NONE),
646 		.nentries = __cpu_to_le32(0),
647 		.nbytes_max = __cpu_to_le32(0),
648 		.flags = __cpu_to_le32(0),
649 		.reserved = __cpu_to_le32(0),
650 	},
651 };
652 
653 static const struct service_to_pipe ath12k_target_service_to_ce_map_wlan_ipq5332[] = {
654 	{
655 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
656 		__cpu_to_le32(PIPEDIR_OUT),
657 		__cpu_to_le32(3),
658 	},
659 	{
660 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VO),
661 		__cpu_to_le32(PIPEDIR_IN),
662 		__cpu_to_le32(2),
663 	},
664 	{
665 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
666 		__cpu_to_le32(PIPEDIR_OUT),
667 		__cpu_to_le32(3),
668 	},
669 	{
670 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BK),
671 		__cpu_to_le32(PIPEDIR_IN),
672 		__cpu_to_le32(2),
673 	},
674 	{
675 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
676 		__cpu_to_le32(PIPEDIR_OUT),
677 		__cpu_to_le32(3),
678 	},
679 	{
680 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_BE),
681 		__cpu_to_le32(PIPEDIR_IN),
682 		__cpu_to_le32(2),
683 	},
684 	{
685 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
686 		__cpu_to_le32(PIPEDIR_OUT),
687 		__cpu_to_le32(3),
688 	},
689 	{
690 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_DATA_VI),
691 		__cpu_to_le32(PIPEDIR_IN),
692 		__cpu_to_le32(2),
693 	},
694 	{
695 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
696 		__cpu_to_le32(PIPEDIR_OUT),
697 		__cpu_to_le32(3),
698 	},
699 	{
700 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL),
701 		__cpu_to_le32(PIPEDIR_IN),
702 		__cpu_to_le32(2),
703 	},
704 	{
705 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
706 		__cpu_to_le32(PIPEDIR_OUT),
707 		__cpu_to_le32(0),
708 	},
709 	{
710 		__cpu_to_le32(ATH12K_HTC_SVC_ID_RSVD_CTRL),
711 		__cpu_to_le32(PIPEDIR_IN),
712 		__cpu_to_le32(1),
713 	},
714 	{
715 		__cpu_to_le32(ATH12K_HTC_SVC_ID_TEST_RAW_STREAMS),
716 		__cpu_to_le32(PIPEDIR_OUT),
717 		__cpu_to_le32(0),
718 	},
719 	{
720 		__cpu_to_le32(ATH12K_HTC_SVC_ID_TEST_RAW_STREAMS),
721 		__cpu_to_le32(PIPEDIR_IN),
722 		__cpu_to_le32(1),
723 	},
724 	{
725 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
726 		__cpu_to_le32(PIPEDIR_OUT),
727 		__cpu_to_le32(4),
728 	},
729 	{
730 		__cpu_to_le32(ATH12K_HTC_SVC_ID_HTT_DATA_MSG),
731 		__cpu_to_le32(PIPEDIR_IN),
732 		__cpu_to_le32(1),
733 	},
734 	{
735 		__cpu_to_le32(ATH12K_HTC_SVC_ID_PKT_LOG),
736 		__cpu_to_le32(PIPEDIR_IN),
737 		__cpu_to_le32(5),
738 	},
739 	{
740 		__cpu_to_le32(ATH12K_HTC_SVC_ID_WMI_CONTROL_DIAG),
741 		__cpu_to_le32(PIPEDIR_IN),
742 		__cpu_to_le32(9),
743 	},
744 	/* (Additions here) */
745 
746 	{ /* must be last */
747 		__cpu_to_le32(0),
748 		__cpu_to_le32(0),
749 		__cpu_to_le32(0),
750 	},
751 };
752 
753 static const struct ath12k_hw_ring_mask ath12k_hw_ring_mask_qcn9274 = {
754 	.tx  = {
755 		ATH12K_TX_RING_MASK_0,
756 		ATH12K_TX_RING_MASK_1,
757 		ATH12K_TX_RING_MASK_2,
758 		ATH12K_TX_RING_MASK_3,
759 	},
760 	.rx_mon_dest = {
761 		0, 0, 0, 0,
762 		0, 0, 0, 0,
763 		ATH12K_RX_MON_RING_MASK_0,
764 		ATH12K_RX_MON_RING_MASK_1,
765 		ATH12K_RX_MON_RING_MASK_2,
766 	},
767 	.rx = {
768 		0, 0, 0, 0,
769 		ATH12K_RX_RING_MASK_0,
770 		ATH12K_RX_RING_MASK_1,
771 		ATH12K_RX_RING_MASK_2,
772 		ATH12K_RX_RING_MASK_3,
773 	},
774 	.rx_err = {
775 		0, 0, 0,
776 		ATH12K_RX_ERR_RING_MASK_0,
777 	},
778 	.rx_wbm_rel = {
779 		0, 0, 0,
780 		ATH12K_RX_WBM_REL_RING_MASK_0,
781 	},
782 	.reo_status = {
783 		0, 0, 0,
784 		ATH12K_REO_STATUS_RING_MASK_0,
785 	},
786 	.host2rxdma = {
787 		0, 0, 0,
788 		ATH12K_HOST2RXDMA_RING_MASK_0,
789 	},
790 	.tx_mon_dest = {
791 		0, 0, 0,
792 	},
793 };
794 
795 static const struct ath12k_hw_ring_mask ath12k_hw_ring_mask_ipq5332 = {
796 	.tx  = {
797 		ATH12K_TX_RING_MASK_0,
798 		ATH12K_TX_RING_MASK_1,
799 		ATH12K_TX_RING_MASK_2,
800 		ATH12K_TX_RING_MASK_3,
801 	},
802 	.rx_mon_dest = {
803 		0, 0, 0, 0, 0, 0, 0, 0,
804 		ATH12K_RX_MON_RING_MASK_0,
805 	},
806 	.rx = {
807 		0, 0, 0, 0,
808 		ATH12K_RX_RING_MASK_0,
809 		ATH12K_RX_RING_MASK_1,
810 		ATH12K_RX_RING_MASK_2,
811 		ATH12K_RX_RING_MASK_3,
812 	},
813 	.rx_err = {
814 		0, 0, 0,
815 		ATH12K_RX_ERR_RING_MASK_0,
816 	},
817 	.rx_wbm_rel = {
818 		0, 0, 0,
819 		ATH12K_RX_WBM_REL_RING_MASK_0,
820 	},
821 	.reo_status = {
822 		0, 0, 0,
823 		ATH12K_REO_STATUS_RING_MASK_0,
824 	},
825 	.host2rxdma = {
826 		0, 0, 0,
827 		ATH12K_HOST2RXDMA_RING_MASK_0,
828 	},
829 	.tx_mon_dest = {
830 		ATH12K_TX_MON_RING_MASK_0,
831 		ATH12K_TX_MON_RING_MASK_1,
832 	},
833 };
834 
835 static const struct ath12k_hw_ring_mask ath12k_hw_ring_mask_wcn7850 = {
836 	.tx  = {
837 		ATH12K_TX_RING_MASK_0,
838 		ATH12K_TX_RING_MASK_1,
839 		ATH12K_TX_RING_MASK_2,
840 	},
841 	.rx_mon_dest = {
842 	},
843 	.rx_mon_status = {
844 		0, 0, 0, 0,
845 		ATH12K_RX_MON_STATUS_RING_MASK_0,
846 		ATH12K_RX_MON_STATUS_RING_MASK_1,
847 		ATH12K_RX_MON_STATUS_RING_MASK_2,
848 	},
849 	.rx = {
850 		0, 0, 0,
851 		ATH12K_RX_RING_MASK_0,
852 		ATH12K_RX_RING_MASK_1,
853 		ATH12K_RX_RING_MASK_2,
854 		ATH12K_RX_RING_MASK_3,
855 	},
856 	.rx_err = {
857 		ATH12K_RX_ERR_RING_MASK_0,
858 	},
859 	.rx_wbm_rel = {
860 		ATH12K_RX_WBM_REL_RING_MASK_0,
861 	},
862 	.reo_status = {
863 		ATH12K_REO_STATUS_RING_MASK_0,
864 	},
865 	.host2rxdma = {
866 	},
867 	.tx_mon_dest = {
868 	},
869 };
870 
871 static const struct ath12k_hw_regs qcn9274_v1_regs = {
872 	/* SW2TCL(x) R0 ring configuration address */
873 	.hal_tcl1_ring_id = 0x00000908,
874 	.hal_tcl1_ring_misc = 0x00000910,
875 	.hal_tcl1_ring_tp_addr_lsb = 0x0000091c,
876 	.hal_tcl1_ring_tp_addr_msb = 0x00000920,
877 	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000930,
878 	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000934,
879 	.hal_tcl1_ring_msi1_base_lsb = 0x00000948,
880 	.hal_tcl1_ring_msi1_base_msb = 0x0000094c,
881 	.hal_tcl1_ring_msi1_data = 0x00000950,
882 	.hal_tcl_ring_base_lsb = 0x00000b58,
883 	.hal_tcl1_ring_base_lsb = 0x00000900,
884 	.hal_tcl1_ring_base_msb = 0x00000904,
885 	.hal_tcl2_ring_base_lsb = 0x00000978,
886 
887 	/* TCL STATUS ring address */
888 	.hal_tcl_status_ring_base_lsb = 0x00000d38,
889 
890 	.hal_wbm_idle_ring_base_lsb = 0x00000d0c,
891 	.hal_wbm_idle_ring_misc_addr = 0x00000d1c,
892 	.hal_wbm_r0_idle_list_cntl_addr = 0x00000210,
893 	.hal_wbm_r0_idle_list_size_addr = 0x00000214,
894 	.hal_wbm_scattered_ring_base_lsb = 0x00000220,
895 	.hal_wbm_scattered_ring_base_msb = 0x00000224,
896 	.hal_wbm_scattered_desc_head_info_ix0 = 0x00000230,
897 	.hal_wbm_scattered_desc_head_info_ix1 = 0x00000234,
898 	.hal_wbm_scattered_desc_tail_info_ix0 = 0x00000240,
899 	.hal_wbm_scattered_desc_tail_info_ix1 = 0x00000244,
900 	.hal_wbm_scattered_desc_ptr_hp_addr = 0x0000024c,
901 
902 	.hal_wbm_sw_release_ring_base_lsb = 0x0000034c,
903 	.hal_wbm_sw1_release_ring_base_lsb = 0x000003c4,
904 	.hal_wbm0_release_ring_base_lsb = 0x00000dd8,
905 	.hal_wbm1_release_ring_base_lsb = 0x00000e50,
906 
907 	/* PCIe base address */
908 	.pcie_qserdes_sysclk_en_sel = 0x01e0c0a8,
909 	.pcie_pcs_osc_dtct_config_base = 0x01e0d45c,
910 
911 	/* PPE release ring address */
912 	.hal_ppe_rel_ring_base = 0x0000043c,
913 
914 	/* REO DEST ring address */
915 	.hal_reo2_ring_base = 0x0000055c,
916 	.hal_reo1_misc_ctrl_addr = 0x00000b7c,
917 	.hal_reo1_sw_cookie_cfg0 = 0x00000050,
918 	.hal_reo1_sw_cookie_cfg1 = 0x00000054,
919 	.hal_reo1_qdesc_lut_base0 = 0x00000058,
920 	.hal_reo1_qdesc_lut_base1 = 0x0000005c,
921 	.hal_reo1_ring_base_lsb = 0x000004e4,
922 	.hal_reo1_ring_base_msb = 0x000004e8,
923 	.hal_reo1_ring_id = 0x000004ec,
924 	.hal_reo1_ring_misc = 0x000004f4,
925 	.hal_reo1_ring_hp_addr_lsb = 0x000004f8,
926 	.hal_reo1_ring_hp_addr_msb = 0x000004fc,
927 	.hal_reo1_ring_producer_int_setup = 0x00000508,
928 	.hal_reo1_ring_msi1_base_lsb = 0x0000052C,
929 	.hal_reo1_ring_msi1_base_msb = 0x00000530,
930 	.hal_reo1_ring_msi1_data = 0x00000534,
931 	.hal_reo1_aging_thres_ix0 = 0x00000b08,
932 	.hal_reo1_aging_thres_ix1 = 0x00000b0c,
933 	.hal_reo1_aging_thres_ix2 = 0x00000b10,
934 	.hal_reo1_aging_thres_ix3 = 0x00000b14,
935 
936 	/* REO Exception ring address */
937 	.hal_reo2_sw0_ring_base = 0x000008a4,
938 
939 	/* REO Reinject ring address */
940 	.hal_sw2reo_ring_base = 0x00000304,
941 	.hal_sw2reo1_ring_base = 0x0000037c,
942 
943 	/* REO cmd ring address */
944 	.hal_reo_cmd_ring_base = 0x0000028c,
945 
946 	/* REO status ring address */
947 	.hal_reo_status_ring_base = 0x00000a84,
948 
949 	/* CE base address */
950 	.hal_umac_ce0_src_reg_base = 0x01b80000,
951 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
952 	.hal_umac_ce1_src_reg_base = 0x01b82000,
953 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
954 };
955 
956 static const struct ath12k_hw_regs qcn9274_v2_regs = {
957 	/* SW2TCL(x) R0 ring configuration address */
958 	.hal_tcl1_ring_id = 0x00000908,
959 	.hal_tcl1_ring_misc = 0x00000910,
960 	.hal_tcl1_ring_tp_addr_lsb = 0x0000091c,
961 	.hal_tcl1_ring_tp_addr_msb = 0x00000920,
962 	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000930,
963 	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000934,
964 	.hal_tcl1_ring_msi1_base_lsb = 0x00000948,
965 	.hal_tcl1_ring_msi1_base_msb = 0x0000094c,
966 	.hal_tcl1_ring_msi1_data = 0x00000950,
967 	.hal_tcl_ring_base_lsb = 0x00000b58,
968 	.hal_tcl1_ring_base_lsb = 0x00000900,
969 	.hal_tcl1_ring_base_msb = 0x00000904,
970 	.hal_tcl2_ring_base_lsb = 0x00000978,
971 
972 	/* TCL STATUS ring address */
973 	.hal_tcl_status_ring_base_lsb = 0x00000d38,
974 
975 	/* WBM idle link ring address */
976 	.hal_wbm_idle_ring_base_lsb = 0x00000d3c,
977 	.hal_wbm_idle_ring_misc_addr = 0x00000d4c,
978 	.hal_wbm_r0_idle_list_cntl_addr = 0x00000240,
979 	.hal_wbm_r0_idle_list_size_addr = 0x00000244,
980 	.hal_wbm_scattered_ring_base_lsb = 0x00000250,
981 	.hal_wbm_scattered_ring_base_msb = 0x00000254,
982 	.hal_wbm_scattered_desc_head_info_ix0 = 0x00000260,
983 	.hal_wbm_scattered_desc_head_info_ix1 = 0x00000264,
984 	.hal_wbm_scattered_desc_tail_info_ix0 = 0x00000270,
985 	.hal_wbm_scattered_desc_tail_info_ix1 = 0x00000274,
986 	.hal_wbm_scattered_desc_ptr_hp_addr = 0x0000027c,
987 
988 	/* SW2WBM release ring address */
989 	.hal_wbm_sw_release_ring_base_lsb = 0x0000037c,
990 	.hal_wbm_sw1_release_ring_base_lsb = 0x000003f4,
991 
992 	/* WBM2SW release ring address */
993 	.hal_wbm0_release_ring_base_lsb = 0x00000e08,
994 	.hal_wbm1_release_ring_base_lsb = 0x00000e80,
995 
996 	/* PCIe base address */
997 	.pcie_qserdes_sysclk_en_sel = 0x01e0c0a8,
998 	.pcie_pcs_osc_dtct_config_base = 0x01e0d45c,
999 
1000 	/* PPE release ring address */
1001 	.hal_ppe_rel_ring_base = 0x0000046c,
1002 
1003 	/* REO DEST ring address */
1004 	.hal_reo2_ring_base = 0x00000578,
1005 	.hal_reo1_misc_ctrl_addr = 0x00000b9c,
1006 	.hal_reo1_sw_cookie_cfg0 = 0x0000006c,
1007 	.hal_reo1_sw_cookie_cfg1 = 0x00000070,
1008 	.hal_reo1_qdesc_lut_base0 = 0x00000074,
1009 	.hal_reo1_qdesc_lut_base1 = 0x00000078,
1010 	.hal_reo1_qdesc_addr = 0x0000007c,
1011 	.hal_reo1_qdesc_max_peerid = 0x00000088,
1012 	.hal_reo1_ring_base_lsb = 0x00000500,
1013 	.hal_reo1_ring_base_msb = 0x00000504,
1014 	.hal_reo1_ring_id = 0x00000508,
1015 	.hal_reo1_ring_misc = 0x00000510,
1016 	.hal_reo1_ring_hp_addr_lsb = 0x00000514,
1017 	.hal_reo1_ring_hp_addr_msb = 0x00000518,
1018 	.hal_reo1_ring_producer_int_setup = 0x00000524,
1019 	.hal_reo1_ring_msi1_base_lsb = 0x00000548,
1020 	.hal_reo1_ring_msi1_base_msb = 0x0000054C,
1021 	.hal_reo1_ring_msi1_data = 0x00000550,
1022 	.hal_reo1_aging_thres_ix0 = 0x00000B28,
1023 	.hal_reo1_aging_thres_ix1 = 0x00000B2C,
1024 	.hal_reo1_aging_thres_ix2 = 0x00000B30,
1025 	.hal_reo1_aging_thres_ix3 = 0x00000B34,
1026 
1027 	/* REO Exception ring address */
1028 	.hal_reo2_sw0_ring_base = 0x000008c0,
1029 
1030 	/* REO Reinject ring address */
1031 	.hal_sw2reo_ring_base = 0x00000320,
1032 	.hal_sw2reo1_ring_base = 0x00000398,
1033 
1034 	/* REO cmd ring address */
1035 	.hal_reo_cmd_ring_base = 0x000002A8,
1036 
1037 	/* REO status ring address */
1038 	.hal_reo_status_ring_base = 0x00000aa0,
1039 
1040 	/* CE base address */
1041 	.hal_umac_ce0_src_reg_base = 0x01b80000,
1042 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
1043 	.hal_umac_ce1_src_reg_base = 0x01b82000,
1044 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
1045 };
1046 
1047 static const struct ath12k_hw_regs ipq5332_regs = {
1048 	/* SW2TCL(x) R0 ring configuration address */
1049 	.hal_tcl1_ring_id = 0x00000918,
1050 	.hal_tcl1_ring_misc = 0x00000920,
1051 	.hal_tcl1_ring_tp_addr_lsb = 0x0000092c,
1052 	.hal_tcl1_ring_tp_addr_msb = 0x00000930,
1053 	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000940,
1054 	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000944,
1055 	.hal_tcl1_ring_msi1_base_lsb = 0x00000958,
1056 	.hal_tcl1_ring_msi1_base_msb = 0x0000095c,
1057 	.hal_tcl1_ring_base_lsb = 0x00000910,
1058 	.hal_tcl1_ring_base_msb = 0x00000914,
1059 	.hal_tcl1_ring_msi1_data = 0x00000960,
1060 	.hal_tcl2_ring_base_lsb = 0x00000988,
1061 	.hal_tcl_ring_base_lsb = 0x00000b68,
1062 
1063 	/* TCL STATUS ring address */
1064 	.hal_tcl_status_ring_base_lsb = 0x00000d48,
1065 
1066 	/* REO DEST ring address */
1067 	.hal_reo2_ring_base = 0x00000578,
1068 	.hal_reo1_misc_ctrl_addr = 0x00000b9c,
1069 	.hal_reo1_sw_cookie_cfg0 = 0x0000006c,
1070 	.hal_reo1_sw_cookie_cfg1 = 0x00000070,
1071 	.hal_reo1_qdesc_lut_base0 = 0x00000074,
1072 	.hal_reo1_qdesc_lut_base1 = 0x00000078,
1073 	.hal_reo1_ring_base_lsb = 0x00000500,
1074 	.hal_reo1_ring_base_msb = 0x00000504,
1075 	.hal_reo1_ring_id = 0x00000508,
1076 	.hal_reo1_ring_misc = 0x00000510,
1077 	.hal_reo1_ring_hp_addr_lsb = 0x00000514,
1078 	.hal_reo1_ring_hp_addr_msb = 0x00000518,
1079 	.hal_reo1_ring_producer_int_setup = 0x00000524,
1080 	.hal_reo1_ring_msi1_base_lsb = 0x00000548,
1081 	.hal_reo1_ring_msi1_base_msb = 0x0000054C,
1082 	.hal_reo1_ring_msi1_data = 0x00000550,
1083 	.hal_reo1_aging_thres_ix0 = 0x00000B28,
1084 	.hal_reo1_aging_thres_ix1 = 0x00000B2C,
1085 	.hal_reo1_aging_thres_ix2 = 0x00000B30,
1086 	.hal_reo1_aging_thres_ix3 = 0x00000B34,
1087 
1088 	/* REO Exception ring address */
1089 	.hal_reo2_sw0_ring_base = 0x000008c0,
1090 
1091 	/* REO Reinject ring address */
1092 	.hal_sw2reo_ring_base = 0x00000320,
1093 	.hal_sw2reo1_ring_base = 0x00000398,
1094 
1095 	/* REO cmd ring address */
1096 	.hal_reo_cmd_ring_base = 0x000002A8,
1097 
1098 	/* REO status ring address */
1099 	.hal_reo_status_ring_base = 0x00000aa0,
1100 
1101 	/* WBM idle link ring address */
1102 	.hal_wbm_idle_ring_base_lsb = 0x00000d3c,
1103 	.hal_wbm_idle_ring_misc_addr = 0x00000d4c,
1104 	.hal_wbm_r0_idle_list_cntl_addr = 0x00000240,
1105 	.hal_wbm_r0_idle_list_size_addr = 0x00000244,
1106 	.hal_wbm_scattered_ring_base_lsb = 0x00000250,
1107 	.hal_wbm_scattered_ring_base_msb = 0x00000254,
1108 	.hal_wbm_scattered_desc_head_info_ix0 = 0x00000260,
1109 	.hal_wbm_scattered_desc_head_info_ix1   = 0x00000264,
1110 	.hal_wbm_scattered_desc_tail_info_ix0 = 0x00000270,
1111 	.hal_wbm_scattered_desc_tail_info_ix1 = 0x00000274,
1112 	.hal_wbm_scattered_desc_ptr_hp_addr = 0x0000027c,
1113 
1114 	/* SW2WBM release ring address */
1115 	.hal_wbm_sw_release_ring_base_lsb = 0x0000037c,
1116 
1117 	/* WBM2SW release ring address */
1118 	.hal_wbm0_release_ring_base_lsb = 0x00000e08,
1119 	.hal_wbm1_release_ring_base_lsb = 0x00000e80,
1120 
1121 	/* PPE release ring address */
1122 	.hal_ppe_rel_ring_base = 0x0000046c,
1123 
1124 	/* CE address */
1125 	.hal_umac_ce0_src_reg_base = 0x00740000 -
1126 		HAL_IPQ5332_CE_WFSS_REG_BASE,
1127 	.hal_umac_ce0_dest_reg_base = 0x00741000 -
1128 		HAL_IPQ5332_CE_WFSS_REG_BASE,
1129 	.hal_umac_ce1_src_reg_base = 0x00742000 -
1130 		HAL_IPQ5332_CE_WFSS_REG_BASE,
1131 	.hal_umac_ce1_dest_reg_base = 0x00743000 -
1132 		HAL_IPQ5332_CE_WFSS_REG_BASE,
1133 };
1134 
1135 static const struct ath12k_hw_regs wcn7850_regs = {
1136 	/* SW2TCL(x) R0 ring configuration address */
1137 	.hal_tcl1_ring_id = 0x00000908,
1138 	.hal_tcl1_ring_misc = 0x00000910,
1139 	.hal_tcl1_ring_tp_addr_lsb = 0x0000091c,
1140 	.hal_tcl1_ring_tp_addr_msb = 0x00000920,
1141 	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x00000930,
1142 	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x00000934,
1143 	.hal_tcl1_ring_msi1_base_lsb = 0x00000948,
1144 	.hal_tcl1_ring_msi1_base_msb = 0x0000094c,
1145 	.hal_tcl1_ring_msi1_data = 0x00000950,
1146 	.hal_tcl_ring_base_lsb = 0x00000b58,
1147 	.hal_tcl1_ring_base_lsb = 0x00000900,
1148 	.hal_tcl1_ring_base_msb = 0x00000904,
1149 	.hal_tcl2_ring_base_lsb = 0x00000978,
1150 
1151 	/* TCL STATUS ring address */
1152 	.hal_tcl_status_ring_base_lsb = 0x00000d38,
1153 
1154 	.hal_wbm_idle_ring_base_lsb = 0x00000d3c,
1155 	.hal_wbm_idle_ring_misc_addr = 0x00000d4c,
1156 	.hal_wbm_r0_idle_list_cntl_addr = 0x00000240,
1157 	.hal_wbm_r0_idle_list_size_addr = 0x00000244,
1158 	.hal_wbm_scattered_ring_base_lsb = 0x00000250,
1159 	.hal_wbm_scattered_ring_base_msb = 0x00000254,
1160 	.hal_wbm_scattered_desc_head_info_ix0 = 0x00000260,
1161 	.hal_wbm_scattered_desc_head_info_ix1 = 0x00000264,
1162 	.hal_wbm_scattered_desc_tail_info_ix0 = 0x00000270,
1163 	.hal_wbm_scattered_desc_tail_info_ix1 = 0x00000274,
1164 	.hal_wbm_scattered_desc_ptr_hp_addr = 0x00000027c,
1165 
1166 	.hal_wbm_sw_release_ring_base_lsb = 0x0000037c,
1167 	.hal_wbm_sw1_release_ring_base_lsb = 0x00000284,
1168 	.hal_wbm0_release_ring_base_lsb = 0x00000e08,
1169 	.hal_wbm1_release_ring_base_lsb = 0x00000e80,
1170 
1171 	/* PCIe base address */
1172 	.pcie_qserdes_sysclk_en_sel = 0x01e0e0a8,
1173 	.pcie_pcs_osc_dtct_config_base = 0x01e0f45c,
1174 
1175 	/* PPE release ring address */
1176 	.hal_ppe_rel_ring_base = 0x0000043c,
1177 
1178 	/* REO DEST ring address */
1179 	.hal_reo2_ring_base = 0x0000055c,
1180 	.hal_reo1_misc_ctrl_addr = 0x00000b7c,
1181 	.hal_reo1_sw_cookie_cfg0 = 0x00000050,
1182 	.hal_reo1_sw_cookie_cfg1 = 0x00000054,
1183 	.hal_reo1_qdesc_lut_base0 = 0x00000058,
1184 	.hal_reo1_qdesc_lut_base1 = 0x0000005c,
1185 	.hal_reo1_ring_base_lsb = 0x000004e4,
1186 	.hal_reo1_ring_base_msb = 0x000004e8,
1187 	.hal_reo1_ring_id = 0x000004ec,
1188 	.hal_reo1_ring_misc = 0x000004f4,
1189 	.hal_reo1_ring_hp_addr_lsb = 0x000004f8,
1190 	.hal_reo1_ring_hp_addr_msb = 0x000004fc,
1191 	.hal_reo1_ring_producer_int_setup = 0x00000508,
1192 	.hal_reo1_ring_msi1_base_lsb = 0x0000052C,
1193 	.hal_reo1_ring_msi1_base_msb = 0x00000530,
1194 	.hal_reo1_ring_msi1_data = 0x00000534,
1195 	.hal_reo1_aging_thres_ix0 = 0x00000b08,
1196 	.hal_reo1_aging_thres_ix1 = 0x00000b0c,
1197 	.hal_reo1_aging_thres_ix2 = 0x00000b10,
1198 	.hal_reo1_aging_thres_ix3 = 0x00000b14,
1199 
1200 	/* REO Exception ring address */
1201 	.hal_reo2_sw0_ring_base = 0x000008a4,
1202 
1203 	/* REO Reinject ring address */
1204 	.hal_sw2reo_ring_base = 0x00000304,
1205 	.hal_sw2reo1_ring_base = 0x0000037c,
1206 
1207 	/* REO cmd ring address */
1208 	.hal_reo_cmd_ring_base = 0x0000028c,
1209 
1210 	/* REO status ring address */
1211 	.hal_reo_status_ring_base = 0x00000a84,
1212 
1213 	/* CE base address */
1214 	.hal_umac_ce0_src_reg_base = 0x01b80000,
1215 	.hal_umac_ce0_dest_reg_base = 0x01b81000,
1216 	.hal_umac_ce1_src_reg_base = 0x01b82000,
1217 	.hal_umac_ce1_dest_reg_base = 0x01b83000,
1218 };
1219 
1220 static const struct ath12k_hw_hal_params ath12k_hw_hal_params_qcn9274 = {
1221 	.rx_buf_rbm = HAL_RX_BUF_RBM_SW3_BM,
1222 	.wbm2sw_cc_enable = HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW0_EN |
1223 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW1_EN |
1224 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW2_EN |
1225 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW3_EN |
1226 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW4_EN,
1227 };
1228 
1229 static const struct ath12k_hw_hal_params ath12k_hw_hal_params_wcn7850 = {
1230 	.rx_buf_rbm = HAL_RX_BUF_RBM_SW1_BM,
1231 	.wbm2sw_cc_enable = HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW0_EN |
1232 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW2_EN |
1233 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW3_EN |
1234 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW4_EN,
1235 };
1236 
1237 static const struct ath12k_hw_hal_params ath12k_hw_hal_params_ipq5332 = {
1238 	.rx_buf_rbm = HAL_RX_BUF_RBM_SW3_BM,
1239 	.wbm2sw_cc_enable = HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW0_EN |
1240 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW1_EN |
1241 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW2_EN |
1242 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW3_EN |
1243 			    HAL_WBM_SW_COOKIE_CONV_CFG_WBM2SW4_EN,
1244 };
1245 
1246 static const struct ce_ie_addr ath12k_ce_ie_addr_ipq5332 = {
1247 	.ie1_reg_addr = CE_HOST_IE_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
1248 	.ie2_reg_addr = CE_HOST_IE_2_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
1249 	.ie3_reg_addr = CE_HOST_IE_3_ADDRESS - HAL_IPQ5332_CE_WFSS_REG_BASE,
1250 };
1251 
1252 static const struct ce_remap ath12k_ce_remap_ipq5332 = {
1253 	.base = HAL_IPQ5332_CE_WFSS_REG_BASE,
1254 	.size = HAL_IPQ5332_CE_SIZE,
1255 };
1256 
1257 static const struct ath12k_hw_params ath12k_hw_params[] = {
1258 	{
1259 		.name = "qcn9274 hw1.0",
1260 		.hw_rev = ATH12K_HW_QCN9274_HW10,
1261 		.fw = {
1262 			.dir = "QCN9274/hw1.0",
1263 			.board_size = 256 * 1024,
1264 			.cal_offset = 128 * 1024,
1265 			.m3_loader = ath12k_m3_fw_loader_driver,
1266 		},
1267 		.max_radios = 1,
1268 		.single_pdev_only = false,
1269 		.qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9274,
1270 		.internal_sleep_clock = false,
1271 
1272 		.hw_ops = &qcn9274_ops,
1273 		.ring_mask = &ath12k_hw_ring_mask_qcn9274,
1274 		.regs = &qcn9274_v1_regs,
1275 
1276 		.host_ce_config = ath12k_host_ce_config_qcn9274,
1277 		.ce_count = 16,
1278 		.target_ce_config = ath12k_target_ce_config_wlan_qcn9274,
1279 		.target_ce_count = 12,
1280 		.svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_qcn9274,
1281 		.svc_to_ce_map_len = 18,
1282 
1283 		.hal_params = &ath12k_hw_hal_params_qcn9274,
1284 
1285 		.rxdma1_enable = false,
1286 		.num_rxdma_per_pdev = 1,
1287 		.num_rxdma_dst_ring = 0,
1288 		.rx_mac_buf_ring = false,
1289 		.vdev_start_delay = false,
1290 
1291 		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
1292 					BIT(NL80211_IFTYPE_AP) |
1293 					BIT(NL80211_IFTYPE_MESH_POINT) |
1294 					BIT(NL80211_IFTYPE_AP_VLAN),
1295 		.supports_monitor = false,
1296 
1297 		.idle_ps = false,
1298 		.download_calib = true,
1299 		.supports_suspend = false,
1300 		.tcl_ring_retry = true,
1301 		.reoq_lut_support = true,
1302 		.supports_shadow_regs = false,
1303 
1304 		.num_tcl_banks = 48,
1305 		.max_tx_ring = 4,
1306 
1307 		.mhi_config = &ath12k_mhi_config_qcn9274,
1308 
1309 		.wmi_init = ath12k_wmi_init_qcn9274,
1310 
1311 		.hal_ops = &hal_qcn9274_ops,
1312 
1313 		.qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01),
1314 
1315 		.rfkill_pin = 0,
1316 		.rfkill_cfg = 0,
1317 		.rfkill_on_level = 0,
1318 
1319 		.rddm_size = 0x600000,
1320 
1321 		.def_num_link = 0,
1322 		.max_mlo_peer = 256,
1323 
1324 		.otp_board_id_register = QCN9274_QFPROM_RAW_RFA_PDET_ROW13_LSB,
1325 
1326 		.supports_sta_ps = false,
1327 
1328 		.acpi_guid = NULL,
1329 		.supports_dynamic_smps_6ghz = true,
1330 
1331 		.iova_mask = 0,
1332 
1333 		.supports_aspm = false,
1334 
1335 		.ce_ie_addr = NULL,
1336 		.ce_remap = NULL,
1337 		.bdf_addr_offset = 0,
1338 
1339 		.current_cc_support = false,
1340 
1341 		.dp_primary_link_only = true,
1342 	},
1343 	{
1344 		.name = "wcn7850 hw2.0",
1345 		.hw_rev = ATH12K_HW_WCN7850_HW20,
1346 
1347 		.fw = {
1348 			.dir = "WCN7850/hw2.0",
1349 			.board_size = 256 * 1024,
1350 			.cal_offset = 256 * 1024,
1351 			.m3_loader = ath12k_m3_fw_loader_driver,
1352 		},
1353 
1354 		.max_radios = 1,
1355 		.single_pdev_only = true,
1356 		.qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_WCN7850,
1357 		.internal_sleep_clock = true,
1358 
1359 		.hw_ops = &wcn7850_ops,
1360 		.ring_mask = &ath12k_hw_ring_mask_wcn7850,
1361 		.regs = &wcn7850_regs,
1362 
1363 		.host_ce_config = ath12k_host_ce_config_wcn7850,
1364 		.ce_count = 9,
1365 		.target_ce_config = ath12k_target_ce_config_wlan_wcn7850,
1366 		.target_ce_count = 9,
1367 		.svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_wcn7850,
1368 		.svc_to_ce_map_len = 14,
1369 
1370 		.hal_params = &ath12k_hw_hal_params_wcn7850,
1371 
1372 		.rxdma1_enable = false,
1373 		.num_rxdma_per_pdev = 2,
1374 		.num_rxdma_dst_ring = 1,
1375 		.rx_mac_buf_ring = true,
1376 		.vdev_start_delay = true,
1377 
1378 		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
1379 				   BIT(NL80211_IFTYPE_AP) |
1380 				   BIT(NL80211_IFTYPE_P2P_DEVICE) |
1381 				   BIT(NL80211_IFTYPE_P2P_CLIENT) |
1382 				   BIT(NL80211_IFTYPE_P2P_GO),
1383 		.supports_monitor = true,
1384 
1385 		.idle_ps = true,
1386 		.download_calib = false,
1387 		.supports_suspend = true,
1388 		.tcl_ring_retry = false,
1389 		.reoq_lut_support = false,
1390 		.supports_shadow_regs = true,
1391 
1392 		.num_tcl_banks = 7,
1393 		.max_tx_ring = 3,
1394 
1395 		.mhi_config = &ath12k_mhi_config_wcn7850,
1396 
1397 		.wmi_init = ath12k_wmi_init_wcn7850,
1398 
1399 		.hal_ops = &hal_wcn7850_ops,
1400 
1401 		.qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01) |
1402 					   BIT(CNSS_PCIE_PERST_NO_PULL_V01),
1403 
1404 		.rfkill_pin = 48,
1405 		.rfkill_cfg = 0,
1406 		.rfkill_on_level = 1,
1407 
1408 		.rddm_size = 0x780000,
1409 
1410 		.def_num_link = 2,
1411 		.max_mlo_peer = 32,
1412 
1413 		.otp_board_id_register = 0,
1414 
1415 		.supports_sta_ps = true,
1416 
1417 		.acpi_guid = &wcn7850_uuid,
1418 		.supports_dynamic_smps_6ghz = false,
1419 
1420 		.iova_mask = ATH12K_PCIE_MAX_PAYLOAD_SIZE - 1,
1421 
1422 		.supports_aspm = true,
1423 
1424 		.ce_ie_addr = NULL,
1425 		.ce_remap = NULL,
1426 		.bdf_addr_offset = 0,
1427 
1428 		.current_cc_support = true,
1429 
1430 		.dp_primary_link_only = false,
1431 	},
1432 	{
1433 		.name = "qcn9274 hw2.0",
1434 		.hw_rev = ATH12K_HW_QCN9274_HW20,
1435 		.fw = {
1436 			.dir = "QCN9274/hw2.0",
1437 			.board_size = 256 * 1024,
1438 			.cal_offset = 128 * 1024,
1439 			.m3_loader = ath12k_m3_fw_loader_driver,
1440 		},
1441 		.max_radios = 2,
1442 		.single_pdev_only = false,
1443 		.qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9274,
1444 		.internal_sleep_clock = false,
1445 
1446 		.hw_ops = &qcn9274_ops,
1447 		.ring_mask = &ath12k_hw_ring_mask_qcn9274,
1448 		.regs = &qcn9274_v2_regs,
1449 
1450 		.host_ce_config = ath12k_host_ce_config_qcn9274,
1451 		.ce_count = 16,
1452 		.target_ce_config = ath12k_target_ce_config_wlan_qcn9274,
1453 		.target_ce_count = 12,
1454 		.svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_qcn9274,
1455 		.svc_to_ce_map_len = 18,
1456 
1457 		.hal_params = &ath12k_hw_hal_params_qcn9274,
1458 
1459 		.rxdma1_enable = true,
1460 		.num_rxdma_per_pdev = 1,
1461 		.num_rxdma_dst_ring = 0,
1462 		.rx_mac_buf_ring = false,
1463 		.vdev_start_delay = false,
1464 
1465 		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
1466 					BIT(NL80211_IFTYPE_AP) |
1467 					BIT(NL80211_IFTYPE_MESH_POINT) |
1468 					BIT(NL80211_IFTYPE_AP_VLAN),
1469 		.supports_monitor = true,
1470 
1471 		.idle_ps = false,
1472 		.download_calib = true,
1473 		.supports_suspend = false,
1474 		.tcl_ring_retry = true,
1475 		.reoq_lut_support = false,
1476 		.supports_shadow_regs = false,
1477 
1478 		.num_tcl_banks = 48,
1479 		.max_tx_ring = 4,
1480 
1481 		.mhi_config = &ath12k_mhi_config_qcn9274,
1482 
1483 		.wmi_init = ath12k_wmi_init_qcn9274,
1484 
1485 		.hal_ops = &hal_qcn9274_ops,
1486 
1487 		.qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01),
1488 
1489 		.rfkill_pin = 0,
1490 		.rfkill_cfg = 0,
1491 		.rfkill_on_level = 0,
1492 
1493 		.rddm_size = 0x600000,
1494 
1495 		.def_num_link = 0,
1496 		.max_mlo_peer = 256,
1497 
1498 		.otp_board_id_register = QCN9274_QFPROM_RAW_RFA_PDET_ROW13_LSB,
1499 
1500 		.supports_sta_ps = false,
1501 
1502 		.acpi_guid = NULL,
1503 		.supports_dynamic_smps_6ghz = true,
1504 
1505 		.iova_mask = 0,
1506 
1507 		.supports_aspm = false,
1508 
1509 		.ce_ie_addr = NULL,
1510 		.ce_remap = NULL,
1511 		.bdf_addr_offset = 0,
1512 
1513 		.current_cc_support = false,
1514 
1515 		.dp_primary_link_only = true,
1516 	},
1517 	{
1518 		.name = "ipq5332 hw1.0",
1519 		.hw_rev = ATH12K_HW_IPQ5332_HW10,
1520 		.fw = {
1521 			.dir = "IPQ5332/hw1.0",
1522 			.board_size = 256 * 1024,
1523 			.cal_offset = 128 * 1024,
1524 			.m3_loader = ath12k_m3_fw_loader_remoteproc,
1525 		},
1526 		.max_radios = 1,
1527 		.single_pdev_only = false,
1528 		.qmi_service_ins_id = ATH12K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ5332,
1529 		.internal_sleep_clock = false,
1530 
1531 		.hw_ops = &qcn9274_ops,
1532 		.regs = &ipq5332_regs,
1533 		.ring_mask = &ath12k_hw_ring_mask_ipq5332,
1534 
1535 		.host_ce_config = ath12k_host_ce_config_ipq5332,
1536 		.ce_count = 12,
1537 		.target_ce_config = ath12k_target_ce_config_wlan_ipq5332,
1538 		.target_ce_count = 12,
1539 		.svc_to_ce_map = ath12k_target_service_to_ce_map_wlan_ipq5332,
1540 		.svc_to_ce_map_len = 18,
1541 
1542 		.hal_params = &ath12k_hw_hal_params_ipq5332,
1543 
1544 		.rxdma1_enable = false,
1545 		.num_rxdma_per_pdev = 1,
1546 		.num_rxdma_dst_ring = 0,
1547 		.rx_mac_buf_ring = false,
1548 		.vdev_start_delay = false,
1549 
1550 		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
1551 				   BIT(NL80211_IFTYPE_AP) |
1552 				   BIT(NL80211_IFTYPE_MESH_POINT),
1553 		.supports_monitor = false,
1554 
1555 		.idle_ps = false,
1556 		.download_calib = true,
1557 		.supports_suspend = false,
1558 		.tcl_ring_retry = true,
1559 		.reoq_lut_support = false,
1560 		.supports_shadow_regs = false,
1561 
1562 		.num_tcl_banks = 48,
1563 		.max_tx_ring = 4,
1564 
1565 		.wmi_init = &ath12k_wmi_init_qcn9274,
1566 
1567 		.hal_ops = &hal_qcn9274_ops,
1568 
1569 		.qmi_cnss_feature_bitmap = BIT(CNSS_QDSS_CFG_MISS_V01),
1570 
1571 		.rfkill_pin = 0,
1572 		.rfkill_cfg = 0,
1573 		.rfkill_on_level = 0,
1574 
1575 		.rddm_size = 0,
1576 
1577 		.def_num_link = 0,
1578 		.max_mlo_peer = 256,
1579 
1580 		.otp_board_id_register = 0,
1581 
1582 		.supports_sta_ps = false,
1583 
1584 		.acpi_guid = NULL,
1585 		.supports_dynamic_smps_6ghz = false,
1586 		.iova_mask = 0,
1587 		.supports_aspm = false,
1588 
1589 		.ce_ie_addr = &ath12k_ce_ie_addr_ipq5332,
1590 		.ce_remap = &ath12k_ce_remap_ipq5332,
1591 		.bdf_addr_offset = 0xC00000,
1592 
1593 		.dp_primary_link_only = true,
1594 	},
1595 };
1596 
1597 int ath12k_hw_init(struct ath12k_base *ab)
1598 {
1599 	const struct ath12k_hw_params *hw_params = NULL;
1600 	int i;
1601 
1602 	for (i = 0; i < ARRAY_SIZE(ath12k_hw_params); i++) {
1603 		hw_params = &ath12k_hw_params[i];
1604 
1605 		if (hw_params->hw_rev == ab->hw_rev)
1606 			break;
1607 	}
1608 
1609 	if (i == ARRAY_SIZE(ath12k_hw_params)) {
1610 		ath12k_err(ab, "Unsupported hardware version: 0x%x\n", ab->hw_rev);
1611 		return -EINVAL;
1612 	}
1613 
1614 	ab->hw_params = hw_params;
1615 
1616 	ath12k_info(ab, "Hardware name: %s\n", ab->hw_params->name);
1617 
1618 	return 0;
1619 }
1620