xref: /wlan-driver/fw-api/hw/qca6750/v1/ce_stat_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 //
20 // DO NOT EDIT!  This file is automatically generated
21 //               These definitions are tied to a particular hardware layout
22 
23 
24 #ifndef _CE_STAT_DESC_H_
25 #define _CE_STAT_DESC_H_
26 #if !defined(__ASSEMBLER__)
27 #endif
28 
29 
30 // ################ START SUMMARY #################
31 //
32 //	Dword	Fields
33 //	0	ce_res_5[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_6[15:12], length[31:16]
34 //	1	toeplitz_hash_0[31:0]
35 //	2	toeplitz_hash_1[31:0]
36 //	3	fw_metadata[15:0], ce_res_7[19:16], ring_id[27:20], looping_count[31:28]
37 //
38 // ################ END SUMMARY #################
39 
40 #define NUM_OF_DWORDS_CE_STAT_DESC 4
41 
42 struct ce_stat_desc {
43              uint32_t ce_res_5                        :  8, //[7:0]
44                       toeplitz_en                     :  1, //[8]
45                       src_swap                        :  1, //[9]
46                       dest_swap                       :  1, //[10]
47                       gather                          :  1, //[11]
48                       ce_res_6                        :  4, //[15:12]
49                       length                          : 16; //[31:16]
50              uint32_t toeplitz_hash_0                 : 32; //[31:0]
51              uint32_t toeplitz_hash_1                 : 32; //[31:0]
52              uint32_t fw_metadata                     : 16, //[15:0]
53                       ce_res_7                        :  4, //[19:16]
54                       ring_id                         :  8, //[27:20]
55                       looping_count                   :  4; //[31:28]
56 };
57 
58 /*
59 
60 ce_res_5
61 
62 			Reserved
63 
64 			<legal all>
65 
66 toeplitz_en
67 
68 
69 			<legal all>
70 
71 src_swap
72 
73 			Source memory buffer swapped
74 
75 			<legal all>
76 
77 dest_swap
78 
79 			Destination  memory buffer swapped
80 
81 			<legal all>
82 
83 gather
84 
85 			Gather of multiple copy engine source descriptors to one
86 			destination enabled
87 
88 			<legal all>
89 
90 ce_res_6
91 
92 			Reserved
93 
94 			<legal all>
95 
96 length
97 
98 			Sum of all the Lengths of the source descriptor in the
99 			gather chain
100 
101 			<legal all>
102 
103 toeplitz_hash_0
104 
105 			32 LS bits of 64 bit Toeplitz LFSR hash result
106 
107 			<legal all>
108 
109 toeplitz_hash_1
110 
111 			32 MS bits of 64 bit Toeplitz LFSR hash result
112 
113 			<legal all>
114 
115 fw_metadata
116 
117 			Meta data used by FW
118 
119 			In case of gather field in first source ring entry of
120 			the gather copy cycle in taken into account.
121 
122 			<legal all>
123 
124 ce_res_7
125 
126 			Reserved
127 
128 			<legal all>
129 
130 ring_id
131 
132 			The buffer pointer ring ID.
133 
134 			0 refers to the IDLE ring
135 
136 			1 - N refers to other rings
137 
138 
139 
140 			Helps with debugging when dumping ring contents.
141 
142 			<legal all>
143 
144 looping_count
145 
146 			A count value that indicates the number of times the
147 			producer of entries into the Ring has looped around the
148 			ring.
149 
150 			At initialization time, this value is set to 0. On the
151 			first loop, this value is set to 1. After the max value is
152 			reached allowed by the number of bits for this field, the
153 			count value continues with 0 again.
154 
155 			In case SW is the consumer of the ring entries, it can
156 			use this field to figure out up to where the producer of
157 			entries has created new entries. This eliminates the need to
158 			check where the head pointer' of the ring is located once
159 			the SW starts processing an interrupt indicating that new
160 			entries have been put into this ring...
161 
162 			Also note that SW if it wants only needs to look at the
163 			LSB bit of this count value.
164 
165 			<legal all>
166 */
167 
168 
169 /* Description		CE_STAT_DESC_0_CE_RES_5
170 
171 			Reserved
172 
173 			<legal all>
174 */
175 #define CE_STAT_DESC_0_CE_RES_5_OFFSET                               0x00000000
176 #define CE_STAT_DESC_0_CE_RES_5_LSB                                  0
177 #define CE_STAT_DESC_0_CE_RES_5_MASK                                 0x000000ff
178 
179 /* Description		CE_STAT_DESC_0_TOEPLITZ_EN
180 
181 
182 			<legal all>
183 */
184 #define CE_STAT_DESC_0_TOEPLITZ_EN_OFFSET                            0x00000000
185 #define CE_STAT_DESC_0_TOEPLITZ_EN_LSB                               8
186 #define CE_STAT_DESC_0_TOEPLITZ_EN_MASK                              0x00000100
187 
188 /* Description		CE_STAT_DESC_0_SRC_SWAP
189 
190 			Source memory buffer swapped
191 
192 			<legal all>
193 */
194 #define CE_STAT_DESC_0_SRC_SWAP_OFFSET                               0x00000000
195 #define CE_STAT_DESC_0_SRC_SWAP_LSB                                  9
196 #define CE_STAT_DESC_0_SRC_SWAP_MASK                                 0x00000200
197 
198 /* Description		CE_STAT_DESC_0_DEST_SWAP
199 
200 			Destination  memory buffer swapped
201 
202 			<legal all>
203 */
204 #define CE_STAT_DESC_0_DEST_SWAP_OFFSET                              0x00000000
205 #define CE_STAT_DESC_0_DEST_SWAP_LSB                                 10
206 #define CE_STAT_DESC_0_DEST_SWAP_MASK                                0x00000400
207 
208 /* Description		CE_STAT_DESC_0_GATHER
209 
210 			Gather of multiple copy engine source descriptors to one
211 			destination enabled
212 
213 			<legal all>
214 */
215 #define CE_STAT_DESC_0_GATHER_OFFSET                                 0x00000000
216 #define CE_STAT_DESC_0_GATHER_LSB                                    11
217 #define CE_STAT_DESC_0_GATHER_MASK                                   0x00000800
218 
219 /* Description		CE_STAT_DESC_0_CE_RES_6
220 
221 			Reserved
222 
223 			<legal all>
224 */
225 #define CE_STAT_DESC_0_CE_RES_6_OFFSET                               0x00000000
226 #define CE_STAT_DESC_0_CE_RES_6_LSB                                  12
227 #define CE_STAT_DESC_0_CE_RES_6_MASK                                 0x0000f000
228 
229 /* Description		CE_STAT_DESC_0_LENGTH
230 
231 			Sum of all the Lengths of the source descriptor in the
232 			gather chain
233 
234 			<legal all>
235 */
236 #define CE_STAT_DESC_0_LENGTH_OFFSET                                 0x00000000
237 #define CE_STAT_DESC_0_LENGTH_LSB                                    16
238 #define CE_STAT_DESC_0_LENGTH_MASK                                   0xffff0000
239 
240 /* Description		CE_STAT_DESC_1_TOEPLITZ_HASH_0
241 
242 			32 LS bits of 64 bit Toeplitz LFSR hash result
243 
244 			<legal all>
245 */
246 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_OFFSET                        0x00000004
247 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_LSB                           0
248 #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_MASK                          0xffffffff
249 
250 /* Description		CE_STAT_DESC_2_TOEPLITZ_HASH_1
251 
252 			32 MS bits of 64 bit Toeplitz LFSR hash result
253 
254 			<legal all>
255 */
256 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_OFFSET                        0x00000008
257 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_LSB                           0
258 #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_MASK                          0xffffffff
259 
260 /* Description		CE_STAT_DESC_3_FW_METADATA
261 
262 			Meta data used by FW
263 
264 			In case of gather field in first source ring entry of
265 			the gather copy cycle in taken into account.
266 
267 			<legal all>
268 */
269 #define CE_STAT_DESC_3_FW_METADATA_OFFSET                            0x0000000c
270 #define CE_STAT_DESC_3_FW_METADATA_LSB                               0
271 #define CE_STAT_DESC_3_FW_METADATA_MASK                              0x0000ffff
272 
273 /* Description		CE_STAT_DESC_3_CE_RES_7
274 
275 			Reserved
276 
277 			<legal all>
278 */
279 #define CE_STAT_DESC_3_CE_RES_7_OFFSET                               0x0000000c
280 #define CE_STAT_DESC_3_CE_RES_7_LSB                                  16
281 #define CE_STAT_DESC_3_CE_RES_7_MASK                                 0x000f0000
282 
283 /* Description		CE_STAT_DESC_3_RING_ID
284 
285 			The buffer pointer ring ID.
286 
287 			0 refers to the IDLE ring
288 
289 			1 - N refers to other rings
290 
291 
292 
293 			Helps with debugging when dumping ring contents.
294 
295 			<legal all>
296 */
297 #define CE_STAT_DESC_3_RING_ID_OFFSET                                0x0000000c
298 #define CE_STAT_DESC_3_RING_ID_LSB                                   20
299 #define CE_STAT_DESC_3_RING_ID_MASK                                  0x0ff00000
300 
301 /* Description		CE_STAT_DESC_3_LOOPING_COUNT
302 
303 			A count value that indicates the number of times the
304 			producer of entries into the Ring has looped around the
305 			ring.
306 
307 			At initialization time, this value is set to 0. On the
308 			first loop, this value is set to 1. After the max value is
309 			reached allowed by the number of bits for this field, the
310 			count value continues with 0 again.
311 
312 			In case SW is the consumer of the ring entries, it can
313 			use this field to figure out up to where the producer of
314 			entries has created new entries. This eliminates the need to
315 			check where the head pointer' of the ring is located once
316 			the SW starts processing an interrupt indicating that new
317 			entries have been put into this ring...
318 
319 			Also note that SW if it wants only needs to look at the
320 			LSB bit of this count value.
321 
322 			<legal all>
323 */
324 #define CE_STAT_DESC_3_LOOPING_COUNT_OFFSET                          0x0000000c
325 #define CE_STAT_DESC_3_LOOPING_COUNT_LSB                             28
326 #define CE_STAT_DESC_3_LOOPING_COUNT_MASK                            0xf0000000
327 
328 
329 #endif // _CE_STAT_DESC_H_
330