ce_src_desc.h 11 KB

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