ce_stat_desc.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _CE_STAT_DESC_H_
  16. #define _CE_STAT_DESC_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #define NUM_OF_DWORDS_CE_STAT_DESC 4
  20. struct ce_stat_desc {
  21. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  22. uint32_t ce_res_5 : 8, // [7:0]
  23. toeplitz_en : 1, // [8:8]
  24. src_swap : 1, // [9:9]
  25. dest_swap : 1, // [10:10]
  26. gather : 1, // [11:11]
  27. barrier_read : 1, // [12:12]
  28. ce_res_6 : 3, // [15:13]
  29. length : 16; // [31:16]
  30. uint32_t toeplitz_hash_0 : 32; // [31:0]
  31. uint32_t toeplitz_hash_1 : 32; // [31:0]
  32. uint32_t fw_metadata : 16, // [15:0]
  33. ce_res_7 : 4, // [19:16]
  34. ring_id : 8, // [27:20]
  35. looping_count : 4; // [31:28]
  36. #else
  37. uint32_t length : 16, // [31:16]
  38. ce_res_6 : 3, // [15:13]
  39. barrier_read : 1, // [12:12]
  40. gather : 1, // [11:11]
  41. dest_swap : 1, // [10:10]
  42. src_swap : 1, // [9:9]
  43. toeplitz_en : 1, // [8:8]
  44. ce_res_5 : 8; // [7:0]
  45. uint32_t toeplitz_hash_0 : 32; // [31:0]
  46. uint32_t toeplitz_hash_1 : 32; // [31:0]
  47. uint32_t looping_count : 4, // [31:28]
  48. ring_id : 8, // [27:20]
  49. ce_res_7 : 4, // [19:16]
  50. fw_metadata : 16; // [15:0]
  51. #endif
  52. };
  53. /* Description CE_RES_5
  54. Reserved
  55. <legal all>
  56. */
  57. #define CE_STAT_DESC_CE_RES_5_OFFSET 0x00000000
  58. #define CE_STAT_DESC_CE_RES_5_LSB 0
  59. #define CE_STAT_DESC_CE_RES_5_MSB 7
  60. #define CE_STAT_DESC_CE_RES_5_MASK 0x000000ff
  61. /* Description TOEPLITZ_EN
  62. 32-bit Toeplitz-LFSR hash for the data transfer, Enabled
  63. <legal all>
  64. */
  65. #define CE_STAT_DESC_TOEPLITZ_EN_OFFSET 0x00000000
  66. #define CE_STAT_DESC_TOEPLITZ_EN_LSB 8
  67. #define CE_STAT_DESC_TOEPLITZ_EN_MSB 8
  68. #define CE_STAT_DESC_TOEPLITZ_EN_MASK 0x00000100
  69. /* Description SRC_SWAP
  70. Source memory buffer swapped
  71. <legal all>
  72. */
  73. #define CE_STAT_DESC_SRC_SWAP_OFFSET 0x00000000
  74. #define CE_STAT_DESC_SRC_SWAP_LSB 9
  75. #define CE_STAT_DESC_SRC_SWAP_MSB 9
  76. #define CE_STAT_DESC_SRC_SWAP_MASK 0x00000200
  77. /* Description DEST_SWAP
  78. Destination memory buffer swapped
  79. <legal all>
  80. */
  81. #define CE_STAT_DESC_DEST_SWAP_OFFSET 0x00000000
  82. #define CE_STAT_DESC_DEST_SWAP_LSB 10
  83. #define CE_STAT_DESC_DEST_SWAP_MSB 10
  84. #define CE_STAT_DESC_DEST_SWAP_MASK 0x00000400
  85. /* Description GATHER
  86. Gather of multiple copy engine source descriptors to one
  87. destination enabled
  88. <legal all>
  89. */
  90. #define CE_STAT_DESC_GATHER_OFFSET 0x00000000
  91. #define CE_STAT_DESC_GATHER_LSB 11
  92. #define CE_STAT_DESC_GATHER_MSB 11
  93. #define CE_STAT_DESC_GATHER_MASK 0x00000800
  94. /* Description BARRIER_READ
  95. Barrier read enabled
  96. <legal all>
  97. */
  98. #define CE_STAT_DESC_BARRIER_READ_OFFSET 0x00000000
  99. #define CE_STAT_DESC_BARRIER_READ_LSB 12
  100. #define CE_STAT_DESC_BARRIER_READ_MSB 12
  101. #define CE_STAT_DESC_BARRIER_READ_MASK 0x00001000
  102. /* Description CE_RES_6
  103. Reserved
  104. <legal all>
  105. */
  106. #define CE_STAT_DESC_CE_RES_6_OFFSET 0x00000000
  107. #define CE_STAT_DESC_CE_RES_6_LSB 13
  108. #define CE_STAT_DESC_CE_RES_6_MSB 15
  109. #define CE_STAT_DESC_CE_RES_6_MASK 0x0000e000
  110. /* Description LENGTH
  111. Sum of all the Lengths of the source descriptor in the gather
  112. chain
  113. <legal all>
  114. */
  115. #define CE_STAT_DESC_LENGTH_OFFSET 0x00000000
  116. #define CE_STAT_DESC_LENGTH_LSB 16
  117. #define CE_STAT_DESC_LENGTH_MSB 31
  118. #define CE_STAT_DESC_LENGTH_MASK 0xffff0000
  119. /* Description TOEPLITZ_HASH_0
  120. 32 LS bits of 64 bit Toeplitz LFSR hash result
  121. <legal all>
  122. */
  123. #define CE_STAT_DESC_TOEPLITZ_HASH_0_OFFSET 0x00000004
  124. #define CE_STAT_DESC_TOEPLITZ_HASH_0_LSB 0
  125. #define CE_STAT_DESC_TOEPLITZ_HASH_0_MSB 31
  126. #define CE_STAT_DESC_TOEPLITZ_HASH_0_MASK 0xffffffff
  127. /* Description TOEPLITZ_HASH_1
  128. 32 MS bits of 64 bit Toeplitz LFSR hash result
  129. <legal all>
  130. */
  131. #define CE_STAT_DESC_TOEPLITZ_HASH_1_OFFSET 0x00000008
  132. #define CE_STAT_DESC_TOEPLITZ_HASH_1_LSB 0
  133. #define CE_STAT_DESC_TOEPLITZ_HASH_1_MSB 31
  134. #define CE_STAT_DESC_TOEPLITZ_HASH_1_MASK 0xffffffff
  135. /* Description FW_METADATA
  136. Meta data used by FW
  137. In case of gather field in first source ring entry of the
  138. gather copy cycle in taken into account.
  139. <legal all>
  140. */
  141. #define CE_STAT_DESC_FW_METADATA_OFFSET 0x0000000c
  142. #define CE_STAT_DESC_FW_METADATA_LSB 0
  143. #define CE_STAT_DESC_FW_METADATA_MSB 15
  144. #define CE_STAT_DESC_FW_METADATA_MASK 0x0000ffff
  145. /* Description CE_RES_7
  146. Reserved
  147. <legal all>
  148. */
  149. #define CE_STAT_DESC_CE_RES_7_OFFSET 0x0000000c
  150. #define CE_STAT_DESC_CE_RES_7_LSB 16
  151. #define CE_STAT_DESC_CE_RES_7_MSB 19
  152. #define CE_STAT_DESC_CE_RES_7_MASK 0x000f0000
  153. /* Description RING_ID
  154. The buffer pointer ring ID.
  155. 0 refers to the IDLE ring
  156. 1 - N refers to other rings
  157. Helps with debugging when dumping ring contents.
  158. <legal all>
  159. */
  160. #define CE_STAT_DESC_RING_ID_OFFSET 0x0000000c
  161. #define CE_STAT_DESC_RING_ID_LSB 20
  162. #define CE_STAT_DESC_RING_ID_MSB 27
  163. #define CE_STAT_DESC_RING_ID_MASK 0x0ff00000
  164. /* Description LOOPING_COUNT
  165. A count value that indicates the number of times the producer
  166. of entries into the Ring has looped around the ring.
  167. At initialization time, this value is set to 0. On the first
  168. loop, this value is set to 1. After the max value is reached
  169. allowed by the number of bits for this field, the count
  170. value continues with 0 again.
  171. In case SW is the consumer of the ring entries, it can use
  172. this field to figure out up to where the producer of entries
  173. has created new entries. This eliminates the need to check
  174. where the "head pointer' of the ring is located once the
  175. SW starts processing an interrupt indicating that new entries
  176. have been put into this ring...
  177. Also note that SW if it wants only needs to look at the
  178. LSB bit of this count value.
  179. <legal all>
  180. */
  181. #define CE_STAT_DESC_LOOPING_COUNT_OFFSET 0x0000000c
  182. #define CE_STAT_DESC_LOOPING_COUNT_LSB 28
  183. #define CE_STAT_DESC_LOOPING_COUNT_MSB 31
  184. #define CE_STAT_DESC_LOOPING_COUNT_MASK 0xf0000000
  185. #endif // CE_STAT_DESC