1  /*
2   * Copyright (c) 2016-2018 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  #ifndef _REO_UNBLOCK_CACHE_STATUS_H_
20  #define _REO_UNBLOCK_CACHE_STATUS_H_
21  #if !defined(__ASSEMBLER__)
22  #endif
23  
24  #include "uniform_reo_status_header.h"
25  
26  // ################ START SUMMARY #################
27  //
28  //	Dword	Fields
29  //	0-1	struct uniform_reo_status_header status_header;
30  //	2	error_detected[0], unblock_type[1], reserved_2a[31:2]
31  //	3	reserved_3a[31:0]
32  //	4	reserved_4a[31:0]
33  //	5	reserved_5a[31:0]
34  //	6	reserved_6a[31:0]
35  //	7	reserved_7a[31:0]
36  //	8	reserved_8a[31:0]
37  //	9	reserved_9a[31:0]
38  //	10	reserved_10a[31:0]
39  //	11	reserved_11a[31:0]
40  //	12	reserved_12a[31:0]
41  //	13	reserved_13a[31:0]
42  //	14	reserved_14a[31:0]
43  //	15	reserved_15a[31:0]
44  //	16	reserved_16a[31:0]
45  //	17	reserved_17a[31:0]
46  //	18	reserved_18a[31:0]
47  //	19	reserved_19a[31:0]
48  //	20	reserved_20a[31:0]
49  //	21	reserved_21a[31:0]
50  //	22	reserved_22a[31:0]
51  //	23	reserved_23a[31:0]
52  //	24	reserved_24a[27:0], looping_count[31:28]
53  //
54  // ################ END SUMMARY #################
55  
56  #define NUM_OF_DWORDS_REO_UNBLOCK_CACHE_STATUS 25
57  
58  struct reo_unblock_cache_status {
59      struct            uniform_reo_status_header                       status_header;
60               uint32_t error_detected                  :  1, //[0]
61                        unblock_type                    :  1, //[1]
62                        reserved_2a                     : 30; //[31:2]
63               uint32_t reserved_3a                     : 32; //[31:0]
64               uint32_t reserved_4a                     : 32; //[31:0]
65               uint32_t reserved_5a                     : 32; //[31:0]
66               uint32_t reserved_6a                     : 32; //[31:0]
67               uint32_t reserved_7a                     : 32; //[31:0]
68               uint32_t reserved_8a                     : 32; //[31:0]
69               uint32_t reserved_9a                     : 32; //[31:0]
70               uint32_t reserved_10a                    : 32; //[31:0]
71               uint32_t reserved_11a                    : 32; //[31:0]
72               uint32_t reserved_12a                    : 32; //[31:0]
73               uint32_t reserved_13a                    : 32; //[31:0]
74               uint32_t reserved_14a                    : 32; //[31:0]
75               uint32_t reserved_15a                    : 32; //[31:0]
76               uint32_t reserved_16a                    : 32; //[31:0]
77               uint32_t reserved_17a                    : 32; //[31:0]
78               uint32_t reserved_18a                    : 32; //[31:0]
79               uint32_t reserved_19a                    : 32; //[31:0]
80               uint32_t reserved_20a                    : 32; //[31:0]
81               uint32_t reserved_21a                    : 32; //[31:0]
82               uint32_t reserved_22a                    : 32; //[31:0]
83               uint32_t reserved_23a                    : 32; //[31:0]
84               uint32_t reserved_24a                    : 28, //[27:0]
85                        looping_count                   :  4; //[31:28]
86  };
87  
88  /*
89  
90  struct uniform_reo_status_header status_header
91  
92  			Consumer: SW
93  
94  			Producer: REO
95  
96  
97  
98  			Details that can link this status with the original
99  			command. It also contains info on how long REO took to
100  			execute this command.
101  
102  error_detected
103  
104  			Status for blocking resource handling
105  
106  
107  
108  			0: No error has been detected while executing this
109  			command
110  
111  			1: The blocking resource was not in use, and therefor it
112  			could not be 'unblocked'
113  
114  unblock_type
115  
116  			Reference to the type of Unblock command type...
117  
118  
119  
120  			<enum 0 unblock_resource_index> Unblock a blocking
121  			resource
122  
123  
124  
125  			<enum 1 unblock_cache> The entire cache usage is
126  			unblock.
127  
128  
129  
130  			<legal all>
131  
132  reserved_2a
133  
134  			<legal 0>
135  
136  reserved_3a
137  
138  			<legal 0>
139  
140  reserved_4a
141  
142  			<legal 0>
143  
144  reserved_5a
145  
146  			<legal 0>
147  
148  reserved_6a
149  
150  			<legal 0>
151  
152  reserved_7a
153  
154  			<legal 0>
155  
156  reserved_8a
157  
158  			<legal 0>
159  
160  reserved_9a
161  
162  			<legal 0>
163  
164  reserved_10a
165  
166  			<legal 0>
167  
168  reserved_11a
169  
170  			<legal 0>
171  
172  reserved_12a
173  
174  			<legal 0>
175  
176  reserved_13a
177  
178  			<legal 0>
179  
180  reserved_14a
181  
182  			<legal 0>
183  
184  reserved_15a
185  
186  			<legal 0>
187  
188  reserved_16a
189  
190  			<legal 0>
191  
192  reserved_17a
193  
194  			<legal 0>
195  
196  reserved_18a
197  
198  			<legal 0>
199  
200  reserved_19a
201  
202  			<legal 0>
203  
204  reserved_20a
205  
206  			<legal 0>
207  
208  reserved_21a
209  
210  			<legal 0>
211  
212  reserved_22a
213  
214  			<legal 0>
215  
216  reserved_23a
217  
218  			<legal 0>
219  
220  reserved_24a
221  
222  			<legal 0>
223  
224  looping_count
225  
226  			A count value that indicates the number of times the
227  			producer of entries into this Ring has looped around the
228  			ring.
229  
230  			At initialization time, this value is set to 0. On the
231  			first loop, this value is set to 1. After the max value is
232  			reached allowed by the number of bits for this field, the
233  			count value continues with 0 again.
234  
235  
236  
237  			In case SW is the consumer of the ring entries, it can
238  			use this field to figure out up to where the producer of
239  			entries has created new entries. This eliminates the need to
240  			check where the head pointer' of the ring is located once
241  			the SW starts processing an interrupt indicating that new
242  			entries have been put into this ring...
243  
244  
245  
246  			Also note that SW if it wants only needs to look at the
247  			LSB bit of this count value.
248  
249  			<legal all>
250  */
251  
252  #define REO_UNBLOCK_CACHE_STATUS_0_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_OFFSET 0x00000000
253  #define REO_UNBLOCK_CACHE_STATUS_0_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_LSB 28
254  #define REO_UNBLOCK_CACHE_STATUS_0_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_MASK 0xffffffff
255  #define REO_UNBLOCK_CACHE_STATUS_1_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_OFFSET 0x00000004
256  #define REO_UNBLOCK_CACHE_STATUS_1_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_LSB 28
257  #define REO_UNBLOCK_CACHE_STATUS_1_UNIFORM_REO_STATUS_HEADER_STATUS_HEADER_MASK 0xffffffff
258  
259  /* Description		REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED
260  
261  			Status for blocking resource handling
262  
263  
264  
265  			0: No error has been detected while executing this
266  			command
267  
268  			1: The blocking resource was not in use, and therefor it
269  			could not be 'unblocked'
270  */
271  #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_OFFSET             0x00000008
272  #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_LSB                0
273  #define REO_UNBLOCK_CACHE_STATUS_2_ERROR_DETECTED_MASK               0x00000001
274  
275  /* Description		REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE
276  
277  			Reference to the type of Unblock command type...
278  
279  
280  
281  			<enum 0 unblock_resource_index> Unblock a blocking
282  			resource
283  
284  
285  
286  			<enum 1 unblock_cache> The entire cache usage is
287  			unblock.
288  
289  
290  
291  			<legal all>
292  */
293  #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_OFFSET               0x00000008
294  #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_LSB                  1
295  #define REO_UNBLOCK_CACHE_STATUS_2_UNBLOCK_TYPE_MASK                 0x00000002
296  
297  /* Description		REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A
298  
299  			<legal 0>
300  */
301  #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_OFFSET                0x00000008
302  #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_LSB                   2
303  #define REO_UNBLOCK_CACHE_STATUS_2_RESERVED_2A_MASK                  0xfffffffc
304  
305  /* Description		REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A
306  
307  			<legal 0>
308  */
309  #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_OFFSET                0x0000000c
310  #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_LSB                   0
311  #define REO_UNBLOCK_CACHE_STATUS_3_RESERVED_3A_MASK                  0xffffffff
312  
313  /* Description		REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A
314  
315  			<legal 0>
316  */
317  #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_OFFSET                0x00000010
318  #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_LSB                   0
319  #define REO_UNBLOCK_CACHE_STATUS_4_RESERVED_4A_MASK                  0xffffffff
320  
321  /* Description		REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A
322  
323  			<legal 0>
324  */
325  #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_OFFSET                0x00000014
326  #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_LSB                   0
327  #define REO_UNBLOCK_CACHE_STATUS_5_RESERVED_5A_MASK                  0xffffffff
328  
329  /* Description		REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A
330  
331  			<legal 0>
332  */
333  #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_OFFSET                0x00000018
334  #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_LSB                   0
335  #define REO_UNBLOCK_CACHE_STATUS_6_RESERVED_6A_MASK                  0xffffffff
336  
337  /* Description		REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A
338  
339  			<legal 0>
340  */
341  #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_OFFSET                0x0000001c
342  #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_LSB                   0
343  #define REO_UNBLOCK_CACHE_STATUS_7_RESERVED_7A_MASK                  0xffffffff
344  
345  /* Description		REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A
346  
347  			<legal 0>
348  */
349  #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_OFFSET                0x00000020
350  #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_LSB                   0
351  #define REO_UNBLOCK_CACHE_STATUS_8_RESERVED_8A_MASK                  0xffffffff
352  
353  /* Description		REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A
354  
355  			<legal 0>
356  */
357  #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_OFFSET                0x00000024
358  #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_LSB                   0
359  #define REO_UNBLOCK_CACHE_STATUS_9_RESERVED_9A_MASK                  0xffffffff
360  
361  /* Description		REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A
362  
363  			<legal 0>
364  */
365  #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_OFFSET              0x00000028
366  #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_LSB                 0
367  #define REO_UNBLOCK_CACHE_STATUS_10_RESERVED_10A_MASK                0xffffffff
368  
369  /* Description		REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A
370  
371  			<legal 0>
372  */
373  #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_OFFSET              0x0000002c
374  #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_LSB                 0
375  #define REO_UNBLOCK_CACHE_STATUS_11_RESERVED_11A_MASK                0xffffffff
376  
377  /* Description		REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A
378  
379  			<legal 0>
380  */
381  #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_OFFSET              0x00000030
382  #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_LSB                 0
383  #define REO_UNBLOCK_CACHE_STATUS_12_RESERVED_12A_MASK                0xffffffff
384  
385  /* Description		REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A
386  
387  			<legal 0>
388  */
389  #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_OFFSET              0x00000034
390  #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_LSB                 0
391  #define REO_UNBLOCK_CACHE_STATUS_13_RESERVED_13A_MASK                0xffffffff
392  
393  /* Description		REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A
394  
395  			<legal 0>
396  */
397  #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_OFFSET              0x00000038
398  #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_LSB                 0
399  #define REO_UNBLOCK_CACHE_STATUS_14_RESERVED_14A_MASK                0xffffffff
400  
401  /* Description		REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A
402  
403  			<legal 0>
404  */
405  #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_OFFSET              0x0000003c
406  #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_LSB                 0
407  #define REO_UNBLOCK_CACHE_STATUS_15_RESERVED_15A_MASK                0xffffffff
408  
409  /* Description		REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A
410  
411  			<legal 0>
412  */
413  #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_OFFSET              0x00000040
414  #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_LSB                 0
415  #define REO_UNBLOCK_CACHE_STATUS_16_RESERVED_16A_MASK                0xffffffff
416  
417  /* Description		REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A
418  
419  			<legal 0>
420  */
421  #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_OFFSET              0x00000044
422  #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_LSB                 0
423  #define REO_UNBLOCK_CACHE_STATUS_17_RESERVED_17A_MASK                0xffffffff
424  
425  /* Description		REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A
426  
427  			<legal 0>
428  */
429  #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_OFFSET              0x00000048
430  #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_LSB                 0
431  #define REO_UNBLOCK_CACHE_STATUS_18_RESERVED_18A_MASK                0xffffffff
432  
433  /* Description		REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A
434  
435  			<legal 0>
436  */
437  #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_OFFSET              0x0000004c
438  #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_LSB                 0
439  #define REO_UNBLOCK_CACHE_STATUS_19_RESERVED_19A_MASK                0xffffffff
440  
441  /* Description		REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A
442  
443  			<legal 0>
444  */
445  #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_OFFSET              0x00000050
446  #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_LSB                 0
447  #define REO_UNBLOCK_CACHE_STATUS_20_RESERVED_20A_MASK                0xffffffff
448  
449  /* Description		REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A
450  
451  			<legal 0>
452  */
453  #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_OFFSET              0x00000054
454  #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_LSB                 0
455  #define REO_UNBLOCK_CACHE_STATUS_21_RESERVED_21A_MASK                0xffffffff
456  
457  /* Description		REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A
458  
459  			<legal 0>
460  */
461  #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_OFFSET              0x00000058
462  #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_LSB                 0
463  #define REO_UNBLOCK_CACHE_STATUS_22_RESERVED_22A_MASK                0xffffffff
464  
465  /* Description		REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A
466  
467  			<legal 0>
468  */
469  #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_OFFSET              0x0000005c
470  #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_LSB                 0
471  #define REO_UNBLOCK_CACHE_STATUS_23_RESERVED_23A_MASK                0xffffffff
472  
473  /* Description		REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A
474  
475  			<legal 0>
476  */
477  #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_OFFSET              0x00000060
478  #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_LSB                 0
479  #define REO_UNBLOCK_CACHE_STATUS_24_RESERVED_24A_MASK                0x0fffffff
480  
481  /* Description		REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT
482  
483  			A count value that indicates the number of times the
484  			producer of entries into this Ring has looped around the
485  			ring.
486  
487  			At initialization time, this value is set to 0. On the
488  			first loop, this value is set to 1. After the max value is
489  			reached allowed by the number of bits for this field, the
490  			count value continues with 0 again.
491  
492  
493  
494  			In case SW is the consumer of the ring entries, it can
495  			use this field to figure out up to where the producer of
496  			entries has created new entries. This eliminates the need to
497  			check where the head pointer' of the ring is located once
498  			the SW starts processing an interrupt indicating that new
499  			entries have been put into this ring...
500  
501  
502  
503  			Also note that SW if it wants only needs to look at the
504  			LSB bit of this count value.
505  
506  			<legal all>
507  */
508  #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_OFFSET             0x00000060
509  #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_LSB                28
510  #define REO_UNBLOCK_CACHE_STATUS_24_LOOPING_COUNT_MASK               0xf0000000
511  
512  
513  #endif // _REO_UNBLOCK_CACHE_STATUS_H_
514