tcl_gse_cmd.h 14 KB

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