reo_flush_cache.h 14 KB

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