tcl_status_ring.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. /*
  2. * Copyright (c) 2016-2017 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. // DO NOT EDIT! This file is automatically generated
  20. // These definitions are tied to a particular hardware layout
  21. #ifndef _TCL_STATUS_RING_H_
  22. #define _TCL_STATUS_RING_H_
  23. #if !defined(__ASSEMBLER__)
  24. #endif
  25. // ################ START SUMMARY #################
  26. //
  27. // Dword Fields
  28. // 0 gse_ctrl[3:0], ase_fse_sel[4], cache_op_res[6:5], reserved_0a[7], msdu_cnt_n[31:8]
  29. // 1 msdu_byte_cnt_n[31:0]
  30. // 2 msdu_timestmp_n[31:0]
  31. // 3 cmd_meta_data_31_0[31:0]
  32. // 4 cmd_meta_data_63_32[31:0]
  33. // 5 hash_indx_val[19:0], reserved_5a[31:20]
  34. // 6 reserved_6a[31:0]
  35. // 7 reserved_7a[19:0], ring_id[27:20], looping_count[31:28]
  36. //
  37. // ################ END SUMMARY #################
  38. #define NUM_OF_DWORDS_TCL_STATUS_RING 8
  39. struct tcl_status_ring {
  40. uint32_t gse_ctrl : 4, //[3:0]
  41. ase_fse_sel : 1, //[4]
  42. cache_op_res : 2, //[6:5]
  43. reserved_0a : 1, //[7]
  44. msdu_cnt_n : 24; //[31:8]
  45. uint32_t msdu_byte_cnt_n : 32; //[31:0]
  46. uint32_t msdu_timestmp_n : 32; //[31:0]
  47. uint32_t cmd_meta_data_31_0 : 32; //[31:0]
  48. uint32_t cmd_meta_data_63_32 : 32; //[31:0]
  49. uint32_t hash_indx_val : 20, //[19:0]
  50. reserved_5a : 12; //[31:20]
  51. uint32_t reserved_6a : 32; //[31:0]
  52. uint32_t reserved_7a : 20, //[19:0]
  53. ring_id : 8, //[27:20]
  54. looping_count : 4; //[31:28]
  55. };
  56. /*
  57. gse_ctrl
  58. GSE control operations. This includes cache operations
  59. and table entry statistics read/clear operation.
  60. <enum 0 rd_stat> Report or Read statistics
  61. <enum 1 srch_dis> Search disable. Report only Hash
  62. <enum 2 Wr_bk_single> Write Back single entry
  63. <enum 3 wr_bk_all> Write Back entire cache entry
  64. <enum 4 inval_single> Invalidate single cache entry
  65. <enum 5 inval_all> Invalidate entire cache
  66. <enum 6 wr_bk_inval_single> Write back and Invalidate
  67. single entry in cache
  68. <enum 7 wr_bk_inval_all> write back and invalidate
  69. entire cache
  70. <enum 8 clr_stat_single> Clear statistics for single
  71. entry
  72. <legal 0-8>
  73. Rest of the values reserved.
  74. For all single entry control operations (write back,
  75. Invalidate or both)Statistics will be reported
  76. ase_fse_sel
  77. Search Engine for which operation is done.
  78. 1'b0: Address Search Engine Result
  79. 1'b1: Flow Search Engine result
  80. cache_op_res
  81. Cache operation result. Following are results of cache
  82. operation.
  83. <enum 0 op_done> Operation successful
  84. <enum 1 not_fnd> Entry not found in Table
  85. <enum 2 timeout_er> Timeout Error
  86. <legal 0-2>
  87. reserved_0a
  88. <legal 0>
  89. msdu_cnt_n
  90. MSDU count of Entry. Valid when GSE_CTRL is 4'b0111 and
  91. 4'b1000
  92. msdu_byte_cnt_n
  93. MSDU byte count for entry 1. Valid when GSE_CTRL is
  94. 4'b0111 and 4'b1000
  95. msdu_timestmp_n
  96. MSDU timestamp for entry 1. Valid when GSE_CTRL is
  97. 4'b0111 and 4'b1000
  98. cmd_meta_data_31_0
  99. Meta data from input ring
  100. <legal all>
  101. cmd_meta_data_63_32
  102. Meta data from input ring
  103. <legal all>
  104. hash_indx_val
  105. Hash value of the entry in table in case of search
  106. failed or search disable.
  107. <legal all>
  108. reserved_5a
  109. <legal 0>
  110. reserved_6a
  111. <legal 0>
  112. reserved_7a
  113. <legal 0>
  114. ring_id
  115. The buffer pointer ring ID.
  116. Helps with debugging when dumping ring contents.
  117. <legal all>
  118. looping_count
  119. A count value that indicates the number of times the
  120. producer of entries into the Ring has looped around the
  121. ring.
  122. At initialization time, this value is set to 0. On the
  123. first loop, this value is set to 1. After the max value is
  124. reached allowed by the number of bits for this field, the
  125. count value continues with 0 again.
  126. In case SW is the consumer of the ring entries, it can
  127. use this field to figure out up to where the producer of
  128. entries has created new entries. This eliminates the need to
  129. check where the head pointer' of the ring is located once
  130. the SW starts processing an interrupt indicating that new
  131. entries have been put into this ring...
  132. Also note that SW if it wants only needs to look at the
  133. LSB bit of this count value.
  134. <legal all>
  135. */
  136. /* Description TCL_STATUS_RING_0_GSE_CTRL
  137. GSE control operations. This includes cache operations
  138. and table entry statistics read/clear operation.
  139. <enum 0 rd_stat> Report or Read statistics
  140. <enum 1 srch_dis> Search disable. Report only Hash
  141. <enum 2 Wr_bk_single> Write Back single entry
  142. <enum 3 wr_bk_all> Write Back entire cache entry
  143. <enum 4 inval_single> Invalidate single cache entry
  144. <enum 5 inval_all> Invalidate entire cache
  145. <enum 6 wr_bk_inval_single> Write back and Invalidate
  146. single entry in cache
  147. <enum 7 wr_bk_inval_all> write back and invalidate
  148. entire cache
  149. <enum 8 clr_stat_single> Clear statistics for single
  150. entry
  151. <legal 0-8>
  152. Rest of the values reserved.
  153. For all single entry control operations (write back,
  154. Invalidate or both)Statistics will be reported
  155. */
  156. #define TCL_STATUS_RING_0_GSE_CTRL_OFFSET 0x00000000
  157. #define TCL_STATUS_RING_0_GSE_CTRL_LSB 0
  158. #define TCL_STATUS_RING_0_GSE_CTRL_MASK 0x0000000f
  159. /* Description TCL_STATUS_RING_0_ASE_FSE_SEL
  160. Search Engine for which operation is done.
  161. 1'b0: Address Search Engine Result
  162. 1'b1: Flow Search Engine result
  163. */
  164. #define TCL_STATUS_RING_0_ASE_FSE_SEL_OFFSET 0x00000000
  165. #define TCL_STATUS_RING_0_ASE_FSE_SEL_LSB 4
  166. #define TCL_STATUS_RING_0_ASE_FSE_SEL_MASK 0x00000010
  167. /* Description TCL_STATUS_RING_0_CACHE_OP_RES
  168. Cache operation result. Following are results of cache
  169. operation.
  170. <enum 0 op_done> Operation successful
  171. <enum 1 not_fnd> Entry not found in Table
  172. <enum 2 timeout_er> Timeout Error
  173. <legal 0-2>
  174. */
  175. #define TCL_STATUS_RING_0_CACHE_OP_RES_OFFSET 0x00000000
  176. #define TCL_STATUS_RING_0_CACHE_OP_RES_LSB 5
  177. #define TCL_STATUS_RING_0_CACHE_OP_RES_MASK 0x00000060
  178. /* Description TCL_STATUS_RING_0_RESERVED_0A
  179. <legal 0>
  180. */
  181. #define TCL_STATUS_RING_0_RESERVED_0A_OFFSET 0x00000000
  182. #define TCL_STATUS_RING_0_RESERVED_0A_LSB 7
  183. #define TCL_STATUS_RING_0_RESERVED_0A_MASK 0x00000080
  184. /* Description TCL_STATUS_RING_0_MSDU_CNT_N
  185. MSDU count of Entry. Valid when GSE_CTRL is 4'b0111 and
  186. 4'b1000
  187. */
  188. #define TCL_STATUS_RING_0_MSDU_CNT_N_OFFSET 0x00000000
  189. #define TCL_STATUS_RING_0_MSDU_CNT_N_LSB 8
  190. #define TCL_STATUS_RING_0_MSDU_CNT_N_MASK 0xffffff00
  191. /* Description TCL_STATUS_RING_1_MSDU_BYTE_CNT_N
  192. MSDU byte count for entry 1. Valid when GSE_CTRL is
  193. 4'b0111 and 4'b1000
  194. */
  195. #define TCL_STATUS_RING_1_MSDU_BYTE_CNT_N_OFFSET 0x00000004
  196. #define TCL_STATUS_RING_1_MSDU_BYTE_CNT_N_LSB 0
  197. #define TCL_STATUS_RING_1_MSDU_BYTE_CNT_N_MASK 0xffffffff
  198. /* Description TCL_STATUS_RING_2_MSDU_TIMESTMP_N
  199. MSDU timestamp for entry 1. Valid when GSE_CTRL is
  200. 4'b0111 and 4'b1000
  201. */
  202. #define TCL_STATUS_RING_2_MSDU_TIMESTMP_N_OFFSET 0x00000008
  203. #define TCL_STATUS_RING_2_MSDU_TIMESTMP_N_LSB 0
  204. #define TCL_STATUS_RING_2_MSDU_TIMESTMP_N_MASK 0xffffffff
  205. /* Description TCL_STATUS_RING_3_CMD_META_DATA_31_0
  206. Meta data from input ring
  207. <legal all>
  208. */
  209. #define TCL_STATUS_RING_3_CMD_META_DATA_31_0_OFFSET 0x0000000c
  210. #define TCL_STATUS_RING_3_CMD_META_DATA_31_0_LSB 0
  211. #define TCL_STATUS_RING_3_CMD_META_DATA_31_0_MASK 0xffffffff
  212. /* Description TCL_STATUS_RING_4_CMD_META_DATA_63_32
  213. Meta data from input ring
  214. <legal all>
  215. */
  216. #define TCL_STATUS_RING_4_CMD_META_DATA_63_32_OFFSET 0x00000010
  217. #define TCL_STATUS_RING_4_CMD_META_DATA_63_32_LSB 0
  218. #define TCL_STATUS_RING_4_CMD_META_DATA_63_32_MASK 0xffffffff
  219. /* Description TCL_STATUS_RING_5_HASH_INDX_VAL
  220. Hash value of the entry in table in case of search
  221. failed or search disable.
  222. <legal all>
  223. */
  224. #define TCL_STATUS_RING_5_HASH_INDX_VAL_OFFSET 0x00000014
  225. #define TCL_STATUS_RING_5_HASH_INDX_VAL_LSB 0
  226. #define TCL_STATUS_RING_5_HASH_INDX_VAL_MASK 0x000fffff
  227. /* Description TCL_STATUS_RING_5_RESERVED_5A
  228. <legal 0>
  229. */
  230. #define TCL_STATUS_RING_5_RESERVED_5A_OFFSET 0x00000014
  231. #define TCL_STATUS_RING_5_RESERVED_5A_LSB 20
  232. #define TCL_STATUS_RING_5_RESERVED_5A_MASK 0xfff00000
  233. /* Description TCL_STATUS_RING_6_RESERVED_6A
  234. <legal 0>
  235. */
  236. #define TCL_STATUS_RING_6_RESERVED_6A_OFFSET 0x00000018
  237. #define TCL_STATUS_RING_6_RESERVED_6A_LSB 0
  238. #define TCL_STATUS_RING_6_RESERVED_6A_MASK 0xffffffff
  239. /* Description TCL_STATUS_RING_7_RESERVED_7A
  240. <legal 0>
  241. */
  242. #define TCL_STATUS_RING_7_RESERVED_7A_OFFSET 0x0000001c
  243. #define TCL_STATUS_RING_7_RESERVED_7A_LSB 0
  244. #define TCL_STATUS_RING_7_RESERVED_7A_MASK 0x000fffff
  245. /* Description TCL_STATUS_RING_7_RING_ID
  246. The buffer pointer ring ID.
  247. Helps with debugging when dumping ring contents.
  248. <legal all>
  249. */
  250. #define TCL_STATUS_RING_7_RING_ID_OFFSET 0x0000001c
  251. #define TCL_STATUS_RING_7_RING_ID_LSB 20
  252. #define TCL_STATUS_RING_7_RING_ID_MASK 0x0ff00000
  253. /* Description TCL_STATUS_RING_7_LOOPING_COUNT
  254. A count value that indicates the number of times the
  255. producer of entries into the Ring has looped around the
  256. ring.
  257. At initialization time, this value is set to 0. On the
  258. first loop, this value is set to 1. After the max value is
  259. reached allowed by the number of bits for this field, the
  260. count value continues with 0 again.
  261. In case SW is the consumer of the ring entries, it can
  262. use this field to figure out up to where the producer of
  263. entries has created new entries. This eliminates the need to
  264. check where the head pointer' of the ring is located once
  265. the SW starts processing an interrupt indicating that new
  266. entries have been put into this ring...
  267. Also note that SW if it wants only needs to look at the
  268. LSB bit of this count value.
  269. <legal all>
  270. */
  271. #define TCL_STATUS_RING_7_LOOPING_COUNT_OFFSET 0x0000001c
  272. #define TCL_STATUS_RING_7_LOOPING_COUNT_LSB 28
  273. #define TCL_STATUS_RING_7_LOOPING_COUNT_MASK 0xf0000000
  274. #endif // _TCL_STATUS_RING_H_