reo_flush_cache.h 15 KB

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