ce_src_desc.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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_SRC_DESC_H_
  21. #define _CE_SRC_DESC_H_
  22. #if !defined(__ASSEMBLER__)
  23. #endif
  24. // ################ START SUMMARY #################
  25. //
  26. // Dword Fields
  27. // 0 src_buffer_low[31:0]
  28. // 1 src_buffer_high[7:0], toeplitz_en[8], src_swap[9], dest_swap[10], gather[11], ce_res_0[15:12], length[31:16]
  29. // 2 fw_metadata[15:0], ce_res_1[31:16]
  30. // 3 ce_res_2[19:0], ring_id[27:20], looping_count[31:28]
  31. //
  32. // ################ END SUMMARY #################
  33. #define NUM_OF_DWORDS_CE_SRC_DESC 4
  34. struct ce_src_desc {
  35. uint32_t src_buffer_low : 32; //[31:0]
  36. uint32_t src_buffer_high : 8, //[7:0]
  37. toeplitz_en : 1, //[8]
  38. src_swap : 1, //[9]
  39. dest_swap : 1, //[10]
  40. gather : 1, //[11]
  41. ce_res_0 : 4, //[15:12]
  42. length : 16; //[31:16]
  43. uint32_t fw_metadata : 16, //[15:0]
  44. ce_res_1 : 16; //[31:16]
  45. uint32_t ce_res_2 : 20, //[19:0]
  46. ring_id : 8, //[27:20]
  47. looping_count : 4; //[31:28]
  48. };
  49. /*
  50. src_buffer_low
  51. LSB 32 bits of the 40 Bit Pointer to the source buffer
  52. <legal all>
  53. src_buffer_high
  54. MSB 8 bits of the 40 Bit Pointer to the source buffer
  55. <legal all>
  56. toeplitz_en
  57. Enable generation of 32-bit Toeplitz-LFSR hash for the
  58. data transfer
  59. In case of gather field in first source ring entry of
  60. the gather copy cycle in taken into account.
  61. <legal all>
  62. src_swap
  63. Treats source memory organization as big-endian. For
  64. each dword read (4 bytes), the byte 0 is swapped with byte 3
  65. and byte 1 is swapped with byte 2.
  66. In case of gather field in first source ring entry of
  67. the gather copy cycle in taken into account.
  68. <legal all>
  69. dest_swap
  70. Treats destination memory organization as big-endian.
  71. For each dword write (4 bytes), the byte 0 is swapped with
  72. byte 3 and byte 1 is swapped with byte 2.
  73. In case of gather field in first source ring entry of
  74. the gather copy cycle in taken into account.
  75. <legal all>
  76. gather
  77. Enables gather of multiple copy engine source
  78. descriptors to one destination.
  79. <legal all>
  80. ce_res_0
  81. Reserved
  82. <legal all>
  83. length
  84. Length of the buffer in units of octets of the current
  85. descriptor
  86. <legal all>
  87. fw_metadata
  88. Meta data used by FW
  89. In case of gather field in first source ring entry of
  90. the gather copy cycle in taken into account.
  91. <legal all>
  92. ce_res_1
  93. Reserved
  94. <legal all>
  95. ce_res_2
  96. Reserved
  97. <legal all>
  98. ring_id
  99. The buffer pointer ring ID.
  100. 0 refers to the IDLE ring
  101. 1 - N refers to other rings
  102. Helps with debugging when dumping ring contents.
  103. <legal all>
  104. looping_count
  105. A count value that indicates the number of times the
  106. producer of entries into the Ring has looped around the
  107. ring.
  108. At initialization time, this value is set to 0. On the
  109. first loop, this value is set to 1. After the max value is
  110. reached allowed by the number of bits for this field, the
  111. count value continues with 0 again.
  112. In case SW is the consumer of the ring entries, it can
  113. use this field to figure out up to where the producer of
  114. entries has created new entries. This eliminates the need to
  115. check where the head pointer' of the ring is located once
  116. the SW starts processing an interrupt indicating that new
  117. entries have been put into this ring...
  118. Also note that SW if it wants only needs to look at the
  119. LSB bit of this count value.
  120. <legal all>
  121. */
  122. /* Description CE_SRC_DESC_0_SRC_BUFFER_LOW
  123. LSB 32 bits of the 40 Bit Pointer to the source buffer
  124. <legal all>
  125. */
  126. #define CE_SRC_DESC_0_SRC_BUFFER_LOW_OFFSET 0x00000000
  127. #define CE_SRC_DESC_0_SRC_BUFFER_LOW_LSB 0
  128. #define CE_SRC_DESC_0_SRC_BUFFER_LOW_MASK 0xffffffff
  129. /* Description CE_SRC_DESC_1_SRC_BUFFER_HIGH
  130. MSB 8 bits of the 40 Bit Pointer to the source buffer
  131. <legal all>
  132. */
  133. #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_OFFSET 0x00000004
  134. #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_LSB 0
  135. #define CE_SRC_DESC_1_SRC_BUFFER_HIGH_MASK 0x000000ff
  136. /* Description CE_SRC_DESC_1_TOEPLITZ_EN
  137. Enable generation of 32-bit Toeplitz-LFSR hash for the
  138. data transfer
  139. In case of gather field in first source ring entry of
  140. the gather copy cycle in taken into account.
  141. <legal all>
  142. */
  143. #define CE_SRC_DESC_1_TOEPLITZ_EN_OFFSET 0x00000004
  144. #define CE_SRC_DESC_1_TOEPLITZ_EN_LSB 8
  145. #define CE_SRC_DESC_1_TOEPLITZ_EN_MASK 0x00000100
  146. /* Description CE_SRC_DESC_1_SRC_SWAP
  147. Treats source memory organization as big-endian. For
  148. each dword read (4 bytes), the byte 0 is swapped with byte 3
  149. and byte 1 is swapped with byte 2.
  150. In case of gather field in first source ring entry of
  151. the gather copy cycle in taken into account.
  152. <legal all>
  153. */
  154. #define CE_SRC_DESC_1_SRC_SWAP_OFFSET 0x00000004
  155. #define CE_SRC_DESC_1_SRC_SWAP_LSB 9
  156. #define CE_SRC_DESC_1_SRC_SWAP_MASK 0x00000200
  157. /* Description CE_SRC_DESC_1_DEST_SWAP
  158. Treats destination memory organization as big-endian.
  159. For each dword write (4 bytes), the byte 0 is swapped with
  160. byte 3 and byte 1 is swapped with byte 2.
  161. In case of gather field in first source ring entry of
  162. the gather copy cycle in taken into account.
  163. <legal all>
  164. */
  165. #define CE_SRC_DESC_1_DEST_SWAP_OFFSET 0x00000004
  166. #define CE_SRC_DESC_1_DEST_SWAP_LSB 10
  167. #define CE_SRC_DESC_1_DEST_SWAP_MASK 0x00000400
  168. /* Description CE_SRC_DESC_1_GATHER
  169. Enables gather of multiple copy engine source
  170. descriptors to one destination.
  171. <legal all>
  172. */
  173. #define CE_SRC_DESC_1_GATHER_OFFSET 0x00000004
  174. #define CE_SRC_DESC_1_GATHER_LSB 11
  175. #define CE_SRC_DESC_1_GATHER_MASK 0x00000800
  176. /* Description CE_SRC_DESC_1_CE_RES_0
  177. Reserved
  178. <legal all>
  179. */
  180. #define CE_SRC_DESC_1_CE_RES_0_OFFSET 0x00000004
  181. #define CE_SRC_DESC_1_CE_RES_0_LSB 12
  182. #define CE_SRC_DESC_1_CE_RES_0_MASK 0x0000f000
  183. /* Description CE_SRC_DESC_1_LENGTH
  184. Length of the buffer in units of octets of the current
  185. descriptor
  186. <legal all>
  187. */
  188. #define CE_SRC_DESC_1_LENGTH_OFFSET 0x00000004
  189. #define CE_SRC_DESC_1_LENGTH_LSB 16
  190. #define CE_SRC_DESC_1_LENGTH_MASK 0xffff0000
  191. /* Description CE_SRC_DESC_2_FW_METADATA
  192. Meta data used by FW
  193. In case of gather field in first source ring entry of
  194. the gather copy cycle in taken into account.
  195. <legal all>
  196. */
  197. #define CE_SRC_DESC_2_FW_METADATA_OFFSET 0x00000008
  198. #define CE_SRC_DESC_2_FW_METADATA_LSB 0
  199. #define CE_SRC_DESC_2_FW_METADATA_MASK 0x0000ffff
  200. /* Description CE_SRC_DESC_2_CE_RES_1
  201. Reserved
  202. <legal all>
  203. */
  204. #define CE_SRC_DESC_2_CE_RES_1_OFFSET 0x00000008
  205. #define CE_SRC_DESC_2_CE_RES_1_LSB 16
  206. #define CE_SRC_DESC_2_CE_RES_1_MASK 0xffff0000
  207. /* Description CE_SRC_DESC_3_CE_RES_2
  208. Reserved
  209. <legal all>
  210. */
  211. #define CE_SRC_DESC_3_CE_RES_2_OFFSET 0x0000000c
  212. #define CE_SRC_DESC_3_CE_RES_2_LSB 0
  213. #define CE_SRC_DESC_3_CE_RES_2_MASK 0x000fffff
  214. /* Description CE_SRC_DESC_3_RING_ID
  215. The buffer pointer ring ID.
  216. 0 refers to the IDLE ring
  217. 1 - N refers to other rings
  218. Helps with debugging when dumping ring contents.
  219. <legal all>
  220. */
  221. #define CE_SRC_DESC_3_RING_ID_OFFSET 0x0000000c
  222. #define CE_SRC_DESC_3_RING_ID_LSB 20
  223. #define CE_SRC_DESC_3_RING_ID_MASK 0x0ff00000
  224. /* Description CE_SRC_DESC_3_LOOPING_COUNT
  225. A count value that indicates the number of times the
  226. producer of entries into the Ring has looped around the
  227. ring.
  228. At initialization time, this value is set to 0. On the
  229. first loop, this value is set to 1. After the max value is
  230. reached allowed by the number of bits for this field, the
  231. count value continues with 0 again.
  232. In case SW is the consumer of the ring entries, it can
  233. use this field to figure out up to where the producer of
  234. entries has created new entries. This eliminates the need to
  235. check where the head pointer' of the ring is located once
  236. the SW starts processing an interrupt indicating that new
  237. entries have been put into this ring...
  238. Also note that SW if it wants only needs to look at the
  239. LSB bit of this count value.
  240. <legal all>
  241. */
  242. #define CE_SRC_DESC_3_LOOPING_COUNT_OFFSET 0x0000000c
  243. #define CE_SRC_DESC_3_LOOPING_COUNT_LSB 28
  244. #define CE_SRC_DESC_3_LOOPING_COUNT_MASK 0xf0000000
  245. #endif // _CE_SRC_DESC_H_