ce_src_desc.h 11 KB

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