summaryrefslogtreecommitdiff
path: root/hw/qca8074/v2/tcl_gse_cmd.h
blob: 84c2f1f8f01568342c655246f000254e0b65f92f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
/*
 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

// $ATH_LICENSE_HW_HDR_C$
//
// DO NOT EDIT!  This file is automatically generated
//               These definitions are tied to a particular hardware layout


#ifndef _TCL_GSE_CMD_H_
#define _TCL_GSE_CMD_H_
#if !defined(__ASSEMBLER__)
#endif


// ################ START SUMMARY #################
//
//	Dword	Fields
//	0	control_buffer_addr_31_0[31:0]
//	1	control_buffer_addr_39_32[7:0], gse_ctrl[11:8], gse_sel[12], status_destination_ring_id[13], swap[14], index_search_en[15], cache_set_num[19:16], reserved_1a[31:20]
//	2	cmd_meta_data_31_0[31:0]
//	3	cmd_meta_data_63_32[31:0]
//	4	reserved_4a[31:0]
//	5	reserved_5a[31:0]
//	6	reserved_6a[19:0], ring_id[27:20], looping_count[31:28]
//
// ################ END SUMMARY #################

#define NUM_OF_DWORDS_TCL_GSE_CMD 7

struct tcl_gse_cmd {
             uint32_t control_buffer_addr_31_0        : 32; //[31:0]
             uint32_t control_buffer_addr_39_32       :  8, //[7:0]
                      gse_ctrl                        :  4, //[11:8]
                      gse_sel                         :  1, //[12]
                      status_destination_ring_id      :  1, //[13]
                      swap                            :  1, //[14]
                      index_search_en                 :  1, //[15]
                      cache_set_num                   :  4, //[19:16]
                      reserved_1a                     : 12; //[31:20]
             uint32_t cmd_meta_data_31_0              : 32; //[31:0]
             uint32_t cmd_meta_data_63_32             : 32; //[31:0]
             uint32_t reserved_4a                     : 32; //[31:0]
             uint32_t reserved_5a                     : 32; //[31:0]
             uint32_t reserved_6a                     : 20, //[19:0]
                      ring_id                         :  8, //[27:20]
                      looping_count                   :  4; //[31:28]
};

/*

control_buffer_addr_31_0
			
			Address (lower 32 bits) of a control buffer containing
			additional info needed for this command execution.
			
			<legal all>

control_buffer_addr_39_32
			
			Address (upper 8 bits) of a control buffer containing
			additional info needed for this command execution.
			
			<legal all>

gse_ctrl
			
			GSE control operations. This includes cache operations
			and table entry statistics read/clear operation.
			
			<enum 0 rd_stat> Report or Read statistics
			
			<enum 1 srch_dis> Search disable. Report only Hash
			
			<enum 2 Wr_bk_single> Write Back single entry
			
			<enum 3 wr_bk_all> Write Back entire cache entry
			
			<enum 4 inval_single> Invalidate single cache entry
			
			<enum 5 inval_all> Invalidate entire cache
			
			<enum 6 wr_bk_inval_single> Write back and Invalidate 
			single entry in cache
			
			<enum 7 wr_bk_inval_all> write back and invalidate
			entire cache
			
			<enum 8 clr_stat_single> Clear statistics for single
			entry
			
			<legal 0-8>
			
			Rest of the values reserved. 
			
			For all single entry control operations (write back,
			Invalidate or both)Statistics will be reported

gse_sel
			
			Bit to select the ASE or FSE to do the operation mention
			by GSE_ctrl bit
			
			0: FSE select
			
			1: ASE select

status_destination_ring_id
			
			The TCL status ring to which the GSE status needs to be
			send.
			
			
			
			<enum 0 tcl_status_0_ring>
			
			<enum 1 tcl_status_1_ring>
			
			
			
			<legal all>

swap
			
			Bit to enable byte swapping of contents of buffer
			
			<enum 0 Byte_swap_disable > 
			
			<enum 1 byte_swap_enable >
			
			<legal all>

index_search_en
			
			When this bit is set to 1 control_buffer_addr[19:0] will
			be considered as index of the AST or Flow table and GSE
			commands will be executed accordingly on the entry pointed
			by the index. 
			
			This feature is disabled by setting this bit to 0.
			
			<enum 0 index_based_cmd_disable>
			
			<enum 1 index_based_cmd_enable>
			
			
			
			<legal all>

cache_set_num
			
			Cache set number that should be used to cache the index
			based search results, for address and flow search. This
			value should be equal to value of cache_set_num for the
			index that is issued in TCL_DATA_CMD during search index
			based ASE or FSE. This field is valid for index based GSE
			commands
			
			<legal all>

reserved_1a
			
			<legal 0>

cmd_meta_data_31_0
			
			Meta data to be returned in the status descriptor
			
			<legal all>

cmd_meta_data_63_32
			
			Meta data to be returned in the status descriptor
			
			<legal all>

reserved_4a
			
			<legal 0>

reserved_5a
			
			<legal 0>

reserved_6a
			
			<legal 0>

ring_id
			
			Helps with debugging when dumping ring contents.
			
			<legal all>

looping_count
			
			A count value that indicates the number of times the
			producer of entries into the Ring has looped around the
			ring.
			
			At initialization time, this value is set to 0. On the
			first loop, this value is set to 1. After the max value is
			reached allowed by the number of bits for this field, the
			count value continues with 0 again.
			
			
			
			In case SW is the consumer of the ring entries, it can
			use this field to figure out up to where the producer of
			entries has created new entries. This eliminates the need to
			check where the head pointer' of the ring is located once
			the SW starts processing an interrupt indicating that new
			entries have been put into this ring...
			
			
			
			Also note that SW if it wants only needs to look at the
			LSB bit of this count value.
			
			<legal all>
*/


/* Description		TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0
			
			Address (lower 32 bits) of a control buffer containing
			additional info needed for this command execution.
			
			<legal all>
*/
#define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_OFFSET                0x00000000
#define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_LSB                   0
#define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_MASK                  0xffffffff

/* Description		TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32
			
			Address (upper 8 bits) of a control buffer containing
			additional info needed for this command execution.
			
			<legal all>
*/
#define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_OFFSET               0x00000004
#define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_LSB                  0
#define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_MASK                 0x000000ff

/* Description		TCL_GSE_CMD_1_GSE_CTRL
			
			GSE control operations. This includes cache operations
			and table entry statistics read/clear operation.
			
			<enum 0 rd_stat> Report or Read statistics
			
			<enum 1 srch_dis> Search disable. Report only Hash
			
			<enum 2 Wr_bk_single> Write Back single entry
			
			<enum 3 wr_bk_all> Write Back entire cache entry
			
			<enum 4 inval_single> Invalidate single cache entry
			
			<enum 5 inval_all> Invalidate entire cache
			
			<enum 6 wr_bk_inval_single> Write back and Invalidate 
			single entry in cache
			
			<enum 7 wr_bk_inval_all> write back and invalidate
			entire cache
			
			<enum 8 clr_stat_single> Clear statistics for single
			entry
			
			<legal 0-8>
			
			Rest of the values reserved. 
			
			For all single entry control operations (write back,
			Invalidate or both)Statistics will be reported
*/
#define TCL_GSE_CMD_1_GSE_CTRL_OFFSET                                0x00000004
#define TCL_GSE_CMD_1_GSE_CTRL_LSB                                   8
#define TCL_GSE_CMD_1_GSE_CTRL_MASK                                  0x00000f00

/* Description		TCL_GSE_CMD_1_GSE_SEL
			
			Bit to select the ASE or FSE to do the operation mention
			by GSE_ctrl bit
			
			0: FSE select
			
			1: ASE select
*/
#define TCL_GSE_CMD_1_GSE_SEL_OFFSET                                 0x00000004
#define TCL_GSE_CMD_1_GSE_SEL_LSB                                    12
#define TCL_GSE_CMD_1_GSE_SEL_MASK                                   0x00001000

/* Description		TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID
			
			The TCL status ring to which the GSE status needs to be
			send.
			
			
			
			<enum 0 tcl_status_0_ring>
			
			<enum 1 tcl_status_1_ring>
			
			
			
			<legal all>
*/
#define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_OFFSET              0x00000004
#define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_LSB                 13
#define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_MASK                0x00002000

/* Description		TCL_GSE_CMD_1_SWAP
			
			Bit to enable byte swapping of contents of buffer
			
			<enum 0 Byte_swap_disable > 
			
			<enum 1 byte_swap_enable >
			
			<legal all>
*/
#define TCL_GSE_CMD_1_SWAP_OFFSET                                    0x00000004
#define TCL_GSE_CMD_1_SWAP_LSB                                       14
#define TCL_GSE_CMD_1_SWAP_MASK                                      0x00004000

/* Description		TCL_GSE_CMD_1_INDEX_SEARCH_EN
			
			When this bit is set to 1 control_buffer_addr[19:0] will
			be considered as index of the AST or Flow table and GSE
			commands will be executed accordingly on the entry pointed
			by the index. 
			
			This feature is disabled by setting this bit to 0.
			
			<enum 0 index_based_cmd_disable>
			
			<enum 1 index_based_cmd_enable>
			
			
			
			<legal all>
*/
#define TCL_GSE_CMD_1_INDEX_SEARCH_EN_OFFSET                         0x00000004
#define TCL_GSE_CMD_1_INDEX_SEARCH_EN_LSB                            15
#define TCL_GSE_CMD_1_INDEX_SEARCH_EN_MASK                           0x00008000

/* Description		TCL_GSE_CMD_1_CACHE_SET_NUM
			
			Cache set number that should be used to cache the index
			based search results, for address and flow search. This
			value should be equal to value of cache_set_num for the
			index that is issued in TCL_DATA_CMD during search index
			based ASE or FSE. This field is valid for index based GSE
			commands
			
			<legal all>
*/
#define TCL_GSE_CMD_1_CACHE_SET_NUM_OFFSET                           0x00000004
#define TCL_GSE_CMD_1_CACHE_SET_NUM_LSB                              16
#define TCL_GSE_CMD_1_CACHE_SET_NUM_MASK                             0x000f0000

/* Description		TCL_GSE_CMD_1_RESERVED_1A
			
			<legal 0>
*/
#define TCL_GSE_CMD_1_RESERVED_1A_OFFSET                             0x00000004
#define TCL_GSE_CMD_1_RESERVED_1A_LSB                                20
#define TCL_GSE_CMD_1_RESERVED_1A_MASK                               0xfff00000

/* Description		TCL_GSE_CMD_2_CMD_META_DATA_31_0
			
			Meta data to be returned in the status descriptor
			
			<legal all>
*/
#define TCL_GSE_CMD_2_CMD_META_DATA_31_0_OFFSET                      0x00000008
#define TCL_GSE_CMD_2_CMD_META_DATA_31_0_LSB                         0
#define TCL_GSE_CMD_2_CMD_META_DATA_31_0_MASK                        0xffffffff

/* Description		TCL_GSE_CMD_3_CMD_META_DATA_63_32
			
			Meta data to be returned in the status descriptor
			
			<legal all>
*/
#define TCL_GSE_CMD_3_CMD_META_DATA_63_32_OFFSET                     0x0000000c
#define TCL_GSE_CMD_3_CMD_META_DATA_63_32_LSB                        0
#define TCL_GSE_CMD_3_CMD_META_DATA_63_32_MASK                       0xffffffff

/* Description		TCL_GSE_CMD_4_RESERVED_4A
			
			<legal 0>
*/
#define TCL_GSE_CMD_4_RESERVED_4A_OFFSET                             0x00000010
#define TCL_GSE_CMD_4_RESERVED_4A_LSB                                0
#define TCL_GSE_CMD_4_RESERVED_4A_MASK                               0xffffffff

/* Description		TCL_GSE_CMD_5_RESERVED_5A
			
			<legal 0>
*/
#define TCL_GSE_CMD_5_RESERVED_5A_OFFSET                             0x00000014
#define TCL_GSE_CMD_5_RESERVED_5A_LSB                                0
#define TCL_GSE_CMD_5_RESERVED_5A_MASK                               0xffffffff

/* Description		TCL_GSE_CMD_6_RESERVED_6A
			
			<legal 0>
*/
#define TCL_GSE_CMD_6_RESERVED_6A_OFFSET                             0x00000018
#define TCL_GSE_CMD_6_RESERVED_6A_LSB                                0
#define TCL_GSE_CMD_6_RESERVED_6A_MASK                               0x000fffff

/* Description		TCL_GSE_CMD_6_RING_ID
			
			Helps with debugging when dumping ring contents.
			
			<legal all>
*/
#define TCL_GSE_CMD_6_RING_ID_OFFSET                                 0x00000018
#define TCL_GSE_CMD_6_RING_ID_LSB                                    20
#define TCL_GSE_CMD_6_RING_ID_MASK                                   0x0ff00000

/* Description		TCL_GSE_CMD_6_LOOPING_COUNT
			
			A count value that indicates the number of times the
			producer of entries into the Ring has looped around the
			ring.
			
			At initialization time, this value is set to 0. On the
			first loop, this value is set to 1. After the max value is
			reached allowed by the number of bits for this field, the
			count value continues with 0 again.
			
			
			
			In case SW is the consumer of the ring entries, it can
			use this field to figure out up to where the producer of
			entries has created new entries. This eliminates the need to
			check where the head pointer' of the ring is located once
			the SW starts processing an interrupt indicating that new
			entries have been put into this ring...
			
			
			
			Also note that SW if it wants only needs to look at the
			LSB bit of this count value.
			
			<legal all>
*/
#define TCL_GSE_CMD_6_LOOPING_COUNT_OFFSET                           0x00000018
#define TCL_GSE_CMD_6_LOOPING_COUNT_LSB                              28
#define TCL_GSE_CMD_6_LOOPING_COUNT_MASK                             0xf0000000


#endif // _TCL_GSE_CMD_H_