ce_stat_desc.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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 _CE_STAT_DESC_H_
  21. #define _CE_STAT_DESC_H_
  22. #if !defined(__ASSEMBLER__)
  23. #endif
  24. // ################ START SUMMARY #################
  25. //
  26. // Dword Fields
  27. // 0 ce_res_5[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_6[15:12], length[31:16]
  28. // 1 toeplitz_hash_0[31:0]
  29. // 2 toeplitz_hash_1[31:0]
  30. // 3 fw_metadata[15:0], ce_res_7[19:16], ring_id[27:20], looping_count[31:28]
  31. //
  32. // ################ END SUMMARY #################
  33. #define NUM_OF_DWORDS_CE_STAT_DESC 4
  34. struct ce_stat_desc {
  35. uint32_t ce_res_5 : 8, //[7:0]
  36. toeplitz_en : 1, //[8]
  37. src_swap : 1, //[9]
  38. dest_swap : 1, //[10]
  39. gather : 1, //[11]
  40. ce_res_6 : 4, //[15:12]
  41. length : 16; //[31:16]
  42. uint32_t toeplitz_hash_0 : 32; //[31:0]
  43. uint32_t toeplitz_hash_1 : 32; //[31:0]
  44. uint32_t fw_metadata : 16, //[15:0]
  45. ce_res_7 : 4, //[19:16]
  46. ring_id : 8, //[27:20]
  47. looping_count : 4; //[31:28]
  48. };
  49. /*
  50. ce_res_5
  51. Reserved
  52. <legal all>
  53. toeplitz_en
  54. <legal all>
  55. src_swap
  56. Source memory buffer swapped
  57. <legal all>
  58. dest_swap
  59. Destination memory buffer swapped
  60. <legal all>
  61. gather
  62. Gather of multiple copy engine source descriptors to one
  63. destination enabled
  64. <legal all>
  65. ce_res_6
  66. Reserved
  67. <legal all>
  68. length
  69. Sum of all the Lengths of the source descriptor in the
  70. gather chain
  71. <legal all>
  72. toeplitz_hash_0
  73. 32 LS bits of 64 bit Toeplitz LFSR hash result
  74. <legal all>
  75. toeplitz_hash_1
  76. 32 MS bits of 64 bit Toeplitz LFSR hash result
  77. <legal all>
  78. fw_metadata
  79. Meta data used by FW
  80. In case of gather field in first source ring entry of
  81. the gather copy cycle in taken into account.
  82. <legal all>
  83. ce_res_7
  84. Reserved
  85. <legal all>
  86. ring_id
  87. The buffer pointer ring ID.
  88. 0 refers to the IDLE ring
  89. 1 - N refers to other rings
  90. Helps with debugging when dumping ring contents.
  91. <legal all>
  92. looping_count
  93. A count value that indicates the number of times the
  94. producer of entries into the Ring has looped around the
  95. ring.
  96. At initialization time, this value is set to 0. On the
  97. first loop, this value is set to 1. After the max value is
  98. reached allowed by the number of bits for this field, the
  99. count value continues with 0 again.
  100. In case SW is the consumer of the ring entries, it can
  101. use this field to figure out up to where the producer of
  102. entries has created new entries. This eliminates the need to
  103. check where the head pointer' of the ring is located once
  104. the SW starts processing an interrupt indicating that new
  105. entries have been put into this ring...
  106. Also note that SW if it wants only needs to look at the
  107. LSB bit of this count value.
  108. <legal all>
  109. */
  110. /* Description CE_STAT_DESC_0_CE_RES_5
  111. Reserved
  112. <legal all>
  113. */
  114. #define CE_STAT_DESC_0_CE_RES_5_OFFSET 0x00000000
  115. #define CE_STAT_DESC_0_CE_RES_5_LSB 0
  116. #define CE_STAT_DESC_0_CE_RES_5_MASK 0x000000ff
  117. /* Description CE_STAT_DESC_0_TOEPLITZ_EN
  118. <legal all>
  119. */
  120. #define CE_STAT_DESC_0_TOEPLITZ_EN_OFFSET 0x00000000
  121. #define CE_STAT_DESC_0_TOEPLITZ_EN_LSB 8
  122. #define CE_STAT_DESC_0_TOEPLITZ_EN_MASK 0x00000100
  123. /* Description CE_STAT_DESC_0_SRC_SWAP
  124. Source memory buffer swapped
  125. <legal all>
  126. */
  127. #define CE_STAT_DESC_0_SRC_SWAP_OFFSET 0x00000000
  128. #define CE_STAT_DESC_0_SRC_SWAP_LSB 9
  129. #define CE_STAT_DESC_0_SRC_SWAP_MASK 0x00000200
  130. /* Description CE_STAT_DESC_0_DEST_SWAP
  131. Destination memory buffer swapped
  132. <legal all>
  133. */
  134. #define CE_STAT_DESC_0_DEST_SWAP_OFFSET 0x00000000
  135. #define CE_STAT_DESC_0_DEST_SWAP_LSB 10
  136. #define CE_STAT_DESC_0_DEST_SWAP_MASK 0x00000400
  137. /* Description CE_STAT_DESC_0_GATHER
  138. Gather of multiple copy engine source descriptors to one
  139. destination enabled
  140. <legal all>
  141. */
  142. #define CE_STAT_DESC_0_GATHER_OFFSET 0x00000000
  143. #define CE_STAT_DESC_0_GATHER_LSB 11
  144. #define CE_STAT_DESC_0_GATHER_MASK 0x00000800
  145. /* Description CE_STAT_DESC_0_CE_RES_6
  146. Reserved
  147. <legal all>
  148. */
  149. #define CE_STAT_DESC_0_CE_RES_6_OFFSET 0x00000000
  150. #define CE_STAT_DESC_0_CE_RES_6_LSB 12
  151. #define CE_STAT_DESC_0_CE_RES_6_MASK 0x0000f000
  152. /* Description CE_STAT_DESC_0_LENGTH
  153. Sum of all the Lengths of the source descriptor in the
  154. gather chain
  155. <legal all>
  156. */
  157. #define CE_STAT_DESC_0_LENGTH_OFFSET 0x00000000
  158. #define CE_STAT_DESC_0_LENGTH_LSB 16
  159. #define CE_STAT_DESC_0_LENGTH_MASK 0xffff0000
  160. /* Description CE_STAT_DESC_1_TOEPLITZ_HASH_0
  161. 32 LS bits of 64 bit Toeplitz LFSR hash result
  162. <legal all>
  163. */
  164. #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_OFFSET 0x00000004
  165. #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_LSB 0
  166. #define CE_STAT_DESC_1_TOEPLITZ_HASH_0_MASK 0xffffffff
  167. /* Description CE_STAT_DESC_2_TOEPLITZ_HASH_1
  168. 32 MS bits of 64 bit Toeplitz LFSR hash result
  169. <legal all>
  170. */
  171. #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_OFFSET 0x00000008
  172. #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_LSB 0
  173. #define CE_STAT_DESC_2_TOEPLITZ_HASH_1_MASK 0xffffffff
  174. /* Description CE_STAT_DESC_3_FW_METADATA
  175. Meta data used by FW
  176. In case of gather field in first source ring entry of
  177. the gather copy cycle in taken into account.
  178. <legal all>
  179. */
  180. #define CE_STAT_DESC_3_FW_METADATA_OFFSET 0x0000000c
  181. #define CE_STAT_DESC_3_FW_METADATA_LSB 0
  182. #define CE_STAT_DESC_3_FW_METADATA_MASK 0x0000ffff
  183. /* Description CE_STAT_DESC_3_CE_RES_7
  184. Reserved
  185. <legal all>
  186. */
  187. #define CE_STAT_DESC_3_CE_RES_7_OFFSET 0x0000000c
  188. #define CE_STAT_DESC_3_CE_RES_7_LSB 16
  189. #define CE_STAT_DESC_3_CE_RES_7_MASK 0x000f0000
  190. /* Description CE_STAT_DESC_3_RING_ID
  191. The buffer pointer ring ID.
  192. 0 refers to the IDLE ring
  193. 1 - N refers to other rings
  194. Helps with debugging when dumping ring contents.
  195. <legal all>
  196. */
  197. #define CE_STAT_DESC_3_RING_ID_OFFSET 0x0000000c
  198. #define CE_STAT_DESC_3_RING_ID_LSB 20
  199. #define CE_STAT_DESC_3_RING_ID_MASK 0x0ff00000
  200. /* Description CE_STAT_DESC_3_LOOPING_COUNT
  201. A count value that indicates the number of times the
  202. producer of entries into the Ring has looped around the
  203. ring.
  204. At initialization time, this value is set to 0. On the
  205. first loop, this value is set to 1. After the max value is
  206. reached allowed by the number of bits for this field, the
  207. count value continues with 0 again.
  208. In case SW is the consumer of the ring entries, it can
  209. use this field to figure out up to where the producer of
  210. entries has created new entries. This eliminates the need to
  211. check where the head pointer' of the ring is located once
  212. the SW starts processing an interrupt indicating that new
  213. entries have been put into this ring...
  214. Also note that SW if it wants only needs to look at the
  215. LSB bit of this count value.
  216. <legal all>
  217. */
  218. #define CE_STAT_DESC_3_LOOPING_COUNT_OFFSET 0x0000000c
  219. #define CE_STAT_DESC_3_LOOPING_COUNT_LSB 28
  220. #define CE_STAT_DESC_3_LOOPING_COUNT_MASK 0xf0000000
  221. #endif // _CE_STAT_DESC_H_