ce_stat_desc.h 11 KB

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