kfd_pm4_headers_diq.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. /*
  2. * Copyright 2014 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. */
  23. #ifndef KFD_PM4_HEADERS_DIQ_H_
  24. #define KFD_PM4_HEADERS_DIQ_H_
  25. /*--------------------_INDIRECT_BUFFER-------------------- */
  26. #ifndef _PM4__INDIRECT_BUFFER_DEFINED
  27. #define _PM4__INDIRECT_BUFFER_DEFINED
  28. enum _INDIRECT_BUFFER_cache_policy_enum {
  29. cache_policy___indirect_buffer__lru = 0,
  30. cache_policy___indirect_buffer__stream = 1,
  31. cache_policy___indirect_buffer__bypass = 2
  32. };
  33. enum {
  34. IT_INDIRECT_BUFFER_PASID = 0x5C
  35. };
  36. struct pm4__indirect_buffer_pasid {
  37. union {
  38. union PM4_MES_TYPE_3_HEADER header; /* header */
  39. unsigned int ordinal1;
  40. };
  41. union {
  42. struct {
  43. unsigned int reserved1:2;
  44. unsigned int ib_base_lo:30;
  45. } bitfields2;
  46. unsigned int ordinal2;
  47. };
  48. union {
  49. struct {
  50. unsigned int ib_base_hi:16;
  51. unsigned int reserved2:16;
  52. } bitfields3;
  53. unsigned int ordinal3;
  54. };
  55. union {
  56. unsigned int control;
  57. unsigned int ordinal4;
  58. };
  59. union {
  60. struct {
  61. unsigned int pasid:10;
  62. unsigned int reserved4:22;
  63. } bitfields5;
  64. unsigned int ordinal5;
  65. };
  66. };
  67. #endif
  68. /*--------------------_RELEASE_MEM-------------------- */
  69. #ifndef _PM4__RELEASE_MEM_DEFINED
  70. #define _PM4__RELEASE_MEM_DEFINED
  71. enum _RELEASE_MEM_event_index_enum {
  72. event_index___release_mem__end_of_pipe = 5,
  73. event_index___release_mem__shader_done = 6
  74. };
  75. enum _RELEASE_MEM_cache_policy_enum {
  76. cache_policy___release_mem__lru = 0,
  77. cache_policy___release_mem__stream = 1,
  78. cache_policy___release_mem__bypass = 2
  79. };
  80. enum _RELEASE_MEM_dst_sel_enum {
  81. dst_sel___release_mem__memory_controller = 0,
  82. dst_sel___release_mem__tc_l2 = 1,
  83. dst_sel___release_mem__queue_write_pointer_register = 2,
  84. dst_sel___release_mem__queue_write_pointer_poll_mask_bit = 3
  85. };
  86. enum _RELEASE_MEM_int_sel_enum {
  87. int_sel___release_mem__none = 0,
  88. int_sel___release_mem__send_interrupt_only = 1,
  89. int_sel___release_mem__send_interrupt_after_write_confirm = 2,
  90. int_sel___release_mem__send_data_after_write_confirm = 3
  91. };
  92. enum _RELEASE_MEM_data_sel_enum {
  93. data_sel___release_mem__none = 0,
  94. data_sel___release_mem__send_32_bit_low = 1,
  95. data_sel___release_mem__send_64_bit_data = 2,
  96. data_sel___release_mem__send_gpu_clock_counter = 3,
  97. data_sel___release_mem__send_cp_perfcounter_hi_lo = 4,
  98. data_sel___release_mem__store_gds_data_to_memory = 5
  99. };
  100. struct pm4__release_mem {
  101. union {
  102. union PM4_MES_TYPE_3_HEADER header; /*header */
  103. unsigned int ordinal1;
  104. };
  105. union {
  106. struct {
  107. unsigned int event_type:6;
  108. unsigned int reserved1:2;
  109. enum _RELEASE_MEM_event_index_enum event_index:4;
  110. unsigned int tcl1_vol_action_ena:1;
  111. unsigned int tc_vol_action_ena:1;
  112. unsigned int reserved2:1;
  113. unsigned int tc_wb_action_ena:1;
  114. unsigned int tcl1_action_ena:1;
  115. unsigned int tc_action_ena:1;
  116. unsigned int reserved3:6;
  117. unsigned int atc:1;
  118. enum _RELEASE_MEM_cache_policy_enum cache_policy:2;
  119. unsigned int reserved4:5;
  120. } bitfields2;
  121. unsigned int ordinal2;
  122. };
  123. union {
  124. struct {
  125. unsigned int reserved5:16;
  126. enum _RELEASE_MEM_dst_sel_enum dst_sel:2;
  127. unsigned int reserved6:6;
  128. enum _RELEASE_MEM_int_sel_enum int_sel:3;
  129. unsigned int reserved7:2;
  130. enum _RELEASE_MEM_data_sel_enum data_sel:3;
  131. } bitfields3;
  132. unsigned int ordinal3;
  133. };
  134. union {
  135. struct {
  136. unsigned int reserved8:2;
  137. unsigned int address_lo_32b:30;
  138. } bitfields4;
  139. struct {
  140. unsigned int reserved9:3;
  141. unsigned int address_lo_64b:29;
  142. } bitfields5;
  143. unsigned int ordinal4;
  144. };
  145. unsigned int address_hi;
  146. unsigned int data_lo;
  147. unsigned int data_hi;
  148. };
  149. #endif
  150. /*--------------------_SET_CONFIG_REG-------------------- */
  151. #ifndef _PM4__SET_CONFIG_REG_DEFINED
  152. #define _PM4__SET_CONFIG_REG_DEFINED
  153. struct pm4__set_config_reg {
  154. union {
  155. union PM4_MES_TYPE_3_HEADER header; /*header */
  156. unsigned int ordinal1;
  157. };
  158. union {
  159. struct {
  160. unsigned int reg_offset:16;
  161. unsigned int reserved1:7;
  162. unsigned int vmid_shift:5;
  163. unsigned int insert_vmid:1;
  164. unsigned int reserved2:3;
  165. } bitfields2;
  166. unsigned int ordinal2;
  167. };
  168. unsigned int reg_data[1]; /*1..N of these fields */
  169. };
  170. #endif
  171. /*--------------------_WAIT_REG_MEM-------------------- */
  172. #ifndef _PM4__WAIT_REG_MEM_DEFINED
  173. #define _PM4__WAIT_REG_MEM_DEFINED
  174. enum _WAIT_REG_MEM_function_enum {
  175. function___wait_reg_mem__always_pass = 0,
  176. function___wait_reg_mem__less_than_ref_value = 1,
  177. function___wait_reg_mem__less_than_equal_to_the_ref_value = 2,
  178. function___wait_reg_mem__equal_to_the_reference_value = 3,
  179. function___wait_reg_mem__not_equal_reference_value = 4,
  180. function___wait_reg_mem__greater_than_or_equal_reference_value = 5,
  181. function___wait_reg_mem__greater_than_reference_value = 6,
  182. function___wait_reg_mem__reserved = 7
  183. };
  184. enum _WAIT_REG_MEM_mem_space_enum {
  185. mem_space___wait_reg_mem__register_space = 0,
  186. mem_space___wait_reg_mem__memory_space = 1
  187. };
  188. enum _WAIT_REG_MEM_operation_enum {
  189. operation___wait_reg_mem__wait_reg_mem = 0,
  190. operation___wait_reg_mem__wr_wait_wr_reg = 1
  191. };
  192. struct pm4__wait_reg_mem {
  193. union {
  194. union PM4_MES_TYPE_3_HEADER header; /*header */
  195. unsigned int ordinal1;
  196. };
  197. union {
  198. struct {
  199. enum _WAIT_REG_MEM_function_enum function:3;
  200. unsigned int reserved1:1;
  201. enum _WAIT_REG_MEM_mem_space_enum mem_space:2;
  202. enum _WAIT_REG_MEM_operation_enum operation:2;
  203. unsigned int reserved2:24;
  204. } bitfields2;
  205. unsigned int ordinal2;
  206. };
  207. union {
  208. struct {
  209. unsigned int reserved3:2;
  210. unsigned int memory_poll_addr_lo:30;
  211. } bitfields3;
  212. struct {
  213. unsigned int register_poll_addr:16;
  214. unsigned int reserved4:16;
  215. } bitfields4;
  216. struct {
  217. unsigned int register_write_addr:16;
  218. unsigned int reserved5:16;
  219. } bitfields5;
  220. unsigned int ordinal3;
  221. };
  222. union {
  223. struct {
  224. unsigned int poll_address_hi:16;
  225. unsigned int reserved6:16;
  226. } bitfields6;
  227. struct {
  228. unsigned int register_write_addr:16;
  229. unsigned int reserved7:16;
  230. } bitfields7;
  231. unsigned int ordinal4;
  232. };
  233. unsigned int reference;
  234. unsigned int mask;
  235. union {
  236. struct {
  237. unsigned int poll_interval:16;
  238. unsigned int reserved8:16;
  239. } bitfields8;
  240. unsigned int ordinal7;
  241. };
  242. };
  243. #endif
  244. #endif /* KFD_PM4_HEADERS_DIQ_H_ */