tcl_gse_cmd.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. /*
  2. * Copyright (c) 2021 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_GSE_CMD_H_
  21. #define _TCL_GSE_CMD_H_
  22. #if !defined(__ASSEMBLER__)
  23. #endif
  24. // ################ START SUMMARY #################
  25. //
  26. // Dword Fields
  27. // 0 control_buffer_addr_31_0[31:0]
  28. // 1 control_buffer_addr_39_32[7:0], gse_ctrl[11:8], gse_sel[12], status_destination_ring_id[13], swap[14], index_search_en[15], cache_set_num[19:16], reserved_1a[31:20]
  29. // 2 cmd_meta_data_31_0[31:0]
  30. // 3 cmd_meta_data_63_32[31:0]
  31. // 4 reserved_4a[31:0]
  32. // 5 reserved_5a[31:0]
  33. // 6 reserved_6a[19:0], ring_id[27:20], looping_count[31:28]
  34. //
  35. // ################ END SUMMARY #################
  36. #define NUM_OF_DWORDS_TCL_GSE_CMD 7
  37. struct tcl_gse_cmd {
  38. uint32_t control_buffer_addr_31_0 : 32; //[31:0]
  39. uint32_t control_buffer_addr_39_32 : 8, //[7:0]
  40. gse_ctrl : 4, //[11:8]
  41. gse_sel : 1, //[12]
  42. status_destination_ring_id : 1, //[13]
  43. swap : 1, //[14]
  44. index_search_en : 1, //[15]
  45. cache_set_num : 4, //[19:16]
  46. reserved_1a : 12; //[31:20]
  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 reserved_4a : 32; //[31:0]
  50. uint32_t reserved_5a : 32; //[31:0]
  51. uint32_t reserved_6a : 20, //[19:0]
  52. ring_id : 8, //[27:20]
  53. looping_count : 4; //[31:28]
  54. };
  55. /*
  56. control_buffer_addr_31_0
  57. Address (lower 32 bits) of a control buffer containing
  58. additional info needed for this command execution.
  59. <legal all>
  60. control_buffer_addr_39_32
  61. Address (upper 8 bits) of a control buffer containing
  62. additional info needed for this command execution.
  63. <legal all>
  64. gse_ctrl
  65. GSE control operations. This includes cache operations
  66. and table entry statistics read/clear operation.
  67. <enum 0 rd_stat> Report or Read statistics
  68. <enum 1 srch_dis> Search disable. Report only Hash
  69. <enum 2 Wr_bk_single> Write Back single entry
  70. <enum 3 wr_bk_all> Write Back entire cache entry
  71. <enum 4 inval_single> Invalidate single cache entry
  72. <enum 5 inval_all> Invalidate entire cache
  73. <enum 6 wr_bk_inval_single> Write back and Invalidate
  74. single entry in cache
  75. <enum 7 wr_bk_inval_all> write back and invalidate
  76. entire cache
  77. <enum 8 clr_stat_single> Clear statistics for single
  78. entry
  79. <legal 0-8>
  80. Rest of the values reserved.
  81. For all single entry control operations (write back,
  82. Invalidate or both)Statistics will be reported
  83. gse_sel
  84. Bit to select the ASE or FSE to do the operation mention
  85. by GSE_ctrl bit
  86. 0: FSE select
  87. 1: ASE select
  88. status_destination_ring_id
  89. The TCL status ring to which the GSE status needs to be
  90. send.
  91. <enum 0 tcl_status_0_ring>
  92. <enum 1 tcl_status_1_ring>
  93. <legal all>
  94. swap
  95. Bit to enable byte swapping of contents of buffer
  96. <enum 0 Byte_swap_disable >
  97. <enum 1 byte_swap_enable >
  98. <legal all>
  99. index_search_en
  100. When this bit is set to 1 control_buffer_addr[19:0] will
  101. be considered as index of the AST or Flow table and GSE
  102. commands will be executed accordingly on the entry pointed
  103. by the index.
  104. This feature is disabled by setting this bit to 0.
  105. <enum 0 index_based_cmd_disable>
  106. <enum 1 index_based_cmd_enable>
  107. <legal all>
  108. cache_set_num
  109. Cache set number that should be used to cache the index
  110. based search results, for address and flow search. This
  111. value should be equal to value of cache_set_num for the
  112. index that is issued in TCL_DATA_CMD during search index
  113. based ASE or FSE. This field is valid for index based GSE
  114. commands
  115. <legal all>
  116. reserved_1a
  117. <legal 0>
  118. cmd_meta_data_31_0
  119. Meta data to be returned in the status descriptor
  120. <legal all>
  121. cmd_meta_data_63_32
  122. Meta data to be returned in the status descriptor
  123. <legal all>
  124. reserved_4a
  125. <legal 0>
  126. reserved_5a
  127. <legal 0>
  128. reserved_6a
  129. <legal 0>
  130. ring_id
  131. Helps with debugging when dumping ring contents.
  132. <legal all>
  133. looping_count
  134. A count value that indicates the number of times the
  135. producer of entries into the Ring has looped around the
  136. ring.
  137. At initialization time, this value is set to 0. On the
  138. first loop, this value is set to 1. After the max value is
  139. reached allowed by the number of bits for this field, the
  140. count value continues with 0 again.
  141. In case SW is the consumer of the ring entries, it can
  142. use this field to figure out up to where the producer of
  143. entries has created new entries. This eliminates the need to
  144. check where the head pointer' of the ring is located once
  145. the SW starts processing an interrupt indicating that new
  146. entries have been put into this ring...
  147. Also note that SW if it wants only needs to look at the
  148. LSB bit of this count value.
  149. <legal all>
  150. */
  151. /* Description TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0
  152. Address (lower 32 bits) of a control buffer containing
  153. additional info needed for this command execution.
  154. <legal all>
  155. */
  156. #define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_OFFSET 0x00000000
  157. #define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_LSB 0
  158. #define TCL_GSE_CMD_0_CONTROL_BUFFER_ADDR_31_0_MASK 0xffffffff
  159. /* Description TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32
  160. Address (upper 8 bits) of a control buffer containing
  161. additional info needed for this command execution.
  162. <legal all>
  163. */
  164. #define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_OFFSET 0x00000004
  165. #define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_LSB 0
  166. #define TCL_GSE_CMD_1_CONTROL_BUFFER_ADDR_39_32_MASK 0x000000ff
  167. /* Description TCL_GSE_CMD_1_GSE_CTRL
  168. GSE control operations. This includes cache operations
  169. and table entry statistics read/clear operation.
  170. <enum 0 rd_stat> Report or Read statistics
  171. <enum 1 srch_dis> Search disable. Report only Hash
  172. <enum 2 Wr_bk_single> Write Back single entry
  173. <enum 3 wr_bk_all> Write Back entire cache entry
  174. <enum 4 inval_single> Invalidate single cache entry
  175. <enum 5 inval_all> Invalidate entire cache
  176. <enum 6 wr_bk_inval_single> Write back and Invalidate
  177. single entry in cache
  178. <enum 7 wr_bk_inval_all> write back and invalidate
  179. entire cache
  180. <enum 8 clr_stat_single> Clear statistics for single
  181. entry
  182. <legal 0-8>
  183. Rest of the values reserved.
  184. For all single entry control operations (write back,
  185. Invalidate or both)Statistics will be reported
  186. */
  187. #define TCL_GSE_CMD_1_GSE_CTRL_OFFSET 0x00000004
  188. #define TCL_GSE_CMD_1_GSE_CTRL_LSB 8
  189. #define TCL_GSE_CMD_1_GSE_CTRL_MASK 0x00000f00
  190. /* Description TCL_GSE_CMD_1_GSE_SEL
  191. Bit to select the ASE or FSE to do the operation mention
  192. by GSE_ctrl bit
  193. 0: FSE select
  194. 1: ASE select
  195. */
  196. #define TCL_GSE_CMD_1_GSE_SEL_OFFSET 0x00000004
  197. #define TCL_GSE_CMD_1_GSE_SEL_LSB 12
  198. #define TCL_GSE_CMD_1_GSE_SEL_MASK 0x00001000
  199. /* Description TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID
  200. The TCL status ring to which the GSE status needs to be
  201. send.
  202. <enum 0 tcl_status_0_ring>
  203. <enum 1 tcl_status_1_ring>
  204. <legal all>
  205. */
  206. #define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_OFFSET 0x00000004
  207. #define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_LSB 13
  208. #define TCL_GSE_CMD_1_STATUS_DESTINATION_RING_ID_MASK 0x00002000
  209. /* Description TCL_GSE_CMD_1_SWAP
  210. Bit to enable byte swapping of contents of buffer
  211. <enum 0 Byte_swap_disable >
  212. <enum 1 byte_swap_enable >
  213. <legal all>
  214. */
  215. #define TCL_GSE_CMD_1_SWAP_OFFSET 0x00000004
  216. #define TCL_GSE_CMD_1_SWAP_LSB 14
  217. #define TCL_GSE_CMD_1_SWAP_MASK 0x00004000
  218. /* Description TCL_GSE_CMD_1_INDEX_SEARCH_EN
  219. When this bit is set to 1 control_buffer_addr[19:0] will
  220. be considered as index of the AST or Flow table and GSE
  221. commands will be executed accordingly on the entry pointed
  222. by the index.
  223. This feature is disabled by setting this bit to 0.
  224. <enum 0 index_based_cmd_disable>
  225. <enum 1 index_based_cmd_enable>
  226. <legal all>
  227. */
  228. #define TCL_GSE_CMD_1_INDEX_SEARCH_EN_OFFSET 0x00000004
  229. #define TCL_GSE_CMD_1_INDEX_SEARCH_EN_LSB 15
  230. #define TCL_GSE_CMD_1_INDEX_SEARCH_EN_MASK 0x00008000
  231. /* Description TCL_GSE_CMD_1_CACHE_SET_NUM
  232. Cache set number that should be used to cache the index
  233. based search results, for address and flow search. This
  234. value should be equal to value of cache_set_num for the
  235. index that is issued in TCL_DATA_CMD during search index
  236. based ASE or FSE. This field is valid for index based GSE
  237. commands
  238. <legal all>
  239. */
  240. #define TCL_GSE_CMD_1_CACHE_SET_NUM_OFFSET 0x00000004
  241. #define TCL_GSE_CMD_1_CACHE_SET_NUM_LSB 16
  242. #define TCL_GSE_CMD_1_CACHE_SET_NUM_MASK 0x000f0000
  243. /* Description TCL_GSE_CMD_1_RESERVED_1A
  244. <legal 0>
  245. */
  246. #define TCL_GSE_CMD_1_RESERVED_1A_OFFSET 0x00000004
  247. #define TCL_GSE_CMD_1_RESERVED_1A_LSB 20
  248. #define TCL_GSE_CMD_1_RESERVED_1A_MASK 0xfff00000
  249. /* Description TCL_GSE_CMD_2_CMD_META_DATA_31_0
  250. Meta data to be returned in the status descriptor
  251. <legal all>
  252. */
  253. #define TCL_GSE_CMD_2_CMD_META_DATA_31_0_OFFSET 0x00000008
  254. #define TCL_GSE_CMD_2_CMD_META_DATA_31_0_LSB 0
  255. #define TCL_GSE_CMD_2_CMD_META_DATA_31_0_MASK 0xffffffff
  256. /* Description TCL_GSE_CMD_3_CMD_META_DATA_63_32
  257. Meta data to be returned in the status descriptor
  258. <legal all>
  259. */
  260. #define TCL_GSE_CMD_3_CMD_META_DATA_63_32_OFFSET 0x0000000c
  261. #define TCL_GSE_CMD_3_CMD_META_DATA_63_32_LSB 0
  262. #define TCL_GSE_CMD_3_CMD_META_DATA_63_32_MASK 0xffffffff
  263. /* Description TCL_GSE_CMD_4_RESERVED_4A
  264. <legal 0>
  265. */
  266. #define TCL_GSE_CMD_4_RESERVED_4A_OFFSET 0x00000010
  267. #define TCL_GSE_CMD_4_RESERVED_4A_LSB 0
  268. #define TCL_GSE_CMD_4_RESERVED_4A_MASK 0xffffffff
  269. /* Description TCL_GSE_CMD_5_RESERVED_5A
  270. <legal 0>
  271. */
  272. #define TCL_GSE_CMD_5_RESERVED_5A_OFFSET 0x00000014
  273. #define TCL_GSE_CMD_5_RESERVED_5A_LSB 0
  274. #define TCL_GSE_CMD_5_RESERVED_5A_MASK 0xffffffff
  275. /* Description TCL_GSE_CMD_6_RESERVED_6A
  276. <legal 0>
  277. */
  278. #define TCL_GSE_CMD_6_RESERVED_6A_OFFSET 0x00000018
  279. #define TCL_GSE_CMD_6_RESERVED_6A_LSB 0
  280. #define TCL_GSE_CMD_6_RESERVED_6A_MASK 0x000fffff
  281. /* Description TCL_GSE_CMD_6_RING_ID
  282. Helps with debugging when dumping ring contents.
  283. <legal all>
  284. */
  285. #define TCL_GSE_CMD_6_RING_ID_OFFSET 0x00000018
  286. #define TCL_GSE_CMD_6_RING_ID_LSB 20
  287. #define TCL_GSE_CMD_6_RING_ID_MASK 0x0ff00000
  288. /* Description TCL_GSE_CMD_6_LOOPING_COUNT
  289. A count value that indicates the number of times the
  290. producer of entries into the Ring has looped around the
  291. ring.
  292. At initialization time, this value is set to 0. On the
  293. first loop, this value is set to 1. After the max value is
  294. reached allowed by the number of bits for this field, the
  295. count value continues with 0 again.
  296. In case SW is the consumer of the ring entries, it can
  297. use this field to figure out up to where the producer of
  298. entries has created new entries. This eliminates the need to
  299. check where the head pointer' of the ring is located once
  300. the SW starts processing an interrupt indicating that new
  301. entries have been put into this ring...
  302. Also note that SW if it wants only needs to look at the
  303. LSB bit of this count value.
  304. <legal all>
  305. */
  306. #define TCL_GSE_CMD_6_LOOPING_COUNT_OFFSET 0x00000018
  307. #define TCL_GSE_CMD_6_LOOPING_COUNT_LSB 28
  308. #define TCL_GSE_CMD_6_LOOPING_COUNT_MASK 0xf0000000
  309. #endif // _TCL_GSE_CMD_H_