Skip to content

Commit 967c1d1

Browse files
Anilkumar KolliKalle Valo
authored andcommitted
ath11k: move target ce configs to hw_params
Move target CE config and target CE service config to hw_params. No functional changes. Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/010101746cb685d9-6bedeccb-29a1-4d32-8664-fcfe7d105f4a-000000@us-west-2.amazonses.com
1 parent 7b5bd15 commit 967c1d1

File tree

6 files changed

+442
-435
lines changed

6 files changed

+442
-435
lines changed

drivers/net/wireless/ath/ath11k/ahb.c

Lines changed: 8 additions & 247 deletions
Original file line numberDiff line numberDiff line change
@@ -32,245 +32,6 @@ static const struct ath11k_bus_params ath11k_ahb_bus_params = {
3232
.fixed_mem_region = true,
3333
};
3434

35-
/* Target firmware's Copy Engine configuration. */
36-
static const struct ce_pipe_config target_ce_config_wlan[] = {
37-
/* CE0: host->target HTC control and raw streams */
38-
{
39-
.pipenum = __cpu_to_le32(0),
40-
.pipedir = __cpu_to_le32(PIPEDIR_OUT),
41-
.nentries = __cpu_to_le32(32),
42-
.nbytes_max = __cpu_to_le32(2048),
43-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
44-
.reserved = __cpu_to_le32(0),
45-
},
46-
47-
/* CE1: target->host HTT + HTC control */
48-
{
49-
.pipenum = __cpu_to_le32(1),
50-
.pipedir = __cpu_to_le32(PIPEDIR_IN),
51-
.nentries = __cpu_to_le32(32),
52-
.nbytes_max = __cpu_to_le32(2048),
53-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
54-
.reserved = __cpu_to_le32(0),
55-
},
56-
57-
/* CE2: target->host WMI */
58-
{
59-
.pipenum = __cpu_to_le32(2),
60-
.pipedir = __cpu_to_le32(PIPEDIR_IN),
61-
.nentries = __cpu_to_le32(32),
62-
.nbytes_max = __cpu_to_le32(2048),
63-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
64-
.reserved = __cpu_to_le32(0),
65-
},
66-
67-
/* CE3: host->target WMI */
68-
{
69-
.pipenum = __cpu_to_le32(3),
70-
.pipedir = __cpu_to_le32(PIPEDIR_OUT),
71-
.nentries = __cpu_to_le32(32),
72-
.nbytes_max = __cpu_to_le32(2048),
73-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
74-
.reserved = __cpu_to_le32(0),
75-
},
76-
77-
/* CE4: host->target HTT */
78-
{
79-
.pipenum = __cpu_to_le32(4),
80-
.pipedir = __cpu_to_le32(PIPEDIR_OUT),
81-
.nentries = __cpu_to_le32(256),
82-
.nbytes_max = __cpu_to_le32(256),
83-
.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
84-
.reserved = __cpu_to_le32(0),
85-
},
86-
87-
/* CE5: target->host Pktlog */
88-
{
89-
.pipenum = __cpu_to_le32(5),
90-
.pipedir = __cpu_to_le32(PIPEDIR_IN),
91-
.nentries = __cpu_to_le32(32),
92-
.nbytes_max = __cpu_to_le32(2048),
93-
.flags = __cpu_to_le32(0),
94-
.reserved = __cpu_to_le32(0),
95-
},
96-
97-
/* CE6: Reserved for target autonomous hif_memcpy */
98-
{
99-
.pipenum = __cpu_to_le32(6),
100-
.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
101-
.nentries = __cpu_to_le32(32),
102-
.nbytes_max = __cpu_to_le32(65535),
103-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
104-
.reserved = __cpu_to_le32(0),
105-
},
106-
107-
/* CE7 used only by Host */
108-
{
109-
.pipenum = __cpu_to_le32(7),
110-
.pipedir = __cpu_to_le32(PIPEDIR_OUT),
111-
.nentries = __cpu_to_le32(32),
112-
.nbytes_max = __cpu_to_le32(2048),
113-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
114-
.reserved = __cpu_to_le32(0),
115-
},
116-
117-
/* CE8 target->host used only by IPA */
118-
{
119-
.pipenum = __cpu_to_le32(8),
120-
.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
121-
.nentries = __cpu_to_le32(32),
122-
.nbytes_max = __cpu_to_le32(65535),
123-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
124-
.reserved = __cpu_to_le32(0),
125-
},
126-
127-
/* CE9 host->target HTT */
128-
{
129-
.pipenum = __cpu_to_le32(9),
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-
/* CE10 target->host HTT */
138-
{
139-
.pipenum = __cpu_to_le32(10),
140-
.pipedir = __cpu_to_le32(PIPEDIR_INOUT_H2H),
141-
.nentries = __cpu_to_le32(0),
142-
.nbytes_max = __cpu_to_le32(0),
143-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
144-
.reserved = __cpu_to_le32(0),
145-
},
146-
147-
/* CE11 Not used */
148-
{
149-
.pipenum = __cpu_to_le32(0),
150-
.pipedir = __cpu_to_le32(0),
151-
.nentries = __cpu_to_le32(0),
152-
.nbytes_max = __cpu_to_le32(0),
153-
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
154-
.reserved = __cpu_to_le32(0),
155-
},
156-
};
157-
158-
/* Map from service/endpoint to Copy Engine.
159-
* This table is derived from the CE_PCI TABLE, above.
160-
* It is passed to the Target at startup for use by firmware.
161-
*/
162-
static const struct service_to_pipe target_service_to_ce_map_wlan[] = {
163-
{
164-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
165-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
166-
.pipenum = __cpu_to_le32(3),
167-
},
168-
{
169-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
170-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
171-
.pipenum = __cpu_to_le32(2),
172-
},
173-
{
174-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
175-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
176-
.pipenum = __cpu_to_le32(3),
177-
},
178-
{
179-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
180-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
181-
.pipenum = __cpu_to_le32(2),
182-
},
183-
{
184-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
185-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
186-
.pipenum = __cpu_to_le32(3),
187-
},
188-
{
189-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
190-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
191-
.pipenum = __cpu_to_le32(2),
192-
},
193-
{
194-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
195-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
196-
.pipenum = __cpu_to_le32(3),
197-
},
198-
{
199-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
200-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
201-
.pipenum = __cpu_to_le32(2),
202-
},
203-
{
204-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
205-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
206-
.pipenum = __cpu_to_le32(3),
207-
},
208-
{
209-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
210-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
211-
.pipenum = __cpu_to_le32(2),
212-
},
213-
{
214-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1),
215-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
216-
.pipenum = __cpu_to_le32(7),
217-
},
218-
{
219-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC1),
220-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
221-
.pipenum = __cpu_to_le32(2),
222-
},
223-
{
224-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2),
225-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
226-
.pipenum = __cpu_to_le32(9),
227-
},
228-
{
229-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL_MAC2),
230-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
231-
.pipenum = __cpu_to_le32(2),
232-
},
233-
{
234-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
235-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
236-
.pipenum = __cpu_to_le32(0),
237-
},
238-
{
239-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
240-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
241-
.pipenum = __cpu_to_le32(1),
242-
},
243-
{ /* not used */
244-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
245-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
246-
.pipenum = __cpu_to_le32(0),
247-
},
248-
{ /* not used */
249-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
250-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
251-
.pipenum = __cpu_to_le32(1),
252-
},
253-
{
254-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
255-
.pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
256-
.pipenum = __cpu_to_le32(4),
257-
},
258-
{
259-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
260-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
261-
.pipenum = __cpu_to_le32(1),
262-
},
263-
{
264-
.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG),
265-
.pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
266-
.pipenum = __cpu_to_le32(5),
267-
},
268-
269-
/* (Additions here) */
270-
271-
{ /* terminator entry */ }
272-
};
273-
27435
#define ATH11K_IRQ_CE0_OFFSET 4
27536

27637
static const char *irq_name[ATH11K_IRQ_NUM_MAX] = {
@@ -444,7 +205,7 @@ static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
444205
{
445206
const struct ce_pipe_config *ce_config;
446207

447-
ce_config = &target_ce_config_wlan[ce_id];
208+
ce_config = &ab->hw_params.target_ce_config[ce_id];
448209
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT)
449210
ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
450211

@@ -459,7 +220,7 @@ static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id)
459220
{
460221
const struct ce_pipe_config *ce_config;
461222

462-
ce_config = &target_ce_config_wlan[ce_id];
223+
ce_config = &ab->hw_params.target_ce_config[ce_id];
463224
if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT)
464225
ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
465226

@@ -577,10 +338,10 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
577338
{
578339
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
579340

580-
cfg->tgt_ce_len = ARRAY_SIZE(target_ce_config_wlan) - 1;
581-
cfg->tgt_ce = target_ce_config_wlan;
582-
cfg->svc_to_ce_map_len = ARRAY_SIZE(target_service_to_ce_map_wlan);
583-
cfg->svc_to_ce_map = target_service_to_ce_map_wlan;
341+
cfg->tgt_ce_len = ab->hw_params.target_ce_count;
342+
cfg->tgt_ce = ab->hw_params.target_ce_config;
343+
cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
344+
cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
584345
ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074;
585346
}
586347

@@ -788,8 +549,8 @@ static int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id
788549
bool ul_set = false, dl_set = false;
789550
int i;
790551

791-
for (i = 0; i < ARRAY_SIZE(target_service_to_ce_map_wlan); i++) {
792-
entry = &target_service_to_ce_map_wlan[i];
552+
for (i = 0; i < ab->hw_params.svc_to_ce_map_len; i++) {
553+
entry = &ab->hw_params.svc_to_ce_map[i];
793554

794555
if (__le32_to_cpu(entry->service_id) != service_id)
795556
continue;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
3535
.regs = &ipq8074_regs,
3636
.host_ce_config = ath11k_host_ce_config_ipq8074,
3737
.ce_count = 12,
38+
.target_ce_config = ath11k_target_ce_config_wlan_ipq8074,
39+
.target_ce_count = 11,
40+
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074,
41+
.svc_to_ce_map_len = 21,
3842
.single_pdev_only = false,
3943
.needs_band_to_mac = true,
4044
.rxdma1_enable = true,
@@ -60,6 +64,10 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
6064
.regs = &qca6390_regs,
6165
.host_ce_config = ath11k_host_ce_config_qca6390,
6266
.ce_count = 9,
67+
.target_ce_config = ath11k_target_ce_config_wlan_qca6390,
68+
.target_ce_count = 9,
69+
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
70+
.svc_to_ce_map_len = 14,
6371
.single_pdev_only = true,
6472
.needs_band_to_mac = false,
6573
.rxdma1_enable = false,

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,12 @@ struct ath11k_fw_stats_bcn {
845845
u32 tx_bcn_outage_cnt;
846846
};
847847

848+
extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq8074[];
849+
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq8074[];
850+
851+
extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
852+
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
853+
848854
void ath11k_peer_unmap_event(struct ath11k_base *ab, u16 peer_id);
849855
void ath11k_peer_map_event(struct ath11k_base *ab, u8 vdev_id, u16 peer_id,
850856
u8 *mac_addr, u16 ast_hash);

0 commit comments

Comments
 (0)