@@ -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
27637static 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 ;
0 commit comments