reo_flush_cache.h 15 KB

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