reo_flush_cache.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. /*
  2. * Copyright (c) 2020 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 _REO_FLUSH_CACHE_H_
  21. #define _REO_FLUSH_CACHE_H_
  22. #if !defined(__ASSEMBLER__)
  23. #endif
  24. #include "uniform_reo_cmd_header.h"
  25. // ################ START SUMMARY #################
  26. //
  27. // Dword Fields
  28. // 0 struct uniform_reo_cmd_header cmd_header;
  29. // 1 flush_addr_31_0[31:0]
  30. // 2 flush_addr_39_32[7:0], forward_all_mpdus_in_queue[8], release_cache_block_index[9], cache_block_resource_index[11:10], flush_without_invalidate[12], block_cache_usage_after_flush[13], flush_entire_cache[14], reserved_2b[31:15]
  31. // 3 reserved_3a[31:0]
  32. // 4 reserved_4a[31:0]
  33. // 5 reserved_5a[31:0]
  34. // 6 reserved_6a[31:0]
  35. // 7 reserved_7a[31:0]
  36. // 8 reserved_8a[31:0]
  37. //
  38. // ################ END SUMMARY #################
  39. #define NUM_OF_DWORDS_REO_FLUSH_CACHE 9
  40. struct reo_flush_cache {
  41. struct uniform_reo_cmd_header cmd_header;
  42. uint32_t flush_addr_31_0 : 32; //[31:0]
  43. uint32_t flush_addr_39_32 : 8, //[7:0]
  44. forward_all_mpdus_in_queue : 1, //[8]
  45. release_cache_block_index : 1, //[9]
  46. cache_block_resource_index : 2, //[11:10]
  47. flush_without_invalidate : 1, //[12]
  48. block_cache_usage_after_flush : 1, //[13]
  49. flush_entire_cache : 1, //[14]
  50. reserved_2b : 17; //[31:15]
  51. uint32_t reserved_3a : 32; //[31:0]
  52. uint32_t reserved_4a : 32; //[31:0]
  53. uint32_t reserved_5a : 32; //[31:0]
  54. uint32_t reserved_6a : 32; //[31:0]
  55. uint32_t reserved_7a : 32; //[31:0]
  56. uint32_t reserved_8a : 32; //[31:0]
  57. };
  58. /*
  59. struct uniform_reo_cmd_header cmd_header
  60. Consumer: REO
  61. Producer: SW
  62. Details for command execution tracking purposes.
  63. flush_addr_31_0
  64. Consumer: REO
  65. Producer: SW
  66. Address (lower 32 bits) of the descriptor to flush
  67. <legal all>
  68. flush_addr_39_32
  69. Consumer: REO
  70. Producer: SW
  71. Address (upper 8 bits) of the descriptor to flush
  72. <legal all>
  73. forward_all_mpdus_in_queue
  74. Is only allowed to be set when the flush address
  75. corresponds with a REO descriptor.
  76. When set, REO shall first forward all the MPDUs held in
  77. the indicated re-order queue, before flushing the descriptor
  78. from the cache.
  79. <legal all>
  80. release_cache_block_index
  81. Field not valid when Flush_entire_cache is set.
  82. If SW has previously used a blocking resource that it
  83. now wants to re-use for this command, this bit shall be set.
  84. It prevents SW from having to send a separate
  85. REO_UNBLOCK_CACHE command.
  86. When set, HW will first release the blocking resource
  87. (indicated in field 'Cache_block_resouce_index') before this
  88. command gets executed.
  89. If that resource was already unblocked, this will be
  90. considered an error. This command will not be executed, and
  91. an error shall be returned.
  92. <legal all>
  93. cache_block_resource_index
  94. Field not valid when Flush_entire_cache is set.
  95. Indicates which of the four blocking resources in REO
  96. will be assigned for managing the blocking of this
  97. (descriptor) address
  98. <legal all>
  99. flush_without_invalidate
  100. Field not valid when Flush_entire_cache is set.
  101. When set, REO shall flush the cache line contents from
  102. the cache, but there is NO need to invalidate the cache line
  103. entry... The contents in the cache can be maintained. This
  104. feature can be used by SW (and DV) to get a current snapshot
  105. of the contents in the cache
  106. <legal all>
  107. block_cache_usage_after_flush
  108. Field not valid when Flush_entire_cache is set.
  109. When set, REO shall block any cache accesses to this
  110. address till explicitly unblocked.
  111. Whenever SW sets this bit, SW shall also set bit
  112. 'Forward_all_mpdus_in_queue' to ensure all packets are
  113. flushed out in order to make sure this queue desc is not in
  114. one of the aging link lists. In case SW does not want to
  115. flush the MPDUs in the queue, see the recipe description
  116. below this TLV definition.
  117. The 'blocking' index to be used for this is indicated in
  118. field 'cache_block_resource_index'. If SW had previously
  119. used this blocking resource and was not freed up yet, SW
  120. shall first unblock that index (by setting bit
  121. Release_cache_block_index) or use an unblock command.
  122. If the resource indicated here was already blocked (and
  123. did not get unblocked in this command), it is considered an
  124. error scenario...
  125. No flush shall happen. The status for this command shall
  126. indicate error.
  127. <legal all>
  128. flush_entire_cache
  129. When set, the entire cache shall be flushed. The entire
  130. cache will also remain blocked, till the
  131. 'REO_UNBLOCK_COMMAND' is received with bit unblock type set
  132. to unblock_cache. All other fields in this command are to be
  133. ignored.
  134. Note that flushing the entire cache has no changes to
  135. the current settings of the blocking resource settings
  136. <legal all>
  137. reserved_2b
  138. <legal 0>
  139. reserved_3a
  140. <legal 0>
  141. reserved_4a
  142. <legal 0>
  143. reserved_5a
  144. <legal 0>
  145. reserved_6a
  146. <legal 0>
  147. reserved_7a
  148. <legal 0>
  149. reserved_8a
  150. <legal 0>
  151. */
  152. /* EXTERNAL REFERENCE : struct uniform_reo_cmd_header cmd_header */
  153. /* Description REO_FLUSH_CACHE_0_CMD_HEADER_REO_CMD_NUMBER
  154. Consumer: REO/SW/DEBUG
  155. Producer: SW
  156. This number can be used by SW to track, identify and
  157. link the created commands with the command statusses
  158. <legal all>
  159. */
  160. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_OFFSET 0x00000000
  161. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_LSB 0
  162. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_CMD_NUMBER_MASK 0x0000ffff
  163. /* Description REO_FLUSH_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED
  164. Consumer: REO
  165. Producer: SW
  166. <enum 0 NoStatus> REO does not need to generate a status
  167. TLV for the execution of this command
  168. <enum 1 StatusRequired> REO shall generate a status TLV
  169. for the execution of this command
  170. <legal all>
  171. */
  172. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_OFFSET 0x00000000
  173. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_LSB 16
  174. #define REO_FLUSH_CACHE_0_CMD_HEADER_REO_STATUS_REQUIRED_MASK 0x00010000
  175. /* Description REO_FLUSH_CACHE_0_CMD_HEADER_RESERVED_0A
  176. <legal 0>
  177. */
  178. #define REO_FLUSH_CACHE_0_CMD_HEADER_RESERVED_0A_OFFSET 0x00000000
  179. #define REO_FLUSH_CACHE_0_CMD_HEADER_RESERVED_0A_LSB 17
  180. #define REO_FLUSH_CACHE_0_CMD_HEADER_RESERVED_0A_MASK 0xfffe0000
  181. /* Description REO_FLUSH_CACHE_1_FLUSH_ADDR_31_0
  182. Consumer: REO
  183. Producer: SW
  184. Address (lower 32 bits) of the descriptor to flush
  185. <legal all>
  186. */
  187. #define REO_FLUSH_CACHE_1_FLUSH_ADDR_31_0_OFFSET 0x00000004
  188. #define REO_FLUSH_CACHE_1_FLUSH_ADDR_31_0_LSB 0
  189. #define REO_FLUSH_CACHE_1_FLUSH_ADDR_31_0_MASK 0xffffffff
  190. /* Description REO_FLUSH_CACHE_2_FLUSH_ADDR_39_32
  191. Consumer: REO
  192. Producer: SW
  193. Address (upper 8 bits) of the descriptor to flush
  194. <legal all>
  195. */
  196. #define REO_FLUSH_CACHE_2_FLUSH_ADDR_39_32_OFFSET 0x00000008
  197. #define REO_FLUSH_CACHE_2_FLUSH_ADDR_39_32_LSB 0
  198. #define REO_FLUSH_CACHE_2_FLUSH_ADDR_39_32_MASK 0x000000ff
  199. /* Description REO_FLUSH_CACHE_2_FORWARD_ALL_MPDUS_IN_QUEUE
  200. Is only allowed to be set when the flush address
  201. corresponds with a REO descriptor.
  202. When set, REO shall first forward all the MPDUs held in
  203. the indicated re-order queue, before flushing the descriptor
  204. from the cache.
  205. <legal all>
  206. */
  207. #define REO_FLUSH_CACHE_2_FORWARD_ALL_MPDUS_IN_QUEUE_OFFSET 0x00000008
  208. #define REO_FLUSH_CACHE_2_FORWARD_ALL_MPDUS_IN_QUEUE_LSB 8
  209. #define REO_FLUSH_CACHE_2_FORWARD_ALL_MPDUS_IN_QUEUE_MASK 0x00000100
  210. /* Description REO_FLUSH_CACHE_2_RELEASE_CACHE_BLOCK_INDEX
  211. Field not valid when Flush_entire_cache is set.
  212. If SW has previously used a blocking resource that it
  213. now wants to re-use for this command, this bit shall be set.
  214. It prevents SW from having to send a separate
  215. REO_UNBLOCK_CACHE command.
  216. When set, HW will first release the blocking resource
  217. (indicated in field 'Cache_block_resouce_index') before this
  218. command gets executed.
  219. If that resource was already unblocked, this will be
  220. considered an error. This command will not be executed, and
  221. an error shall be returned.
  222. <legal all>
  223. */
  224. #define REO_FLUSH_CACHE_2_RELEASE_CACHE_BLOCK_INDEX_OFFSET 0x00000008
  225. #define REO_FLUSH_CACHE_2_RELEASE_CACHE_BLOCK_INDEX_LSB 9
  226. #define REO_FLUSH_CACHE_2_RELEASE_CACHE_BLOCK_INDEX_MASK 0x00000200
  227. /* Description REO_FLUSH_CACHE_2_CACHE_BLOCK_RESOURCE_INDEX
  228. Field not valid when Flush_entire_cache is set.
  229. Indicates which of the four blocking resources in REO
  230. will be assigned for managing the blocking of this
  231. (descriptor) address
  232. <legal all>
  233. */
  234. #define REO_FLUSH_CACHE_2_CACHE_BLOCK_RESOURCE_INDEX_OFFSET 0x00000008
  235. #define REO_FLUSH_CACHE_2_CACHE_BLOCK_RESOURCE_INDEX_LSB 10
  236. #define REO_FLUSH_CACHE_2_CACHE_BLOCK_RESOURCE_INDEX_MASK 0x00000c00
  237. /* Description REO_FLUSH_CACHE_2_FLUSH_WITHOUT_INVALIDATE
  238. Field not valid when Flush_entire_cache is set.
  239. When set, REO shall flush the cache line contents from
  240. the cache, but there is NO need to invalidate the cache line
  241. entry... The contents in the cache can be maintained. This
  242. feature can be used by SW (and DV) to get a current snapshot
  243. of the contents in the cache
  244. <legal all>
  245. */
  246. #define REO_FLUSH_CACHE_2_FLUSH_WITHOUT_INVALIDATE_OFFSET 0x00000008
  247. #define REO_FLUSH_CACHE_2_FLUSH_WITHOUT_INVALIDATE_LSB 12
  248. #define REO_FLUSH_CACHE_2_FLUSH_WITHOUT_INVALIDATE_MASK 0x00001000
  249. /* Description REO_FLUSH_CACHE_2_BLOCK_CACHE_USAGE_AFTER_FLUSH
  250. Field not valid when Flush_entire_cache is set.
  251. When set, REO shall block any cache accesses to this
  252. address till explicitly unblocked.
  253. Whenever SW sets this bit, SW shall also set bit
  254. 'Forward_all_mpdus_in_queue' to ensure all packets are
  255. flushed out in order to make sure this queue desc is not in
  256. one of the aging link lists. In case SW does not want to
  257. flush the MPDUs in the queue, see the recipe description
  258. below this TLV definition.
  259. The 'blocking' index to be used for this is indicated in
  260. field 'cache_block_resource_index'. If SW had previously
  261. used this blocking resource and was not freed up yet, SW
  262. shall first unblock that index (by setting bit
  263. Release_cache_block_index) or use an unblock command.
  264. If the resource indicated here was already blocked (and
  265. did not get unblocked in this command), it is considered an
  266. error scenario...
  267. No flush shall happen. The status for this command shall
  268. indicate error.
  269. <legal all>
  270. */
  271. #define REO_FLUSH_CACHE_2_BLOCK_CACHE_USAGE_AFTER_FLUSH_OFFSET 0x00000008
  272. #define REO_FLUSH_CACHE_2_BLOCK_CACHE_USAGE_AFTER_FLUSH_LSB 13
  273. #define REO_FLUSH_CACHE_2_BLOCK_CACHE_USAGE_AFTER_FLUSH_MASK 0x00002000
  274. /* Description REO_FLUSH_CACHE_2_FLUSH_ENTIRE_CACHE
  275. When set, the entire cache shall be flushed. The entire
  276. cache will also remain blocked, till the
  277. 'REO_UNBLOCK_COMMAND' is received with bit unblock type set
  278. to unblock_cache. All other fields in this command are to be
  279. ignored.
  280. Note that flushing the entire cache has no changes to
  281. the current settings of the blocking resource settings
  282. <legal all>
  283. */
  284. #define REO_FLUSH_CACHE_2_FLUSH_ENTIRE_CACHE_OFFSET 0x00000008
  285. #define REO_FLUSH_CACHE_2_FLUSH_ENTIRE_CACHE_LSB 14
  286. #define REO_FLUSH_CACHE_2_FLUSH_ENTIRE_CACHE_MASK 0x00004000
  287. /* Description REO_FLUSH_CACHE_2_RESERVED_2B
  288. <legal 0>
  289. */
  290. #define REO_FLUSH_CACHE_2_RESERVED_2B_OFFSET 0x00000008
  291. #define REO_FLUSH_CACHE_2_RESERVED_2B_LSB 15
  292. #define REO_FLUSH_CACHE_2_RESERVED_2B_MASK 0xffff8000
  293. /* Description REO_FLUSH_CACHE_3_RESERVED_3A
  294. <legal 0>
  295. */
  296. #define REO_FLUSH_CACHE_3_RESERVED_3A_OFFSET 0x0000000c
  297. #define REO_FLUSH_CACHE_3_RESERVED_3A_LSB 0
  298. #define REO_FLUSH_CACHE_3_RESERVED_3A_MASK 0xffffffff
  299. /* Description REO_FLUSH_CACHE_4_RESERVED_4A
  300. <legal 0>
  301. */
  302. #define REO_FLUSH_CACHE_4_RESERVED_4A_OFFSET 0x00000010
  303. #define REO_FLUSH_CACHE_4_RESERVED_4A_LSB 0
  304. #define REO_FLUSH_CACHE_4_RESERVED_4A_MASK 0xffffffff
  305. /* Description REO_FLUSH_CACHE_5_RESERVED_5A
  306. <legal 0>
  307. */
  308. #define REO_FLUSH_CACHE_5_RESERVED_5A_OFFSET 0x00000014
  309. #define REO_FLUSH_CACHE_5_RESERVED_5A_LSB 0
  310. #define REO_FLUSH_CACHE_5_RESERVED_5A_MASK 0xffffffff
  311. /* Description REO_FLUSH_CACHE_6_RESERVED_6A
  312. <legal 0>
  313. */
  314. #define REO_FLUSH_CACHE_6_RESERVED_6A_OFFSET 0x00000018
  315. #define REO_FLUSH_CACHE_6_RESERVED_6A_LSB 0
  316. #define REO_FLUSH_CACHE_6_RESERVED_6A_MASK 0xffffffff
  317. /* Description REO_FLUSH_CACHE_7_RESERVED_7A
  318. <legal 0>
  319. */
  320. #define REO_FLUSH_CACHE_7_RESERVED_7A_OFFSET 0x0000001c
  321. #define REO_FLUSH_CACHE_7_RESERVED_7A_LSB 0
  322. #define REO_FLUSH_CACHE_7_RESERVED_7A_MASK 0xffffffff
  323. /* Description REO_FLUSH_CACHE_8_RESERVED_8A
  324. <legal 0>
  325. */
  326. #define REO_FLUSH_CACHE_8_RESERVED_8A_OFFSET 0x00000020
  327. #define REO_FLUSH_CACHE_8_RESERVED_8A_LSB 0
  328. #define REO_FLUSH_CACHE_8_RESERVED_8A_MASK 0xffffffff
  329. #endif // _REO_FLUSH_CACHE_H_