1 From 26af7aabd2d8225c6b2056234626ba5099610871 Mon Sep 17 00:00:00 2001
2 From: Sriram R <quic_srirrama@quicinc.com>
3 Date: Fri, 2 Dec 2022 23:37:14 +0200
4 Subject: [PATCH] wifi: ath11k: update ce configurations for IPQ5018
6 IPQ5018 is a single pdev device. Update host
7 and target CE configurations accordingly.
9 Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
11 Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
12 Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
13 Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
14 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
15 Link: https://lore.kernel.org/r/20221122132152.17771-4-quic_kathirve@quicinc.com
17 drivers/net/wireless/ath/ath11k/core.c | 4 +
18 drivers/net/wireless/ath/ath11k/core.h | 3 +
19 drivers/net/wireless/ath/ath11k/hw.c | 191 +++++++++++++++++++++++++
20 3 files changed, 198 insertions(+)
22 --- a/drivers/net/wireless/ath/ath11k/core.c
23 +++ b/drivers/net/wireless/ath/ath11k/core.c
24 @@ -630,6 +630,10 @@ static const struct ath11k_hw_params ath
25 .internal_sleep_clock = false,
26 .host_ce_config = ath11k_host_ce_config_qcn9074,
27 .ce_count = CE_CNT_5018,
28 + .target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
29 + .target_ce_count = TARGET_CE_CNT_5018,
30 + .svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
31 + .svc_to_ce_map_len = SVC_CE_MAP_LEN_5018,
32 .rxdma1_enable = true,
33 .num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
34 .rx_mac_buf_ring = false,
35 --- a/drivers/net/wireless/ath/ath11k/core.h
36 +++ b/drivers/net/wireless/ath/ath11k/core.h
37 @@ -1145,6 +1145,9 @@ extern const struct service_to_pipe ath1
38 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
39 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
41 +extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[];
42 +extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[];
44 extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
45 extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
46 int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
47 --- a/drivers/net/wireless/ath/ath11k/hw.c
48 +++ b/drivers/net/wireless/ath/ath11k/hw.c
49 @@ -1972,6 +1972,197 @@ const struct ath11k_hw_ring_mask ath11k_
53 +/* Target firmware's Copy Engine configuration for IPQ5018 */
54 +const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
55 + /* CE0: host->target HTC control and raw streams */
57 + .pipenum = __cpu_to_le32(0),
58 + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
59 + .nentries = __cpu_to_le32(32),
60 + .nbytes_max = __cpu_to_le32(2048),
61 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
62 + .reserved = __cpu_to_le32(0),
65 + /* CE1: target->host HTT + HTC control */
67 + .pipenum = __cpu_to_le32(1),
68 + .pipedir = __cpu_to_le32(PIPEDIR_IN),
69 + .nentries = __cpu_to_le32(32),
70 + .nbytes_max = __cpu_to_le32(2048),
71 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
72 + .reserved = __cpu_to_le32(0),
75 + /* CE2: target->host WMI */
77 + .pipenum = __cpu_to_le32(2),
78 + .pipedir = __cpu_to_le32(PIPEDIR_IN),
79 + .nentries = __cpu_to_le32(32),
80 + .nbytes_max = __cpu_to_le32(2048),
81 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
82 + .reserved = __cpu_to_le32(0),
85 + /* CE3: host->target WMI */
87 + .pipenum = __cpu_to_le32(3),
88 + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
89 + .nentries = __cpu_to_le32(32),
90 + .nbytes_max = __cpu_to_le32(2048),
91 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
92 + .reserved = __cpu_to_le32(0),
95 + /* CE4: host->target HTT */
97 + .pipenum = __cpu_to_le32(4),
98 + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
99 + .nentries = __cpu_to_le32(256),
100 + .nbytes_max = __cpu_to_le32(256),
101 + .flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
102 + .reserved = __cpu_to_le32(0),
105 + /* CE5: target->host Pktlog */
107 + .pipenum = __cpu_to_le32(5),
108 + .pipedir = __cpu_to_le32(PIPEDIR_IN),
109 + .nentries = __cpu_to_le32(32),
110 + .nbytes_max = __cpu_to_le32(2048),
111 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
112 + .reserved = __cpu_to_le32(0),
115 + /* CE6: Reserved for target autonomous hif_memcpy */
117 + .pipenum = __cpu_to_le32(6),
118 + .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
119 + .nentries = __cpu_to_le32(32),
120 + .nbytes_max = __cpu_to_le32(16384),
121 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
122 + .reserved = __cpu_to_le32(0),
125 + /* CE7 used only by Host */
127 + .pipenum = __cpu_to_le32(7),
128 + .pipedir = __cpu_to_le32(PIPEDIR_OUT),
129 + .nentries = __cpu_to_le32(32),
130 + .nbytes_max = __cpu_to_le32(2048),
131 + .flags = __cpu_to_le32(0x2000),
132 + .reserved = __cpu_to_le32(0),
135 + /* CE8 target->host used only by IPA */
137 + .pipenum = __cpu_to_le32(8),
138 + .pipedir = __cpu_to_le32(PIPEDIR_INOUT),
139 + .nentries = __cpu_to_le32(32),
140 + .nbytes_max = __cpu_to_le32(16384),
141 + .flags = __cpu_to_le32(CE_ATTR_FLAGS),
142 + .reserved = __cpu_to_le32(0),
146 +/* Map from service/endpoint to Copy Engine for IPQ5018.
147 + * This table is derived from the CE TABLE, above.
148 + * It is passed to the Target at startup for use by firmware.
150 +const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[] = {
152 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
153 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
154 + .pipenum = __cpu_to_le32(3),
157 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
158 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
159 + .pipenum = __cpu_to_le32(2),
162 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
163 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
164 + .pipenum = __cpu_to_le32(3),
167 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
168 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
169 + .pipenum = __cpu_to_le32(2),
172 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
173 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
174 + .pipenum = __cpu_to_le32(3),
177 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
178 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
179 + .pipenum = __cpu_to_le32(2),
182 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
183 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
184 + .pipenum = __cpu_to_le32(3),
187 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
188 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
189 + .pipenum = __cpu_to_le32(2),
192 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
193 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
194 + .pipenum = __cpu_to_le32(3),
197 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
198 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
199 + .pipenum = __cpu_to_le32(2),
203 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
204 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
205 + .pipenum = __cpu_to_le32(0),
208 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
209 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
210 + .pipenum = __cpu_to_le32(1),
214 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
215 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
216 + .pipenum = __cpu_to_le32(0),
219 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
220 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
221 + .pipenum = __cpu_to_le32(1),
224 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
225 + .pipedir = __cpu_to_le32(PIPEDIR_OUT), /* out = UL = host -> target */
226 + .pipenum = __cpu_to_le32(4),
229 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
230 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
231 + .pipenum = __cpu_to_le32(1),
234 + .service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG),
235 + .pipedir = __cpu_to_le32(PIPEDIR_IN), /* in = DL = target -> host */
236 + .pipenum = __cpu_to_le32(5),
239 + /* (Additions here) */
241 + { /* terminator entry */ }
244 const struct ath11k_hw_regs ipq8074_regs = {
245 /* SW2TCL(x) R0 ring configuration address */
246 .hal_tcl1_ring_base_lsb = 0x00000510,