tcl_status_ring.h 13 KB

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