tcl_status_ring.h 13 KB

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