ce_stat_desc.h 9.3 KB

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