xref: /netbsd-src/sys/external/bsd/drm2/dist/drm/amd/include/cik_structs.h (revision 41ec02673d281bbb3d38e6c78504ce6e30c228c1)
1*41ec0267Sriastradh /*	$NetBSD: cik_structs.h,v 1.3 2021/12/18 23:45:08 riastradh Exp $	*/
2efa246c0Sriastradh 
3efa246c0Sriastradh /*
4efa246c0Sriastradh  * Copyright 2012 Advanced Micro Devices, Inc.
5efa246c0Sriastradh  *
6efa246c0Sriastradh  * Permission is hereby granted, free of charge, to any person obtaining a
7efa246c0Sriastradh  * copy of this software and associated documentation files (the "Software"),
8efa246c0Sriastradh  * to deal in the Software without restriction, including without limitation
9efa246c0Sriastradh  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10efa246c0Sriastradh  * and/or sell copies of the Software, and to permit persons to whom the
11efa246c0Sriastradh  * Software is furnished to do so, subject to the following conditions:
12efa246c0Sriastradh  *
13efa246c0Sriastradh  * The above copyright notice and this permission notice shall be included in
14efa246c0Sriastradh  * all copies or substantial portions of the Software.
15efa246c0Sriastradh  *
16efa246c0Sriastradh  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17efa246c0Sriastradh  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18efa246c0Sriastradh  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19efa246c0Sriastradh  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20efa246c0Sriastradh  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21efa246c0Sriastradh  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22efa246c0Sriastradh  * OTHER DEALINGS IN THE SOFTWARE.
23efa246c0Sriastradh  *
24efa246c0Sriastradh  */
25efa246c0Sriastradh 
26efa246c0Sriastradh #ifndef CIK_STRUCTS_H_
27efa246c0Sriastradh #define CIK_STRUCTS_H_
28efa246c0Sriastradh 
29efa246c0Sriastradh struct cik_mqd {
30efa246c0Sriastradh 	uint32_t header;
31efa246c0Sriastradh 	uint32_t compute_dispatch_initiator;
32efa246c0Sriastradh 	uint32_t compute_dim_x;
33efa246c0Sriastradh 	uint32_t compute_dim_y;
34efa246c0Sriastradh 	uint32_t compute_dim_z;
35efa246c0Sriastradh 	uint32_t compute_start_x;
36efa246c0Sriastradh 	uint32_t compute_start_y;
37efa246c0Sriastradh 	uint32_t compute_start_z;
38efa246c0Sriastradh 	uint32_t compute_num_thread_x;
39efa246c0Sriastradh 	uint32_t compute_num_thread_y;
40efa246c0Sriastradh 	uint32_t compute_num_thread_z;
41efa246c0Sriastradh 	uint32_t compute_pipelinestat_enable;
42efa246c0Sriastradh 	uint32_t compute_perfcount_enable;
43efa246c0Sriastradh 	uint32_t compute_pgm_lo;
44efa246c0Sriastradh 	uint32_t compute_pgm_hi;
45efa246c0Sriastradh 	uint32_t compute_tba_lo;
46efa246c0Sriastradh 	uint32_t compute_tba_hi;
47efa246c0Sriastradh 	uint32_t compute_tma_lo;
48efa246c0Sriastradh 	uint32_t compute_tma_hi;
49efa246c0Sriastradh 	uint32_t compute_pgm_rsrc1;
50efa246c0Sriastradh 	uint32_t compute_pgm_rsrc2;
51efa246c0Sriastradh 	uint32_t compute_vmid;
52efa246c0Sriastradh 	uint32_t compute_resource_limits;
53efa246c0Sriastradh 	uint32_t compute_static_thread_mgmt_se0;
54efa246c0Sriastradh 	uint32_t compute_static_thread_mgmt_se1;
55efa246c0Sriastradh 	uint32_t compute_tmpring_size;
56efa246c0Sriastradh 	uint32_t compute_static_thread_mgmt_se2;
57efa246c0Sriastradh 	uint32_t compute_static_thread_mgmt_se3;
58efa246c0Sriastradh 	uint32_t compute_restart_x;
59efa246c0Sriastradh 	uint32_t compute_restart_y;
60efa246c0Sriastradh 	uint32_t compute_restart_z;
61efa246c0Sriastradh 	uint32_t compute_thread_trace_enable;
62efa246c0Sriastradh 	uint32_t compute_misc_reserved;
63efa246c0Sriastradh 	uint32_t compute_user_data_0;
64efa246c0Sriastradh 	uint32_t compute_user_data_1;
65efa246c0Sriastradh 	uint32_t compute_user_data_2;
66efa246c0Sriastradh 	uint32_t compute_user_data_3;
67efa246c0Sriastradh 	uint32_t compute_user_data_4;
68efa246c0Sriastradh 	uint32_t compute_user_data_5;
69efa246c0Sriastradh 	uint32_t compute_user_data_6;
70efa246c0Sriastradh 	uint32_t compute_user_data_7;
71efa246c0Sriastradh 	uint32_t compute_user_data_8;
72efa246c0Sriastradh 	uint32_t compute_user_data_9;
73efa246c0Sriastradh 	uint32_t compute_user_data_10;
74efa246c0Sriastradh 	uint32_t compute_user_data_11;
75efa246c0Sriastradh 	uint32_t compute_user_data_12;
76efa246c0Sriastradh 	uint32_t compute_user_data_13;
77efa246c0Sriastradh 	uint32_t compute_user_data_14;
78efa246c0Sriastradh 	uint32_t compute_user_data_15;
79efa246c0Sriastradh 	uint32_t cp_compute_csinvoc_count_lo;
80efa246c0Sriastradh 	uint32_t cp_compute_csinvoc_count_hi;
81efa246c0Sriastradh 	uint32_t cp_mqd_base_addr_lo;
82efa246c0Sriastradh 	uint32_t cp_mqd_base_addr_hi;
83efa246c0Sriastradh 	uint32_t cp_hqd_active;
84efa246c0Sriastradh 	uint32_t cp_hqd_vmid;
85efa246c0Sriastradh 	uint32_t cp_hqd_persistent_state;
86efa246c0Sriastradh 	uint32_t cp_hqd_pipe_priority;
87efa246c0Sriastradh 	uint32_t cp_hqd_queue_priority;
88efa246c0Sriastradh 	uint32_t cp_hqd_quantum;
89efa246c0Sriastradh 	uint32_t cp_hqd_pq_base_lo;
90efa246c0Sriastradh 	uint32_t cp_hqd_pq_base_hi;
91efa246c0Sriastradh 	uint32_t cp_hqd_pq_rptr;
92efa246c0Sriastradh 	uint32_t cp_hqd_pq_rptr_report_addr_lo;
93efa246c0Sriastradh 	uint32_t cp_hqd_pq_rptr_report_addr_hi;
94efa246c0Sriastradh 	uint32_t cp_hqd_pq_wptr_poll_addr_lo;
95efa246c0Sriastradh 	uint32_t cp_hqd_pq_wptr_poll_addr_hi;
96efa246c0Sriastradh 	uint32_t cp_hqd_pq_doorbell_control;
97efa246c0Sriastradh 	uint32_t cp_hqd_pq_wptr;
98efa246c0Sriastradh 	uint32_t cp_hqd_pq_control;
99efa246c0Sriastradh 	uint32_t cp_hqd_ib_base_addr_lo;
100efa246c0Sriastradh 	uint32_t cp_hqd_ib_base_addr_hi;
101efa246c0Sriastradh 	uint32_t cp_hqd_ib_rptr;
102efa246c0Sriastradh 	uint32_t cp_hqd_ib_control;
103efa246c0Sriastradh 	uint32_t cp_hqd_iq_timer;
104efa246c0Sriastradh 	uint32_t cp_hqd_iq_rptr;
105efa246c0Sriastradh 	uint32_t cp_hqd_dequeue_request;
106efa246c0Sriastradh 	uint32_t cp_hqd_dma_offload;
107efa246c0Sriastradh 	uint32_t cp_hqd_sema_cmd;
108efa246c0Sriastradh 	uint32_t cp_hqd_msg_type;
109efa246c0Sriastradh 	uint32_t cp_hqd_atomic0_preop_lo;
110efa246c0Sriastradh 	uint32_t cp_hqd_atomic0_preop_hi;
111efa246c0Sriastradh 	uint32_t cp_hqd_atomic1_preop_lo;
112efa246c0Sriastradh 	uint32_t cp_hqd_atomic1_preop_hi;
113efa246c0Sriastradh 	uint32_t cp_hqd_hq_status0;
114efa246c0Sriastradh 	uint32_t cp_hqd_hq_control0;
115efa246c0Sriastradh 	uint32_t cp_mqd_control;
116efa246c0Sriastradh 	uint32_t cp_mqd_query_time_lo;
117efa246c0Sriastradh 	uint32_t cp_mqd_query_time_hi;
118efa246c0Sriastradh 	uint32_t cp_mqd_connect_start_time_lo;
119efa246c0Sriastradh 	uint32_t cp_mqd_connect_start_time_hi;
120efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_time_lo;
121efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_time_hi;
122efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_wf_count;
123efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_pq_rptr;
124efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_pq_wptr;
125efa246c0Sriastradh 	uint32_t cp_mqd_connect_end_ib_rptr;
126efa246c0Sriastradh 	uint32_t reserved_96;
127efa246c0Sriastradh 	uint32_t reserved_97;
128efa246c0Sriastradh 	uint32_t reserved_98;
129efa246c0Sriastradh 	uint32_t reserved_99;
130efa246c0Sriastradh 	uint32_t iqtimer_pkt_header;
131efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw0;
132efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw1;
133efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw2;
134efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw3;
135efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw4;
136efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw5;
137efa246c0Sriastradh 	uint32_t iqtimer_pkt_dw6;
138efa246c0Sriastradh 	uint32_t reserved_108;
139efa246c0Sriastradh 	uint32_t reserved_109;
140efa246c0Sriastradh 	uint32_t reserved_110;
141efa246c0Sriastradh 	uint32_t reserved_111;
142efa246c0Sriastradh 	uint32_t queue_doorbell_id0;
143efa246c0Sriastradh 	uint32_t queue_doorbell_id1;
144efa246c0Sriastradh 	uint32_t queue_doorbell_id2;
145efa246c0Sriastradh 	uint32_t queue_doorbell_id3;
146efa246c0Sriastradh 	uint32_t queue_doorbell_id4;
147efa246c0Sriastradh 	uint32_t queue_doorbell_id5;
148efa246c0Sriastradh 	uint32_t queue_doorbell_id6;
149efa246c0Sriastradh 	uint32_t queue_doorbell_id7;
150efa246c0Sriastradh 	uint32_t queue_doorbell_id8;
151efa246c0Sriastradh 	uint32_t queue_doorbell_id9;
152efa246c0Sriastradh 	uint32_t queue_doorbell_id10;
153efa246c0Sriastradh 	uint32_t queue_doorbell_id11;
154efa246c0Sriastradh 	uint32_t queue_doorbell_id12;
155efa246c0Sriastradh 	uint32_t queue_doorbell_id13;
156efa246c0Sriastradh 	uint32_t queue_doorbell_id14;
157efa246c0Sriastradh 	uint32_t queue_doorbell_id15;
158efa246c0Sriastradh };
159efa246c0Sriastradh 
160efa246c0Sriastradh struct cik_sdma_rlc_registers {
161efa246c0Sriastradh 	uint32_t sdma_rlc_rb_cntl;
162efa246c0Sriastradh 	uint32_t sdma_rlc_rb_base;
163efa246c0Sriastradh 	uint32_t sdma_rlc_rb_base_hi;
164efa246c0Sriastradh 	uint32_t sdma_rlc_rb_rptr;
165efa246c0Sriastradh 	uint32_t sdma_rlc_rb_wptr;
166efa246c0Sriastradh 	uint32_t sdma_rlc_rb_wptr_poll_cntl;
167efa246c0Sriastradh 	uint32_t sdma_rlc_rb_wptr_poll_addr_hi;
168efa246c0Sriastradh 	uint32_t sdma_rlc_rb_wptr_poll_addr_lo;
169efa246c0Sriastradh 	uint32_t sdma_rlc_rb_rptr_addr_hi;
170efa246c0Sriastradh 	uint32_t sdma_rlc_rb_rptr_addr_lo;
171efa246c0Sriastradh 	uint32_t sdma_rlc_ib_cntl;
172efa246c0Sriastradh 	uint32_t sdma_rlc_ib_rptr;
173efa246c0Sriastradh 	uint32_t sdma_rlc_ib_offset;
174efa246c0Sriastradh 	uint32_t sdma_rlc_ib_base_lo;
175efa246c0Sriastradh 	uint32_t sdma_rlc_ib_base_hi;
176efa246c0Sriastradh 	uint32_t sdma_rlc_ib_size;
177efa246c0Sriastradh 	uint32_t sdma_rlc_skip_cntl;
178efa246c0Sriastradh 	uint32_t sdma_rlc_context_status;
179efa246c0Sriastradh 	uint32_t sdma_rlc_doorbell;
180efa246c0Sriastradh 	uint32_t sdma_rlc_virtual_addr;
181efa246c0Sriastradh 	uint32_t sdma_rlc_ape1_cntl;
182efa246c0Sriastradh 	uint32_t sdma_rlc_doorbell_log;
183efa246c0Sriastradh 	uint32_t reserved_22;
184efa246c0Sriastradh 	uint32_t reserved_23;
185efa246c0Sriastradh 	uint32_t reserved_24;
186efa246c0Sriastradh 	uint32_t reserved_25;
187efa246c0Sriastradh 	uint32_t reserved_26;
188efa246c0Sriastradh 	uint32_t reserved_27;
189efa246c0Sriastradh 	uint32_t reserved_28;
190efa246c0Sriastradh 	uint32_t reserved_29;
191efa246c0Sriastradh 	uint32_t reserved_30;
192efa246c0Sriastradh 	uint32_t reserved_31;
193efa246c0Sriastradh 	uint32_t reserved_32;
194efa246c0Sriastradh 	uint32_t reserved_33;
195efa246c0Sriastradh 	uint32_t reserved_34;
196efa246c0Sriastradh 	uint32_t reserved_35;
197efa246c0Sriastradh 	uint32_t reserved_36;
198efa246c0Sriastradh 	uint32_t reserved_37;
199efa246c0Sriastradh 	uint32_t reserved_38;
200efa246c0Sriastradh 	uint32_t reserved_39;
201efa246c0Sriastradh 	uint32_t reserved_40;
202efa246c0Sriastradh 	uint32_t reserved_41;
203efa246c0Sriastradh 	uint32_t reserved_42;
204efa246c0Sriastradh 	uint32_t reserved_43;
205efa246c0Sriastradh 	uint32_t reserved_44;
206efa246c0Sriastradh 	uint32_t reserved_45;
207efa246c0Sriastradh 	uint32_t reserved_46;
208efa246c0Sriastradh 	uint32_t reserved_47;
209efa246c0Sriastradh 	uint32_t reserved_48;
210efa246c0Sriastradh 	uint32_t reserved_49;
211efa246c0Sriastradh 	uint32_t reserved_50;
212efa246c0Sriastradh 	uint32_t reserved_51;
213efa246c0Sriastradh 	uint32_t reserved_52;
214efa246c0Sriastradh 	uint32_t reserved_53;
215efa246c0Sriastradh 	uint32_t reserved_54;
216efa246c0Sriastradh 	uint32_t reserved_55;
217efa246c0Sriastradh 	uint32_t reserved_56;
218efa246c0Sriastradh 	uint32_t reserved_57;
219efa246c0Sriastradh 	uint32_t reserved_58;
220efa246c0Sriastradh 	uint32_t reserved_59;
221efa246c0Sriastradh 	uint32_t reserved_60;
222efa246c0Sriastradh 	uint32_t reserved_61;
223efa246c0Sriastradh 	uint32_t reserved_62;
224efa246c0Sriastradh 	uint32_t reserved_63;
225efa246c0Sriastradh 	uint32_t reserved_64;
226efa246c0Sriastradh 	uint32_t reserved_65;
227efa246c0Sriastradh 	uint32_t reserved_66;
228efa246c0Sriastradh 	uint32_t reserved_67;
229efa246c0Sriastradh 	uint32_t reserved_68;
230efa246c0Sriastradh 	uint32_t reserved_69;
231efa246c0Sriastradh 	uint32_t reserved_70;
232efa246c0Sriastradh 	uint32_t reserved_71;
233efa246c0Sriastradh 	uint32_t reserved_72;
234efa246c0Sriastradh 	uint32_t reserved_73;
235efa246c0Sriastradh 	uint32_t reserved_74;
236efa246c0Sriastradh 	uint32_t reserved_75;
237efa246c0Sriastradh 	uint32_t reserved_76;
238efa246c0Sriastradh 	uint32_t reserved_77;
239efa246c0Sriastradh 	uint32_t reserved_78;
240efa246c0Sriastradh 	uint32_t reserved_79;
241efa246c0Sriastradh 	uint32_t reserved_80;
242efa246c0Sriastradh 	uint32_t reserved_81;
243efa246c0Sriastradh 	uint32_t reserved_82;
244efa246c0Sriastradh 	uint32_t reserved_83;
245efa246c0Sriastradh 	uint32_t reserved_84;
246efa246c0Sriastradh 	uint32_t reserved_85;
247efa246c0Sriastradh 	uint32_t reserved_86;
248efa246c0Sriastradh 	uint32_t reserved_87;
249efa246c0Sriastradh 	uint32_t reserved_88;
250efa246c0Sriastradh 	uint32_t reserved_89;
251efa246c0Sriastradh 	uint32_t reserved_90;
252efa246c0Sriastradh 	uint32_t reserved_91;
253efa246c0Sriastradh 	uint32_t reserved_92;
254efa246c0Sriastradh 	uint32_t reserved_93;
255efa246c0Sriastradh 	uint32_t reserved_94;
256efa246c0Sriastradh 	uint32_t reserved_95;
257efa246c0Sriastradh 	uint32_t reserved_96;
258efa246c0Sriastradh 	uint32_t reserved_97;
259efa246c0Sriastradh 	uint32_t reserved_98;
260efa246c0Sriastradh 	uint32_t reserved_99;
261efa246c0Sriastradh 	uint32_t reserved_100;
262efa246c0Sriastradh 	uint32_t reserved_101;
263efa246c0Sriastradh 	uint32_t reserved_102;
264efa246c0Sriastradh 	uint32_t reserved_103;
265efa246c0Sriastradh 	uint32_t reserved_104;
266efa246c0Sriastradh 	uint32_t reserved_105;
267efa246c0Sriastradh 	uint32_t reserved_106;
268efa246c0Sriastradh 	uint32_t reserved_107;
269efa246c0Sriastradh 	uint32_t reserved_108;
270efa246c0Sriastradh 	uint32_t reserved_109;
271efa246c0Sriastradh 	uint32_t reserved_110;
272efa246c0Sriastradh 	uint32_t reserved_111;
273efa246c0Sriastradh 	uint32_t reserved_112;
274efa246c0Sriastradh 	uint32_t reserved_113;
275efa246c0Sriastradh 	uint32_t reserved_114;
276efa246c0Sriastradh 	uint32_t reserved_115;
277efa246c0Sriastradh 	uint32_t reserved_116;
278efa246c0Sriastradh 	uint32_t reserved_117;
279efa246c0Sriastradh 	uint32_t reserved_118;
280efa246c0Sriastradh 	uint32_t reserved_119;
281efa246c0Sriastradh 	uint32_t reserved_120;
282efa246c0Sriastradh 	uint32_t reserved_121;
283efa246c0Sriastradh 	uint32_t reserved_122;
284efa246c0Sriastradh 	uint32_t reserved_123;
285efa246c0Sriastradh 	uint32_t reserved_124;
286efa246c0Sriastradh 	uint32_t reserved_125;
287*41ec0267Sriastradh 	/* reserved_126,127: repurposed for driver-internal use */
288efa246c0Sriastradh 	uint32_t sdma_engine_id;
289efa246c0Sriastradh 	uint32_t sdma_queue_id;
290efa246c0Sriastradh };
291efa246c0Sriastradh 
292efa246c0Sriastradh 
293efa246c0Sriastradh 
294efa246c0Sriastradh #endif /* CIK_STRUCTS_H_ */
295