tcl_status_ring.h 13 KB

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