xref: /wlan-driver/fw-api/hw/qca8074/v1/ce_src_desc.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016 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 // $ATH_LICENSE_HW_HDR_C$
20 //
21 // DO NOT EDIT!  This file is automatically generated
22 //               These definitions are tied to a particular hardware layout
23 
24 
25 #ifndef _CE_SRC_DESC_H_
26 #define _CE_SRC_DESC_H_
27 #if !defined(__ASSEMBLER__)
28 #endif
29 
30 
31 // ################ START SUMMARY #################
32 //
33 //	Dword	Fields
34 //	0	src_buffer_low[31:0]
35 //	1	src_buffer_high[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_0[15:12], length[31:16]
36 //	2	fw_metadata[15:0], ce_res_1[31:16]
37 //	3	ce_res_2[19:0], ring_id[27:20], looping_count[31:28]
38 //
39 // ################ END SUMMARY #################
40 
41 #define NUM_OF_DWORDS_CE_SRC_DESC 4
42 
43 struct ce_src_desc {
44              uint32_t src_buffer_low                  : 32; //[31:0]
45              uint32_t src_buffer_high                 :  8, //[7:0]
46                       toeplitz_en                     :  1, //[8]
47                       src_swap                        :  1, //[9]
48                       dest_swap                       :  1, //[10]
49                       gather                          :  1, //[11]
50                       ce_res_0                        :  4, //[15:12]
51                       length                          : 16; //[31:16]
52              uint32_t fw_metadata                     : 16, //[15:0]
53                       ce_res_1                        : 16; //[31:16]
54              uint32_t ce_res_2                        : 20, //[19:0]
55                       ring_id                         :  8, //[27:20]
56                       looping_count                   :  4; //[31:28]
57 };
58 
59 /*
60 
61 src_buffer_low
62 
63 			LSB 32 bits of the 40 Bit Pointer to the source buffer
64 
65 			<legal all>
66 
67 src_buffer_high
68 
69 			MSB 8 bits of the 40 Bit Pointer to the source buffer
70 
71 			<legal all>
72 
73 toeplitz_en
74 
75 			Enable generation of 32-bit Toeplitz-LFSR hash for the
76 			data transfer
77 
78 			In case of gather field in first source ring entry of
79 			the gather copy cycle in taken into account.
80 
81 			<legal all>
82 
83 src_swap
84 
85 			Treats source memory organization as big-endian. For
86 			each dword read (4 bytes), the byte 0 is swapped with byte 3
87 			and byte 1 is swapped with byte 2.
88 
89 			In case of gather field in first source ring entry of
90 			the gather copy cycle in taken into account.
91 
92 			<legal all>
93 
94 dest_swap
95 
96 			Treats destination memory organization as big-endian.
97 			For each dword write (4 bytes), the byte 0 is swapped with
98 			byte 3 and byte 1 is swapped with byte 2.
99 
100 			In case of gather field in first source ring entry of
101 			the gather copy cycle in taken into account.
102 
103 			<legal all>
104 
105 gather
106 
107 			Enables gather of multiple copy engine source
108 			descriptors to one destination.
109 
110 			<legal all>
111 
112 ce_res_0
113 
114 			Reserved
115 
116 			<legal all>
117 
118 length
119 
120 			Length of the buffer in units of octets of the current
121 			descriptor
122 
123 			<legal all>
124 
125 fw_metadata
126 
127 			Meta data used by FW
128 
129 			In case of gather field in first source ring entry of
130 			the gather copy cycle in taken into account.
131 
132 			<legal all>
133 
134 ce_res_1
135 
136 			Reserved
137 
138 			<legal all>
139 
140 ce_res_2
141 
142 			Reserved
143 
144 			<legal all>
145 
146 ring_id
147 
148 			The buffer pointer ring ID.
149 
150 			0 refers to the IDLE ring
151 
152 			1 - N refers to other rings
153 
154 
155 
156 			Helps with debugging when dumping ring contents.
157 
158 			<legal all>
159 
160 looping_count
161 
162 			A count value that indicates the number of times the
163 			producer of entries into the Ring has looped around the
164 			ring.
165 
166 			At initialization time, this value is set to 0. On the
167 			first loop, this value is set to 1. After the max value is
168 			reached allowed by the number of bits for this field, the
169 			count value continues with 0 again.
170 
171 			In case SW is the consumer of the ring entries, it can
172 			use this field to figure out up to where the producer of
173 			entries has created new entries. This eliminates the need to
174 			check where the head pointer' of the ring is located once
175 			the SW starts processing an interrupt indicating that new
176 			entries have been put into this ring...
177 
178 			Also note that SW if it wants only needs to look at the
179 			LSB bit of this count value.
180 
181 			<legal all>
182 */
183 
184 
185 /* Description		CE_SRC_DESC_0_SRC_BUFFER_LOW
186 
187 			LSB 32 bits of the 40 Bit Pointer to the source buffer
188 
189 			<legal all>
190 */
191 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_OFFSET                          0x00000000
192 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_LSB                             0
193 #define CE_SRC_DESC_0_SRC_BUFFER_LOW_MASK                            0xffffffff
194 
195 /* Description		CE_SRC_DESC_1_SRC_BUFFER_HIGH
196 
197 			MSB 8 bits of the 40 Bit Pointer to the source buffer
198 
199 			<legal all>
200 */
201 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_OFFSET                         0x00000004
202 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_LSB                            0
203 #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_MASK                           0x000000ff
204 
205 /* Description		CE_SRC_DESC_1_TOEPLITZ_EN
206 
207 			Enable generation of 32-bit Toeplitz-LFSR hash for the
208 			data transfer
209 
210 			In case of gather field in first source ring entry of
211 			the gather copy cycle in taken into account.
212 
213 			<legal all>
214 */
215 #define CE_SRC_DESC_1_TOEPLITZ_EN_OFFSET                             0x00000004
216 #define CE_SRC_DESC_1_TOEPLITZ_EN_LSB                                8
217 #define CE_SRC_DESC_1_TOEPLITZ_EN_MASK                               0x00000100
218 
219 /* Description		CE_SRC_DESC_1_SRC_SWAP
220 
221 			Treats source memory organization as big-endian. For
222 			each dword read (4 bytes), the byte 0 is swapped with byte 3
223 			and byte 1 is swapped with byte 2.
224 
225 			In case of gather field in first source ring entry of
226 			the gather copy cycle in taken into account.
227 
228 			<legal all>
229 */
230 #define CE_SRC_DESC_1_SRC_SWAP_OFFSET                                0x00000004
231 #define CE_SRC_DESC_1_SRC_SWAP_LSB                                   9
232 #define CE_SRC_DESC_1_SRC_SWAP_MASK                                  0x00000200
233 
234 /* Description		CE_SRC_DESC_1_DEST_SWAP
235 
236 			Treats destination memory organization as big-endian.
237 			For each dword write (4 bytes), the byte 0 is swapped with
238 			byte 3 and byte 1 is swapped with byte 2.
239 
240 			In case of gather field in first source ring entry of
241 			the gather copy cycle in taken into account.
242 
243 			<legal all>
244 */
245 #define CE_SRC_DESC_1_DEST_SWAP_OFFSET                               0x00000004
246 #define CE_SRC_DESC_1_DEST_SWAP_LSB                                  10
247 #define CE_SRC_DESC_1_DEST_SWAP_MASK                                 0x00000400
248 
249 /* Description		CE_SRC_DESC_1_GATHER
250 
251 			Enables gather of multiple copy engine source
252 			descriptors to one destination.
253 
254 			<legal all>
255 */
256 #define CE_SRC_DESC_1_GATHER_OFFSET                                  0x00000004
257 #define CE_SRC_DESC_1_GATHER_LSB                                     11
258 #define CE_SRC_DESC_1_GATHER_MASK                                    0x00000800
259 
260 /* Description		CE_SRC_DESC_1_CE_RES_0
261 
262 			Reserved
263 
264 			<legal all>
265 */
266 #define CE_SRC_DESC_1_CE_RES_0_OFFSET                                0x00000004
267 #define CE_SRC_DESC_1_CE_RES_0_LSB                                   12
268 #define CE_SRC_DESC_1_CE_RES_0_MASK                                  0x0000f000
269 
270 /* Description		CE_SRC_DESC_1_LENGTH
271 
272 			Length of the buffer in units of octets of the current
273 			descriptor
274 
275 			<legal all>
276 */
277 #define CE_SRC_DESC_1_LENGTH_OFFSET                                  0x00000004
278 #define CE_SRC_DESC_1_LENGTH_LSB                                     16
279 #define CE_SRC_DESC_1_LENGTH_MASK                                    0xffff0000
280 
281 /* Description		CE_SRC_DESC_2_FW_METADATA
282 
283 			Meta data used by FW
284 
285 			In case of gather field in first source ring entry of
286 			the gather copy cycle in taken into account.
287 
288 			<legal all>
289 */
290 #define CE_SRC_DESC_2_FW_METADATA_OFFSET                             0x00000008
291 #define CE_SRC_DESC_2_FW_METADATA_LSB                                0
292 #define CE_SRC_DESC_2_FW_METADATA_MASK                               0x0000ffff
293 
294 /* Description		CE_SRC_DESC_2_CE_RES_1
295 
296 			Reserved
297 
298 			<legal all>
299 */
300 #define CE_SRC_DESC_2_CE_RES_1_OFFSET                                0x00000008
301 #define CE_SRC_DESC_2_CE_RES_1_LSB                                   16
302 #define CE_SRC_DESC_2_CE_RES_1_MASK                                  0xffff0000
303 
304 /* Description		CE_SRC_DESC_3_CE_RES_2
305 
306 			Reserved
307 
308 			<legal all>
309 */
310 #define CE_SRC_DESC_3_CE_RES_2_OFFSET                                0x0000000c
311 #define CE_SRC_DESC_3_CE_RES_2_LSB                                   0
312 #define CE_SRC_DESC_3_CE_RES_2_MASK                                  0x000fffff
313 
314 /* Description		CE_SRC_DESC_3_RING_ID
315 
316 			The buffer pointer ring ID.
317 
318 			0 refers to the IDLE ring
319 
320 			1 - N refers to other rings
321 
322 
323 
324 			Helps with debugging when dumping ring contents.
325 
326 			<legal all>
327 */
328 #define CE_SRC_DESC_3_RING_ID_OFFSET                                 0x0000000c
329 #define CE_SRC_DESC_3_RING_ID_LSB                                    20
330 #define CE_SRC_DESC_3_RING_ID_MASK                                   0x0ff00000
331 
332 /* Description		CE_SRC_DESC_3_LOOPING_COUNT
333 
334 			A count value that indicates the number of times the
335 			producer of entries into the Ring has looped around the
336 			ring.
337 
338 			At initialization time, this value is set to 0. On the
339 			first loop, this value is set to 1. After the max value is
340 			reached allowed by the number of bits for this field, the
341 			count value continues with 0 again.
342 
343 			In case SW is the consumer of the ring entries, it can
344 			use this field to figure out up to where the producer of
345 			entries has created new entries. This eliminates the need to
346 			check where the head pointer' of the ring is located once
347 			the SW starts processing an interrupt indicating that new
348 			entries have been put into this ring...
349 
350 			Also note that SW if it wants only needs to look at the
351 			LSB bit of this count value.
352 
353 			<legal all>
354 */
355 #define CE_SRC_DESC_3_LOOPING_COUNT_OFFSET                           0x0000000c
356 #define CE_SRC_DESC_3_LOOPING_COUNT_LSB                              28
357 #define CE_SRC_DESC_3_LOOPING_COUNT_MASK                             0xf0000000
358 
359 
360 #endif // _CE_SRC_DESC_H_
361