tcl_status_ring.h 13 KB

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