ce_stat_desc.h 9.3 KB

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