blob: b6140bcf060d426863d79caa230f0f109b6cea0f [file] [log] [blame]
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef HABANALABS_H_
20#define HABANALABS_H_
21#include <linux/types.h>
22#include <linux/ioctl.h>
23#define GOYA_KMD_SRAM_RESERVED_SIZE_FROM_START 0x8000
Christopher Ferris8177cdf2020-08-03 11:53:55 -070024#define GAUDI_DRIVER_SRAM_RESERVED_SIZE_FROM_START 0x80
Christopher Ferris05667cd2021-02-16 16:01:34 -080025#define GAUDI_FIRST_AVAILABLE_W_S_SYNC_OBJECT 144
26#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
Christopher Ferris10a76e62022-06-08 13:31:52 -070027#define TS_MAX_ELEMENTS_NUM (1 << 20)
Christopher Ferris24f97eb2019-05-20 12:58:13 -070028enum goya_queue_id {
29 GOYA_QUEUE_ID_DMA_0 = 0,
Christopher Ferris9584fa42019-12-09 15:36:13 -080030 GOYA_QUEUE_ID_DMA_1 = 1,
31 GOYA_QUEUE_ID_DMA_2 = 2,
32 GOYA_QUEUE_ID_DMA_3 = 3,
33 GOYA_QUEUE_ID_DMA_4 = 4,
34 GOYA_QUEUE_ID_CPU_PQ = 5,
35 GOYA_QUEUE_ID_MME = 6,
36 GOYA_QUEUE_ID_TPC0 = 7,
37 GOYA_QUEUE_ID_TPC1 = 8,
38 GOYA_QUEUE_ID_TPC2 = 9,
39 GOYA_QUEUE_ID_TPC3 = 10,
40 GOYA_QUEUE_ID_TPC4 = 11,
41 GOYA_QUEUE_ID_TPC5 = 12,
42 GOYA_QUEUE_ID_TPC6 = 13,
43 GOYA_QUEUE_ID_TPC7 = 14,
Christopher Ferris24f97eb2019-05-20 12:58:13 -070044 GOYA_QUEUE_ID_SIZE
45};
Christopher Ferris8177cdf2020-08-03 11:53:55 -070046enum gaudi_queue_id {
47 GAUDI_QUEUE_ID_DMA_0_0 = 0,
48 GAUDI_QUEUE_ID_DMA_0_1 = 1,
49 GAUDI_QUEUE_ID_DMA_0_2 = 2,
50 GAUDI_QUEUE_ID_DMA_0_3 = 3,
51 GAUDI_QUEUE_ID_DMA_1_0 = 4,
52 GAUDI_QUEUE_ID_DMA_1_1 = 5,
53 GAUDI_QUEUE_ID_DMA_1_2 = 6,
54 GAUDI_QUEUE_ID_DMA_1_3 = 7,
55 GAUDI_QUEUE_ID_CPU_PQ = 8,
56 GAUDI_QUEUE_ID_DMA_2_0 = 9,
57 GAUDI_QUEUE_ID_DMA_2_1 = 10,
58 GAUDI_QUEUE_ID_DMA_2_2 = 11,
59 GAUDI_QUEUE_ID_DMA_2_3 = 12,
60 GAUDI_QUEUE_ID_DMA_3_0 = 13,
61 GAUDI_QUEUE_ID_DMA_3_1 = 14,
62 GAUDI_QUEUE_ID_DMA_3_2 = 15,
63 GAUDI_QUEUE_ID_DMA_3_3 = 16,
64 GAUDI_QUEUE_ID_DMA_4_0 = 17,
65 GAUDI_QUEUE_ID_DMA_4_1 = 18,
66 GAUDI_QUEUE_ID_DMA_4_2 = 19,
67 GAUDI_QUEUE_ID_DMA_4_3 = 20,
68 GAUDI_QUEUE_ID_DMA_5_0 = 21,
69 GAUDI_QUEUE_ID_DMA_5_1 = 22,
70 GAUDI_QUEUE_ID_DMA_5_2 = 23,
71 GAUDI_QUEUE_ID_DMA_5_3 = 24,
72 GAUDI_QUEUE_ID_DMA_6_0 = 25,
73 GAUDI_QUEUE_ID_DMA_6_1 = 26,
74 GAUDI_QUEUE_ID_DMA_6_2 = 27,
75 GAUDI_QUEUE_ID_DMA_6_3 = 28,
76 GAUDI_QUEUE_ID_DMA_7_0 = 29,
77 GAUDI_QUEUE_ID_DMA_7_1 = 30,
78 GAUDI_QUEUE_ID_DMA_7_2 = 31,
79 GAUDI_QUEUE_ID_DMA_7_3 = 32,
80 GAUDI_QUEUE_ID_MME_0_0 = 33,
81 GAUDI_QUEUE_ID_MME_0_1 = 34,
82 GAUDI_QUEUE_ID_MME_0_2 = 35,
83 GAUDI_QUEUE_ID_MME_0_3 = 36,
84 GAUDI_QUEUE_ID_MME_1_0 = 37,
85 GAUDI_QUEUE_ID_MME_1_1 = 38,
86 GAUDI_QUEUE_ID_MME_1_2 = 39,
87 GAUDI_QUEUE_ID_MME_1_3 = 40,
88 GAUDI_QUEUE_ID_TPC_0_0 = 41,
89 GAUDI_QUEUE_ID_TPC_0_1 = 42,
90 GAUDI_QUEUE_ID_TPC_0_2 = 43,
91 GAUDI_QUEUE_ID_TPC_0_3 = 44,
92 GAUDI_QUEUE_ID_TPC_1_0 = 45,
93 GAUDI_QUEUE_ID_TPC_1_1 = 46,
94 GAUDI_QUEUE_ID_TPC_1_2 = 47,
95 GAUDI_QUEUE_ID_TPC_1_3 = 48,
96 GAUDI_QUEUE_ID_TPC_2_0 = 49,
97 GAUDI_QUEUE_ID_TPC_2_1 = 50,
98 GAUDI_QUEUE_ID_TPC_2_2 = 51,
99 GAUDI_QUEUE_ID_TPC_2_3 = 52,
100 GAUDI_QUEUE_ID_TPC_3_0 = 53,
101 GAUDI_QUEUE_ID_TPC_3_1 = 54,
102 GAUDI_QUEUE_ID_TPC_3_2 = 55,
103 GAUDI_QUEUE_ID_TPC_3_3 = 56,
104 GAUDI_QUEUE_ID_TPC_4_0 = 57,
105 GAUDI_QUEUE_ID_TPC_4_1 = 58,
106 GAUDI_QUEUE_ID_TPC_4_2 = 59,
107 GAUDI_QUEUE_ID_TPC_4_3 = 60,
108 GAUDI_QUEUE_ID_TPC_5_0 = 61,
109 GAUDI_QUEUE_ID_TPC_5_1 = 62,
110 GAUDI_QUEUE_ID_TPC_5_2 = 63,
111 GAUDI_QUEUE_ID_TPC_5_3 = 64,
112 GAUDI_QUEUE_ID_TPC_6_0 = 65,
113 GAUDI_QUEUE_ID_TPC_6_1 = 66,
114 GAUDI_QUEUE_ID_TPC_6_2 = 67,
115 GAUDI_QUEUE_ID_TPC_6_3 = 68,
116 GAUDI_QUEUE_ID_TPC_7_0 = 69,
117 GAUDI_QUEUE_ID_TPC_7_1 = 70,
118 GAUDI_QUEUE_ID_TPC_7_2 = 71,
119 GAUDI_QUEUE_ID_TPC_7_3 = 72,
120 GAUDI_QUEUE_ID_NIC_0_0 = 73,
121 GAUDI_QUEUE_ID_NIC_0_1 = 74,
122 GAUDI_QUEUE_ID_NIC_0_2 = 75,
123 GAUDI_QUEUE_ID_NIC_0_3 = 76,
124 GAUDI_QUEUE_ID_NIC_1_0 = 77,
125 GAUDI_QUEUE_ID_NIC_1_1 = 78,
126 GAUDI_QUEUE_ID_NIC_1_2 = 79,
127 GAUDI_QUEUE_ID_NIC_1_3 = 80,
128 GAUDI_QUEUE_ID_NIC_2_0 = 81,
129 GAUDI_QUEUE_ID_NIC_2_1 = 82,
130 GAUDI_QUEUE_ID_NIC_2_2 = 83,
131 GAUDI_QUEUE_ID_NIC_2_3 = 84,
132 GAUDI_QUEUE_ID_NIC_3_0 = 85,
133 GAUDI_QUEUE_ID_NIC_3_1 = 86,
134 GAUDI_QUEUE_ID_NIC_3_2 = 87,
135 GAUDI_QUEUE_ID_NIC_3_3 = 88,
136 GAUDI_QUEUE_ID_NIC_4_0 = 89,
137 GAUDI_QUEUE_ID_NIC_4_1 = 90,
138 GAUDI_QUEUE_ID_NIC_4_2 = 91,
139 GAUDI_QUEUE_ID_NIC_4_3 = 92,
140 GAUDI_QUEUE_ID_NIC_5_0 = 93,
141 GAUDI_QUEUE_ID_NIC_5_1 = 94,
142 GAUDI_QUEUE_ID_NIC_5_2 = 95,
143 GAUDI_QUEUE_ID_NIC_5_3 = 96,
144 GAUDI_QUEUE_ID_NIC_6_0 = 97,
145 GAUDI_QUEUE_ID_NIC_6_1 = 98,
146 GAUDI_QUEUE_ID_NIC_6_2 = 99,
147 GAUDI_QUEUE_ID_NIC_6_3 = 100,
148 GAUDI_QUEUE_ID_NIC_7_0 = 101,
149 GAUDI_QUEUE_ID_NIC_7_1 = 102,
150 GAUDI_QUEUE_ID_NIC_7_2 = 103,
151 GAUDI_QUEUE_ID_NIC_7_3 = 104,
152 GAUDI_QUEUE_ID_NIC_8_0 = 105,
153 GAUDI_QUEUE_ID_NIC_8_1 = 106,
154 GAUDI_QUEUE_ID_NIC_8_2 = 107,
155 GAUDI_QUEUE_ID_NIC_8_3 = 108,
156 GAUDI_QUEUE_ID_NIC_9_0 = 109,
157 GAUDI_QUEUE_ID_NIC_9_1 = 110,
158 GAUDI_QUEUE_ID_NIC_9_2 = 111,
159 GAUDI_QUEUE_ID_NIC_9_3 = 112,
160 GAUDI_QUEUE_ID_SIZE
161};
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700162enum gaudi2_queue_id {
163 GAUDI2_QUEUE_ID_PDMA_0_0 = 0,
164 GAUDI2_QUEUE_ID_PDMA_0_1 = 1,
165 GAUDI2_QUEUE_ID_PDMA_0_2 = 2,
166 GAUDI2_QUEUE_ID_PDMA_0_3 = 3,
167 GAUDI2_QUEUE_ID_PDMA_1_0 = 4,
168 GAUDI2_QUEUE_ID_PDMA_1_1 = 5,
169 GAUDI2_QUEUE_ID_PDMA_1_2 = 6,
170 GAUDI2_QUEUE_ID_PDMA_1_3 = 7,
171 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_0 = 8,
172 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_1 = 9,
173 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_2 = 10,
174 GAUDI2_QUEUE_ID_DCORE0_EDMA_0_3 = 11,
175 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_0 = 12,
176 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_1 = 13,
177 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_2 = 14,
178 GAUDI2_QUEUE_ID_DCORE0_EDMA_1_3 = 15,
179 GAUDI2_QUEUE_ID_DCORE0_MME_0_0 = 16,
180 GAUDI2_QUEUE_ID_DCORE0_MME_0_1 = 17,
181 GAUDI2_QUEUE_ID_DCORE0_MME_0_2 = 18,
182 GAUDI2_QUEUE_ID_DCORE0_MME_0_3 = 19,
183 GAUDI2_QUEUE_ID_DCORE0_TPC_0_0 = 20,
184 GAUDI2_QUEUE_ID_DCORE0_TPC_0_1 = 21,
185 GAUDI2_QUEUE_ID_DCORE0_TPC_0_2 = 22,
186 GAUDI2_QUEUE_ID_DCORE0_TPC_0_3 = 23,
187 GAUDI2_QUEUE_ID_DCORE0_TPC_1_0 = 24,
188 GAUDI2_QUEUE_ID_DCORE0_TPC_1_1 = 25,
189 GAUDI2_QUEUE_ID_DCORE0_TPC_1_2 = 26,
190 GAUDI2_QUEUE_ID_DCORE0_TPC_1_3 = 27,
191 GAUDI2_QUEUE_ID_DCORE0_TPC_2_0 = 28,
192 GAUDI2_QUEUE_ID_DCORE0_TPC_2_1 = 29,
193 GAUDI2_QUEUE_ID_DCORE0_TPC_2_2 = 30,
194 GAUDI2_QUEUE_ID_DCORE0_TPC_2_3 = 31,
195 GAUDI2_QUEUE_ID_DCORE0_TPC_3_0 = 32,
196 GAUDI2_QUEUE_ID_DCORE0_TPC_3_1 = 33,
197 GAUDI2_QUEUE_ID_DCORE0_TPC_3_2 = 34,
198 GAUDI2_QUEUE_ID_DCORE0_TPC_3_3 = 35,
199 GAUDI2_QUEUE_ID_DCORE0_TPC_4_0 = 36,
200 GAUDI2_QUEUE_ID_DCORE0_TPC_4_1 = 37,
201 GAUDI2_QUEUE_ID_DCORE0_TPC_4_2 = 38,
202 GAUDI2_QUEUE_ID_DCORE0_TPC_4_3 = 39,
203 GAUDI2_QUEUE_ID_DCORE0_TPC_5_0 = 40,
204 GAUDI2_QUEUE_ID_DCORE0_TPC_5_1 = 41,
205 GAUDI2_QUEUE_ID_DCORE0_TPC_5_2 = 42,
206 GAUDI2_QUEUE_ID_DCORE0_TPC_5_3 = 43,
207 GAUDI2_QUEUE_ID_DCORE0_TPC_6_0 = 44,
208 GAUDI2_QUEUE_ID_DCORE0_TPC_6_1 = 45,
209 GAUDI2_QUEUE_ID_DCORE0_TPC_6_2 = 46,
210 GAUDI2_QUEUE_ID_DCORE0_TPC_6_3 = 47,
211 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_0 = 48,
212 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_1 = 49,
213 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_2 = 50,
214 GAUDI2_QUEUE_ID_DCORE1_EDMA_0_3 = 51,
215 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_0 = 52,
216 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_1 = 53,
217 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_2 = 54,
218 GAUDI2_QUEUE_ID_DCORE1_EDMA_1_3 = 55,
219 GAUDI2_QUEUE_ID_DCORE1_MME_0_0 = 56,
220 GAUDI2_QUEUE_ID_DCORE1_MME_0_1 = 57,
221 GAUDI2_QUEUE_ID_DCORE1_MME_0_2 = 58,
222 GAUDI2_QUEUE_ID_DCORE1_MME_0_3 = 59,
223 GAUDI2_QUEUE_ID_DCORE1_TPC_0_0 = 60,
224 GAUDI2_QUEUE_ID_DCORE1_TPC_0_1 = 61,
225 GAUDI2_QUEUE_ID_DCORE1_TPC_0_2 = 62,
226 GAUDI2_QUEUE_ID_DCORE1_TPC_0_3 = 63,
227 GAUDI2_QUEUE_ID_DCORE1_TPC_1_0 = 64,
228 GAUDI2_QUEUE_ID_DCORE1_TPC_1_1 = 65,
229 GAUDI2_QUEUE_ID_DCORE1_TPC_1_2 = 66,
230 GAUDI2_QUEUE_ID_DCORE1_TPC_1_3 = 67,
231 GAUDI2_QUEUE_ID_DCORE1_TPC_2_0 = 68,
232 GAUDI2_QUEUE_ID_DCORE1_TPC_2_1 = 69,
233 GAUDI2_QUEUE_ID_DCORE1_TPC_2_2 = 70,
234 GAUDI2_QUEUE_ID_DCORE1_TPC_2_3 = 71,
235 GAUDI2_QUEUE_ID_DCORE1_TPC_3_0 = 72,
236 GAUDI2_QUEUE_ID_DCORE1_TPC_3_1 = 73,
237 GAUDI2_QUEUE_ID_DCORE1_TPC_3_2 = 74,
238 GAUDI2_QUEUE_ID_DCORE1_TPC_3_3 = 75,
239 GAUDI2_QUEUE_ID_DCORE1_TPC_4_0 = 76,
240 GAUDI2_QUEUE_ID_DCORE1_TPC_4_1 = 77,
241 GAUDI2_QUEUE_ID_DCORE1_TPC_4_2 = 78,
242 GAUDI2_QUEUE_ID_DCORE1_TPC_4_3 = 79,
243 GAUDI2_QUEUE_ID_DCORE1_TPC_5_0 = 80,
244 GAUDI2_QUEUE_ID_DCORE1_TPC_5_1 = 81,
245 GAUDI2_QUEUE_ID_DCORE1_TPC_5_2 = 82,
246 GAUDI2_QUEUE_ID_DCORE1_TPC_5_3 = 83,
247 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_0 = 84,
248 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_1 = 85,
249 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_2 = 86,
250 GAUDI2_QUEUE_ID_DCORE2_EDMA_0_3 = 87,
251 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_0 = 88,
252 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_1 = 89,
253 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_2 = 90,
254 GAUDI2_QUEUE_ID_DCORE2_EDMA_1_3 = 91,
255 GAUDI2_QUEUE_ID_DCORE2_MME_0_0 = 92,
256 GAUDI2_QUEUE_ID_DCORE2_MME_0_1 = 93,
257 GAUDI2_QUEUE_ID_DCORE2_MME_0_2 = 94,
258 GAUDI2_QUEUE_ID_DCORE2_MME_0_3 = 95,
259 GAUDI2_QUEUE_ID_DCORE2_TPC_0_0 = 96,
260 GAUDI2_QUEUE_ID_DCORE2_TPC_0_1 = 97,
261 GAUDI2_QUEUE_ID_DCORE2_TPC_0_2 = 98,
262 GAUDI2_QUEUE_ID_DCORE2_TPC_0_3 = 99,
263 GAUDI2_QUEUE_ID_DCORE2_TPC_1_0 = 100,
264 GAUDI2_QUEUE_ID_DCORE2_TPC_1_1 = 101,
265 GAUDI2_QUEUE_ID_DCORE2_TPC_1_2 = 102,
266 GAUDI2_QUEUE_ID_DCORE2_TPC_1_3 = 103,
267 GAUDI2_QUEUE_ID_DCORE2_TPC_2_0 = 104,
268 GAUDI2_QUEUE_ID_DCORE2_TPC_2_1 = 105,
269 GAUDI2_QUEUE_ID_DCORE2_TPC_2_2 = 106,
270 GAUDI2_QUEUE_ID_DCORE2_TPC_2_3 = 107,
271 GAUDI2_QUEUE_ID_DCORE2_TPC_3_0 = 108,
272 GAUDI2_QUEUE_ID_DCORE2_TPC_3_1 = 109,
273 GAUDI2_QUEUE_ID_DCORE2_TPC_3_2 = 110,
274 GAUDI2_QUEUE_ID_DCORE2_TPC_3_3 = 111,
275 GAUDI2_QUEUE_ID_DCORE2_TPC_4_0 = 112,
276 GAUDI2_QUEUE_ID_DCORE2_TPC_4_1 = 113,
277 GAUDI2_QUEUE_ID_DCORE2_TPC_4_2 = 114,
278 GAUDI2_QUEUE_ID_DCORE2_TPC_4_3 = 115,
279 GAUDI2_QUEUE_ID_DCORE2_TPC_5_0 = 116,
280 GAUDI2_QUEUE_ID_DCORE2_TPC_5_1 = 117,
281 GAUDI2_QUEUE_ID_DCORE2_TPC_5_2 = 118,
282 GAUDI2_QUEUE_ID_DCORE2_TPC_5_3 = 119,
283 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_0 = 120,
284 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_1 = 121,
285 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_2 = 122,
286 GAUDI2_QUEUE_ID_DCORE3_EDMA_0_3 = 123,
287 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_0 = 124,
288 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_1 = 125,
289 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_2 = 126,
290 GAUDI2_QUEUE_ID_DCORE3_EDMA_1_3 = 127,
291 GAUDI2_QUEUE_ID_DCORE3_MME_0_0 = 128,
292 GAUDI2_QUEUE_ID_DCORE3_MME_0_1 = 129,
293 GAUDI2_QUEUE_ID_DCORE3_MME_0_2 = 130,
294 GAUDI2_QUEUE_ID_DCORE3_MME_0_3 = 131,
295 GAUDI2_QUEUE_ID_DCORE3_TPC_0_0 = 132,
296 GAUDI2_QUEUE_ID_DCORE3_TPC_0_1 = 133,
297 GAUDI2_QUEUE_ID_DCORE3_TPC_0_2 = 134,
298 GAUDI2_QUEUE_ID_DCORE3_TPC_0_3 = 135,
299 GAUDI2_QUEUE_ID_DCORE3_TPC_1_0 = 136,
300 GAUDI2_QUEUE_ID_DCORE3_TPC_1_1 = 137,
301 GAUDI2_QUEUE_ID_DCORE3_TPC_1_2 = 138,
302 GAUDI2_QUEUE_ID_DCORE3_TPC_1_3 = 139,
303 GAUDI2_QUEUE_ID_DCORE3_TPC_2_0 = 140,
304 GAUDI2_QUEUE_ID_DCORE3_TPC_2_1 = 141,
305 GAUDI2_QUEUE_ID_DCORE3_TPC_2_2 = 142,
306 GAUDI2_QUEUE_ID_DCORE3_TPC_2_3 = 143,
307 GAUDI2_QUEUE_ID_DCORE3_TPC_3_0 = 144,
308 GAUDI2_QUEUE_ID_DCORE3_TPC_3_1 = 145,
309 GAUDI2_QUEUE_ID_DCORE3_TPC_3_2 = 146,
310 GAUDI2_QUEUE_ID_DCORE3_TPC_3_3 = 147,
311 GAUDI2_QUEUE_ID_DCORE3_TPC_4_0 = 148,
312 GAUDI2_QUEUE_ID_DCORE3_TPC_4_1 = 149,
313 GAUDI2_QUEUE_ID_DCORE3_TPC_4_2 = 150,
314 GAUDI2_QUEUE_ID_DCORE3_TPC_4_3 = 151,
315 GAUDI2_QUEUE_ID_DCORE3_TPC_5_0 = 152,
316 GAUDI2_QUEUE_ID_DCORE3_TPC_5_1 = 153,
317 GAUDI2_QUEUE_ID_DCORE3_TPC_5_2 = 154,
318 GAUDI2_QUEUE_ID_DCORE3_TPC_5_3 = 155,
319 GAUDI2_QUEUE_ID_NIC_0_0 = 156,
320 GAUDI2_QUEUE_ID_NIC_0_1 = 157,
321 GAUDI2_QUEUE_ID_NIC_0_2 = 158,
322 GAUDI2_QUEUE_ID_NIC_0_3 = 159,
323 GAUDI2_QUEUE_ID_NIC_1_0 = 160,
324 GAUDI2_QUEUE_ID_NIC_1_1 = 161,
325 GAUDI2_QUEUE_ID_NIC_1_2 = 162,
326 GAUDI2_QUEUE_ID_NIC_1_3 = 163,
327 GAUDI2_QUEUE_ID_NIC_2_0 = 164,
328 GAUDI2_QUEUE_ID_NIC_2_1 = 165,
329 GAUDI2_QUEUE_ID_NIC_2_2 = 166,
330 GAUDI2_QUEUE_ID_NIC_2_3 = 167,
331 GAUDI2_QUEUE_ID_NIC_3_0 = 168,
332 GAUDI2_QUEUE_ID_NIC_3_1 = 169,
333 GAUDI2_QUEUE_ID_NIC_3_2 = 170,
334 GAUDI2_QUEUE_ID_NIC_3_3 = 171,
335 GAUDI2_QUEUE_ID_NIC_4_0 = 172,
336 GAUDI2_QUEUE_ID_NIC_4_1 = 173,
337 GAUDI2_QUEUE_ID_NIC_4_2 = 174,
338 GAUDI2_QUEUE_ID_NIC_4_3 = 175,
339 GAUDI2_QUEUE_ID_NIC_5_0 = 176,
340 GAUDI2_QUEUE_ID_NIC_5_1 = 177,
341 GAUDI2_QUEUE_ID_NIC_5_2 = 178,
342 GAUDI2_QUEUE_ID_NIC_5_3 = 179,
343 GAUDI2_QUEUE_ID_NIC_6_0 = 180,
344 GAUDI2_QUEUE_ID_NIC_6_1 = 181,
345 GAUDI2_QUEUE_ID_NIC_6_2 = 182,
346 GAUDI2_QUEUE_ID_NIC_6_3 = 183,
347 GAUDI2_QUEUE_ID_NIC_7_0 = 184,
348 GAUDI2_QUEUE_ID_NIC_7_1 = 185,
349 GAUDI2_QUEUE_ID_NIC_7_2 = 186,
350 GAUDI2_QUEUE_ID_NIC_7_3 = 187,
351 GAUDI2_QUEUE_ID_NIC_8_0 = 188,
352 GAUDI2_QUEUE_ID_NIC_8_1 = 189,
353 GAUDI2_QUEUE_ID_NIC_8_2 = 190,
354 GAUDI2_QUEUE_ID_NIC_8_3 = 191,
355 GAUDI2_QUEUE_ID_NIC_9_0 = 192,
356 GAUDI2_QUEUE_ID_NIC_9_1 = 193,
357 GAUDI2_QUEUE_ID_NIC_9_2 = 194,
358 GAUDI2_QUEUE_ID_NIC_9_3 = 195,
359 GAUDI2_QUEUE_ID_NIC_10_0 = 196,
360 GAUDI2_QUEUE_ID_NIC_10_1 = 197,
361 GAUDI2_QUEUE_ID_NIC_10_2 = 198,
362 GAUDI2_QUEUE_ID_NIC_10_3 = 199,
363 GAUDI2_QUEUE_ID_NIC_11_0 = 200,
364 GAUDI2_QUEUE_ID_NIC_11_1 = 201,
365 GAUDI2_QUEUE_ID_NIC_11_2 = 202,
366 GAUDI2_QUEUE_ID_NIC_11_3 = 203,
367 GAUDI2_QUEUE_ID_NIC_12_0 = 204,
368 GAUDI2_QUEUE_ID_NIC_12_1 = 205,
369 GAUDI2_QUEUE_ID_NIC_12_2 = 206,
370 GAUDI2_QUEUE_ID_NIC_12_3 = 207,
371 GAUDI2_QUEUE_ID_NIC_13_0 = 208,
372 GAUDI2_QUEUE_ID_NIC_13_1 = 209,
373 GAUDI2_QUEUE_ID_NIC_13_2 = 210,
374 GAUDI2_QUEUE_ID_NIC_13_3 = 211,
375 GAUDI2_QUEUE_ID_NIC_14_0 = 212,
376 GAUDI2_QUEUE_ID_NIC_14_1 = 213,
377 GAUDI2_QUEUE_ID_NIC_14_2 = 214,
378 GAUDI2_QUEUE_ID_NIC_14_3 = 215,
379 GAUDI2_QUEUE_ID_NIC_15_0 = 216,
380 GAUDI2_QUEUE_ID_NIC_15_1 = 217,
381 GAUDI2_QUEUE_ID_NIC_15_2 = 218,
382 GAUDI2_QUEUE_ID_NIC_15_3 = 219,
383 GAUDI2_QUEUE_ID_NIC_16_0 = 220,
384 GAUDI2_QUEUE_ID_NIC_16_1 = 221,
385 GAUDI2_QUEUE_ID_NIC_16_2 = 222,
386 GAUDI2_QUEUE_ID_NIC_16_3 = 223,
387 GAUDI2_QUEUE_ID_NIC_17_0 = 224,
388 GAUDI2_QUEUE_ID_NIC_17_1 = 225,
389 GAUDI2_QUEUE_ID_NIC_17_2 = 226,
390 GAUDI2_QUEUE_ID_NIC_17_3 = 227,
391 GAUDI2_QUEUE_ID_NIC_18_0 = 228,
392 GAUDI2_QUEUE_ID_NIC_18_1 = 229,
393 GAUDI2_QUEUE_ID_NIC_18_2 = 230,
394 GAUDI2_QUEUE_ID_NIC_18_3 = 231,
395 GAUDI2_QUEUE_ID_NIC_19_0 = 232,
396 GAUDI2_QUEUE_ID_NIC_19_1 = 233,
397 GAUDI2_QUEUE_ID_NIC_19_2 = 234,
398 GAUDI2_QUEUE_ID_NIC_19_3 = 235,
399 GAUDI2_QUEUE_ID_NIC_20_0 = 236,
400 GAUDI2_QUEUE_ID_NIC_20_1 = 237,
401 GAUDI2_QUEUE_ID_NIC_20_2 = 238,
402 GAUDI2_QUEUE_ID_NIC_20_3 = 239,
403 GAUDI2_QUEUE_ID_NIC_21_0 = 240,
404 GAUDI2_QUEUE_ID_NIC_21_1 = 241,
405 GAUDI2_QUEUE_ID_NIC_21_2 = 242,
406 GAUDI2_QUEUE_ID_NIC_21_3 = 243,
407 GAUDI2_QUEUE_ID_NIC_22_0 = 244,
408 GAUDI2_QUEUE_ID_NIC_22_1 = 245,
409 GAUDI2_QUEUE_ID_NIC_22_2 = 246,
410 GAUDI2_QUEUE_ID_NIC_22_3 = 247,
411 GAUDI2_QUEUE_ID_NIC_23_0 = 248,
412 GAUDI2_QUEUE_ID_NIC_23_1 = 249,
413 GAUDI2_QUEUE_ID_NIC_23_2 = 250,
414 GAUDI2_QUEUE_ID_NIC_23_3 = 251,
415 GAUDI2_QUEUE_ID_ROT_0_0 = 252,
416 GAUDI2_QUEUE_ID_ROT_0_1 = 253,
417 GAUDI2_QUEUE_ID_ROT_0_2 = 254,
418 GAUDI2_QUEUE_ID_ROT_0_3 = 255,
419 GAUDI2_QUEUE_ID_ROT_1_0 = 256,
420 GAUDI2_QUEUE_ID_ROT_1_1 = 257,
421 GAUDI2_QUEUE_ID_ROT_1_2 = 258,
422 GAUDI2_QUEUE_ID_ROT_1_3 = 259,
423 GAUDI2_QUEUE_ID_CPU_PQ = 260,
424 GAUDI2_QUEUE_ID_SIZE
425};
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700426enum goya_engine_id {
427 GOYA_ENGINE_ID_DMA_0 = 0,
428 GOYA_ENGINE_ID_DMA_1,
429 GOYA_ENGINE_ID_DMA_2,
430 GOYA_ENGINE_ID_DMA_3,
431 GOYA_ENGINE_ID_DMA_4,
432 GOYA_ENGINE_ID_MME_0,
433 GOYA_ENGINE_ID_TPC_0,
434 GOYA_ENGINE_ID_TPC_1,
435 GOYA_ENGINE_ID_TPC_2,
436 GOYA_ENGINE_ID_TPC_3,
437 GOYA_ENGINE_ID_TPC_4,
438 GOYA_ENGINE_ID_TPC_5,
439 GOYA_ENGINE_ID_TPC_6,
440 GOYA_ENGINE_ID_TPC_7,
441 GOYA_ENGINE_ID_SIZE
442};
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700443enum gaudi_engine_id {
444 GAUDI_ENGINE_ID_DMA_0 = 0,
445 GAUDI_ENGINE_ID_DMA_1,
446 GAUDI_ENGINE_ID_DMA_2,
447 GAUDI_ENGINE_ID_DMA_3,
448 GAUDI_ENGINE_ID_DMA_4,
449 GAUDI_ENGINE_ID_DMA_5,
450 GAUDI_ENGINE_ID_DMA_6,
451 GAUDI_ENGINE_ID_DMA_7,
452 GAUDI_ENGINE_ID_MME_0,
453 GAUDI_ENGINE_ID_MME_1,
454 GAUDI_ENGINE_ID_MME_2,
455 GAUDI_ENGINE_ID_MME_3,
456 GAUDI_ENGINE_ID_TPC_0,
457 GAUDI_ENGINE_ID_TPC_1,
458 GAUDI_ENGINE_ID_TPC_2,
459 GAUDI_ENGINE_ID_TPC_3,
460 GAUDI_ENGINE_ID_TPC_4,
461 GAUDI_ENGINE_ID_TPC_5,
462 GAUDI_ENGINE_ID_TPC_6,
463 GAUDI_ENGINE_ID_TPC_7,
464 GAUDI_ENGINE_ID_NIC_0,
465 GAUDI_ENGINE_ID_NIC_1,
466 GAUDI_ENGINE_ID_NIC_2,
467 GAUDI_ENGINE_ID_NIC_3,
468 GAUDI_ENGINE_ID_NIC_4,
469 GAUDI_ENGINE_ID_NIC_5,
470 GAUDI_ENGINE_ID_NIC_6,
471 GAUDI_ENGINE_ID_NIC_7,
472 GAUDI_ENGINE_ID_NIC_8,
473 GAUDI_ENGINE_ID_NIC_9,
474 GAUDI_ENGINE_ID_SIZE
475};
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700476enum gaudi2_engine_id {
477 GAUDI2_DCORE0_ENGINE_ID_EDMA_0 = 0,
478 GAUDI2_DCORE0_ENGINE_ID_EDMA_1,
479 GAUDI2_DCORE0_ENGINE_ID_MME,
480 GAUDI2_DCORE0_ENGINE_ID_TPC_0,
481 GAUDI2_DCORE0_ENGINE_ID_TPC_1,
482 GAUDI2_DCORE0_ENGINE_ID_TPC_2,
483 GAUDI2_DCORE0_ENGINE_ID_TPC_3,
484 GAUDI2_DCORE0_ENGINE_ID_TPC_4,
485 GAUDI2_DCORE0_ENGINE_ID_TPC_5,
486 GAUDI2_DCORE0_ENGINE_ID_DEC_0,
487 GAUDI2_DCORE0_ENGINE_ID_DEC_1,
488 GAUDI2_DCORE1_ENGINE_ID_EDMA_0,
489 GAUDI2_DCORE1_ENGINE_ID_EDMA_1,
490 GAUDI2_DCORE1_ENGINE_ID_MME,
491 GAUDI2_DCORE1_ENGINE_ID_TPC_0,
492 GAUDI2_DCORE1_ENGINE_ID_TPC_1,
493 GAUDI2_DCORE1_ENGINE_ID_TPC_2,
494 GAUDI2_DCORE1_ENGINE_ID_TPC_3,
495 GAUDI2_DCORE1_ENGINE_ID_TPC_4,
496 GAUDI2_DCORE1_ENGINE_ID_TPC_5,
497 GAUDI2_DCORE1_ENGINE_ID_DEC_0,
498 GAUDI2_DCORE1_ENGINE_ID_DEC_1,
499 GAUDI2_DCORE2_ENGINE_ID_EDMA_0,
500 GAUDI2_DCORE2_ENGINE_ID_EDMA_1,
501 GAUDI2_DCORE2_ENGINE_ID_MME,
502 GAUDI2_DCORE2_ENGINE_ID_TPC_0,
503 GAUDI2_DCORE2_ENGINE_ID_TPC_1,
504 GAUDI2_DCORE2_ENGINE_ID_TPC_2,
505 GAUDI2_DCORE2_ENGINE_ID_TPC_3,
506 GAUDI2_DCORE2_ENGINE_ID_TPC_4,
507 GAUDI2_DCORE2_ENGINE_ID_TPC_5,
508 GAUDI2_DCORE2_ENGINE_ID_DEC_0,
509 GAUDI2_DCORE2_ENGINE_ID_DEC_1,
510 GAUDI2_DCORE3_ENGINE_ID_EDMA_0,
511 GAUDI2_DCORE3_ENGINE_ID_EDMA_1,
512 GAUDI2_DCORE3_ENGINE_ID_MME,
513 GAUDI2_DCORE3_ENGINE_ID_TPC_0,
514 GAUDI2_DCORE3_ENGINE_ID_TPC_1,
515 GAUDI2_DCORE3_ENGINE_ID_TPC_2,
516 GAUDI2_DCORE3_ENGINE_ID_TPC_3,
517 GAUDI2_DCORE3_ENGINE_ID_TPC_4,
518 GAUDI2_DCORE3_ENGINE_ID_TPC_5,
519 GAUDI2_DCORE3_ENGINE_ID_DEC_0,
520 GAUDI2_DCORE3_ENGINE_ID_DEC_1,
521 GAUDI2_DCORE0_ENGINE_ID_TPC_6,
522 GAUDI2_ENGINE_ID_PDMA_0,
523 GAUDI2_ENGINE_ID_PDMA_1,
524 GAUDI2_ENGINE_ID_ROT_0,
525 GAUDI2_ENGINE_ID_ROT_1,
526 GAUDI2_PCIE_ENGINE_ID_DEC_0,
527 GAUDI2_PCIE_ENGINE_ID_DEC_1,
528 GAUDI2_ENGINE_ID_NIC0_0,
529 GAUDI2_ENGINE_ID_NIC0_1,
530 GAUDI2_ENGINE_ID_NIC1_0,
531 GAUDI2_ENGINE_ID_NIC1_1,
532 GAUDI2_ENGINE_ID_NIC2_0,
533 GAUDI2_ENGINE_ID_NIC2_1,
534 GAUDI2_ENGINE_ID_NIC3_0,
535 GAUDI2_ENGINE_ID_NIC3_1,
536 GAUDI2_ENGINE_ID_NIC4_0,
537 GAUDI2_ENGINE_ID_NIC4_1,
538 GAUDI2_ENGINE_ID_NIC5_0,
539 GAUDI2_ENGINE_ID_NIC5_1,
540 GAUDI2_ENGINE_ID_NIC6_0,
541 GAUDI2_ENGINE_ID_NIC6_1,
542 GAUDI2_ENGINE_ID_NIC7_0,
543 GAUDI2_ENGINE_ID_NIC7_1,
544 GAUDI2_ENGINE_ID_NIC8_0,
545 GAUDI2_ENGINE_ID_NIC8_1,
546 GAUDI2_ENGINE_ID_NIC9_0,
547 GAUDI2_ENGINE_ID_NIC9_1,
548 GAUDI2_ENGINE_ID_NIC10_0,
549 GAUDI2_ENGINE_ID_NIC10_1,
550 GAUDI2_ENGINE_ID_NIC11_0,
551 GAUDI2_ENGINE_ID_NIC11_1,
552 GAUDI2_ENGINE_ID_SIZE
553};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000554enum hl_goya_pll_index {
555 HL_GOYA_CPU_PLL = 0,
556 HL_GOYA_IC_PLL,
557 HL_GOYA_MC_PLL,
558 HL_GOYA_MME_PLL,
559 HL_GOYA_PCI_PLL,
560 HL_GOYA_EMMC_PLL,
561 HL_GOYA_TPC_PLL,
562 HL_GOYA_PLL_MAX
563};
564enum hl_gaudi_pll_index {
565 HL_GAUDI_CPU_PLL = 0,
566 HL_GAUDI_PCI_PLL,
567 HL_GAUDI_SRAM_PLL,
568 HL_GAUDI_HBM_PLL,
569 HL_GAUDI_NIC_PLL,
570 HL_GAUDI_DMA_PLL,
571 HL_GAUDI_MESH_PLL,
572 HL_GAUDI_MME_PLL,
573 HL_GAUDI_TPC_PLL,
574 HL_GAUDI_IF_PLL,
575 HL_GAUDI_PLL_MAX
576};
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700577enum hl_gaudi2_pll_index {
578 HL_GAUDI2_CPU_PLL = 0,
579 HL_GAUDI2_PCI_PLL,
580 HL_GAUDI2_SRAM_PLL,
581 HL_GAUDI2_HBM_PLL,
582 HL_GAUDI2_NIC_PLL,
583 HL_GAUDI2_DMA_PLL,
584 HL_GAUDI2_MESH_PLL,
585 HL_GAUDI2_MME_PLL,
586 HL_GAUDI2_TPC_PLL,
587 HL_GAUDI2_IF_PLL,
588 HL_GAUDI2_VID_PLL,
589 HL_GAUDI2_MSS_PLL,
590 HL_GAUDI2_PLL_MAX
591};
592enum hl_goya_dma_direction {
593 HL_DMA_HOST_TO_DRAM,
594 HL_DMA_HOST_TO_SRAM,
595 HL_DMA_DRAM_TO_SRAM,
596 HL_DMA_SRAM_TO_DRAM,
597 HL_DMA_SRAM_TO_HOST,
598 HL_DMA_DRAM_TO_HOST,
599 HL_DMA_DRAM_TO_DRAM,
600 HL_DMA_SRAM_TO_SRAM,
601 HL_DMA_ENUM_MAX
602};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700603enum hl_device_status {
604 HL_DEVICE_STATUS_OPERATIONAL,
605 HL_DEVICE_STATUS_IN_RESET,
Christopher Ferris05667cd2021-02-16 16:01:34 -0800606 HL_DEVICE_STATUS_MALFUNCTION,
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700607 HL_DEVICE_STATUS_NEEDS_RESET,
608 HL_DEVICE_STATUS_IN_DEVICE_CREATION,
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700609 HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE,
610 HL_DEVICE_STATUS_LAST = HL_DEVICE_STATUS_IN_RESET_AFTER_DEVICE_RELEASE
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700611};
612enum hl_server_type {
613 HL_SERVER_TYPE_UNKNOWN = 0,
614 HL_SERVER_GAUDI_HLS1 = 1,
615 HL_SERVER_GAUDI_HLS1H = 2,
616 HL_SERVER_GAUDI_TYPE1 = 3,
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700617 HL_SERVER_GAUDI_TYPE2 = 4,
618 HL_SERVER_GAUDI2_HLS2 = 5
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700619};
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000620#define HL_NOTIFIER_EVENT_TPC_ASSERT (1ULL << 0)
621#define HL_NOTIFIER_EVENT_UNDEFINED_OPCODE (1ULL << 1)
622#define HL_NOTIFIER_EVENT_DEVICE_RESET (1ULL << 2)
623#define HL_NOTIFIER_EVENT_CS_TIMEOUT (1ULL << 3)
624#define HL_NOTIFIER_EVENT_DEVICE_UNAVAILABLE (1ULL << 4)
625#define HL_NOTIFIER_EVENT_USER_ENGINE_ERR (1ULL << 5)
626#define HL_NOTIFIER_EVENT_GENERAL_HW_ERR (1ULL << 6)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700627#define HL_INFO_HW_IP_INFO 0
628#define HL_INFO_HW_EVENTS 1
629#define HL_INFO_DRAM_USAGE 2
630#define HL_INFO_HW_IDLE 3
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700631#define HL_INFO_DEVICE_STATUS 4
Christopher Ferris9584fa42019-12-09 15:36:13 -0800632#define HL_INFO_DEVICE_UTILIZATION 6
633#define HL_INFO_HW_EVENTS_AGGREGATE 7
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800634#define HL_INFO_CLK_RATE 8
635#define HL_INFO_RESET_COUNT 9
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700636#define HL_INFO_TIME_SYNC 10
Christopher Ferris25c18d42020-10-14 17:42:58 -0700637#define HL_INFO_CS_COUNTERS 11
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800638#define HL_INFO_PCI_COUNTERS 12
639#define HL_INFO_CLK_THROTTLE_REASON 13
640#define HL_INFO_SYNC_MANAGER 14
641#define HL_INFO_TOTAL_ENERGY 15
Christopher Ferris05667cd2021-02-16 16:01:34 -0800642#define HL_INFO_PLL_FREQUENCY 16
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000643#define HL_INFO_POWER 17
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000644#define HL_INFO_OPEN_STATS 18
Christopher Ferris1ed55342022-03-22 16:06:25 -0700645#define HL_INFO_DRAM_REPLACED_ROWS 21
646#define HL_INFO_DRAM_PENDING_ROWS 22
647#define HL_INFO_LAST_ERR_OPEN_DEV_TIME 23
648#define HL_INFO_CS_TIMEOUT_EVENT 24
649#define HL_INFO_RAZWI_EVENT 25
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700650#define HL_INFO_DEV_MEM_ALLOC_PAGE_SIZES 26
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000651#define HL_INFO_SECURED_ATTESTATION 27
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700652#define HL_INFO_REGISTER_EVENTFD 28
653#define HL_INFO_UNREGISTER_EVENTFD 29
654#define HL_INFO_GET_EVENTS 30
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700655#define HL_INFO_UNDEFINED_OPCODE_EVENT 31
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000656#define HL_INFO_ENGINE_STATUS 32
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700657#define HL_INFO_VERSION_MAX_LEN 128
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800658#define HL_INFO_CARD_NAME_MAX_LEN 16
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000659#define HL_ENGINES_DATA_MAX_SIZE SZ_1M
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700660struct hl_info_hw_ip_info {
661 __u64 sram_base_address;
662 __u64 dram_base_address;
663 __u64 dram_size;
664 __u32 sram_size;
665 __u32 num_of_events;
666 __u32 device_id;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700667 __u32 module_id;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700668 __u32 decoder_enabled_mask;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700669 __u16 first_available_interrupt_id;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700670 __u16 server_type;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800671 __u32 cpld_version;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700672 __u32 psoc_pci_pll_nr;
673 __u32 psoc_pci_pll_nf;
674 __u32 psoc_pci_pll_od;
675 __u32 psoc_pci_pll_div_factor;
676 __u8 tpc_enabled_mask;
677 __u8 dram_enabled;
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000678 __u8 security_enabled;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700679 __u8 mme_master_slave_mode;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800680 __u8 cpucp_version[HL_INFO_VERSION_MAX_LEN];
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800681 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700682 __u64 tpc_enabled_mask_ext;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700683 __u64 dram_page_size;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700684 __u32 edma_enabled_mask;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700685 __u16 number_of_user_interrupts;
686 __u16 pad2;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700687 __u64 reserved4;
688 __u64 device_mem_alloc_default_page_size;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700689};
690struct hl_info_dram_usage {
691 __u64 dram_free_mem;
692 __u64 ctx_dram_mem;
693};
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700694#define HL_BUSY_ENGINES_MASK_EXT_SIZE 2
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700695struct hl_info_hw_idle {
696 __u32 is_idle;
Christopher Ferrisb8a95e22019-10-02 18:29:20 -0700697 __u32 busy_engines_mask;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700698 __u64 busy_engines_mask_ext[HL_BUSY_ENGINES_MASK_EXT_SIZE];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700699};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700700struct hl_info_device_status {
701 __u32 status;
702 __u32 pad;
703};
Christopher Ferris9584fa42019-12-09 15:36:13 -0800704struct hl_info_device_utilization {
705 __u32 utilization;
706 __u32 pad;
707};
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800708struct hl_info_clk_rate {
709 __u32 cur_clk_rate_mhz;
710 __u32 max_clk_rate_mhz;
711};
712struct hl_info_reset_count {
713 __u32 hard_reset_cnt;
714 __u32 soft_reset_cnt;
715};
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700716struct hl_info_time_sync {
717 __u64 device_time;
718 __u64 host_time;
719};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800720struct hl_info_pci_counters {
721 __u64 rx_throughput;
722 __u64 tx_throughput;
723 __u64 replay_cnt;
724};
Christopher Ferris1ed55342022-03-22 16:06:25 -0700725enum hl_clk_throttling_type {
726 HL_CLK_THROTTLE_TYPE_POWER,
727 HL_CLK_THROTTLE_TYPE_THERMAL,
728 HL_CLK_THROTTLE_TYPE_MAX
729};
730#define HL_CLK_THROTTLE_POWER (1 << HL_CLK_THROTTLE_TYPE_POWER)
731#define HL_CLK_THROTTLE_THERMAL (1 << HL_CLK_THROTTLE_TYPE_THERMAL)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800732struct hl_info_clk_throttle {
733 __u32 clk_throttling_reason;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700734 __u32 pad;
735 __u64 clk_throttling_timestamp_us[HL_CLK_THROTTLE_TYPE_MAX];
736 __u64 clk_throttling_duration_ns[HL_CLK_THROTTLE_TYPE_MAX];
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800737};
738struct hl_info_energy {
739 __u64 total_energy_consumption;
740};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800741#define HL_PLL_NUM_OUTPUTS 4
742struct hl_pll_frequency_info {
743 __u16 output[HL_PLL_NUM_OUTPUTS];
744};
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000745struct hl_open_stats_info {
746 __u64 open_counter;
747 __u64 last_open_period_ms;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700748 __u8 is_compute_ctx_active;
749 __u8 compute_ctx_in_release;
750 __u8 pad[6];
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000751};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000752struct hl_power_info {
753 __u64 power;
754};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800755struct hl_info_sync_manager {
756 __u32 first_available_sync_object;
757 __u32 first_available_monitor;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700758 __u32 first_available_cq;
759 __u32 reserved;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800760};
Christopher Ferris25c18d42020-10-14 17:42:58 -0700761struct hl_info_cs_counters {
Christopher Ferris05667cd2021-02-16 16:01:34 -0800762 __u64 total_out_of_mem_drop_cnt;
763 __u64 ctx_out_of_mem_drop_cnt;
764 __u64 total_parsing_drop_cnt;
765 __u64 ctx_parsing_drop_cnt;
766 __u64 total_queue_full_drop_cnt;
767 __u64 ctx_queue_full_drop_cnt;
768 __u64 total_device_in_reset_drop_cnt;
769 __u64 ctx_device_in_reset_drop_cnt;
770 __u64 total_max_cs_in_flight_drop_cnt;
771 __u64 ctx_max_cs_in_flight_drop_cnt;
772 __u64 total_validation_drop_cnt;
773 __u64 ctx_validation_drop_cnt;
Christopher Ferris25c18d42020-10-14 17:42:58 -0700774};
Christopher Ferris1ed55342022-03-22 16:06:25 -0700775struct hl_info_last_err_open_dev_time {
776 __s64 timestamp;
777};
778struct hl_info_cs_timeout_event {
779 __s64 timestamp;
780 __u64 seq;
781};
782#define HL_RAZWI_PAGE_FAULT 0
783#define HL_RAZWI_MMU_ACCESS_ERROR 1
784struct hl_info_razwi_event {
785 __s64 timestamp;
786 __u64 addr;
787 __u16 engine_id_1;
788 __u16 engine_id_2;
789 __u8 no_engine_id;
790 __u8 error_type;
791 __u8 pad[2];
792};
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700793#define MAX_QMAN_STREAMS_INFO 4
794#define OPCODE_INFO_MAX_ADDR_SIZE 8
795struct hl_info_undefined_opcode_event {
796 __s64 timestamp;
797 __u64 cb_addr_streams[MAX_QMAN_STREAMS_INFO][OPCODE_INFO_MAX_ADDR_SIZE];
798 __u64 cq_addr;
799 __u32 cq_size;
800 __u32 cb_addr_streams_len;
801 __u32 engine_id;
802 __u32 stream_id;
803};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700804struct hl_info_dev_memalloc_page_sizes {
805 __u64 page_order_bitmask;
806};
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000807#define SEC_PCR_DATA_BUF_SZ 256
808#define SEC_PCR_QUOTE_BUF_SZ 510
809#define SEC_SIGNATURE_BUF_SZ 255
810#define SEC_PUB_DATA_BUF_SZ 510
811#define SEC_CERTIFICATE_BUF_SZ 2046
812struct hl_info_sec_attest {
813 __u32 nonce;
814 __u16 pcr_quote_len;
815 __u16 pub_data_len;
816 __u16 certificate_len;
817 __u8 pcr_num_reg;
818 __u8 pcr_reg_len;
819 __u8 quote_sig_len;
820 __u8 pcr_data[SEC_PCR_DATA_BUF_SZ];
821 __u8 pcr_quote[SEC_PCR_QUOTE_BUF_SZ];
822 __u8 quote_sig[SEC_SIGNATURE_BUF_SZ];
823 __u8 public_data[SEC_PUB_DATA_BUF_SZ];
824 __u8 certificate[SEC_CERTIFICATE_BUF_SZ];
825 __u8 pad0[2];
826};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800827enum gaudi_dcores {
828 HL_GAUDI_WS_DCORE,
829 HL_GAUDI_WN_DCORE,
830 HL_GAUDI_EN_DCORE,
831 HL_GAUDI_ES_DCORE
832};
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700833struct hl_info_args {
834 __u64 return_pointer;
835 __u32 return_size;
836 __u32 op;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800837 union {
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800838 __u32 dcore_id;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800839 __u32 ctx_id;
840 __u32 period_ms;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800841 __u32 pll_index;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700842 __u32 eventfd;
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000843 __u32 user_buffer_actual_size;
844 __u32 sec_attest_nonce;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800845 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700846 __u32 pad;
847};
848#define HL_CB_OP_CREATE 0
849#define HL_CB_OP_DESTROY 1
Christopher Ferris05667cd2021-02-16 16:01:34 -0800850#define HL_CB_OP_INFO 2
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700851#define HL_MAX_CB_SIZE (0x200000 - 32)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800852#define HL_CB_FLAGS_MAP 0x1
Christopher Ferris1ed55342022-03-22 16:06:25 -0700853#define HL_CB_FLAGS_GET_DEVICE_VA 0x2
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700854struct hl_cb_in {
855 __u64 cb_handle;
856 __u32 op;
857 __u32 cb_size;
858 __u32 ctx_id;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800859 __u32 flags;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700860};
861struct hl_cb_out {
Christopher Ferris05667cd2021-02-16 16:01:34 -0800862 union {
863 __u64 cb_handle;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700864 union {
865 struct {
866 __u32 usage_cnt;
867 __u32 pad;
868 };
869 __u64 device_va;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800870 };
871 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700872};
873union hl_cb_args {
874 struct hl_cb_in in;
875 struct hl_cb_out out;
876};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800877#define HL_CS_CHUNK_FLAGS_USER_ALLOC_CB 0x1
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700878struct hl_cs_chunk {
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700879 union {
880 __u64 cb_handle;
881 __u64 signal_seq_arr;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700882 __u64 encaps_signal_seq;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700883 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700884 __u32 queue_index;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700885 union {
886 __u32 cb_size;
887 __u32 num_signal_seq_arr;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700888 __u32 encaps_signal_offset;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700889 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700890 __u32 cs_chunk_flags;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800891 __u32 collective_engine_id;
892 __u32 pad[10];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700893};
894#define HL_CS_FLAGS_FORCE_RESTORE 0x1
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700895#define HL_CS_FLAGS_SIGNAL 0x2
896#define HL_CS_FLAGS_WAIT 0x4
Christopher Ferris05667cd2021-02-16 16:01:34 -0800897#define HL_CS_FLAGS_COLLECTIVE_WAIT 0x8
898#define HL_CS_FLAGS_TIMESTAMP 0x20
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700899#define HL_CS_FLAGS_STAGED_SUBMISSION 0x40
900#define HL_CS_FLAGS_STAGED_SUBMISSION_FIRST 0x80
901#define HL_CS_FLAGS_STAGED_SUBMISSION_LAST 0x100
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000902#define HL_CS_FLAGS_CUSTOM_TIMEOUT 0x200
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000903#define HL_CS_FLAGS_SKIP_RESET_ON_TIMEOUT 0x400
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700904#define HL_CS_FLAGS_ENCAP_SIGNALS 0x800
905#define HL_CS_FLAGS_RESERVE_SIGNALS_ONLY 0x1000
906#define HL_CS_FLAGS_UNRESERVE_SIGNALS_ONLY 0x2000
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000907#define HL_CS_FLAGS_ENGINE_CORE_COMMAND 0x4000
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700908#define HL_CS_STATUS_SUCCESS 0
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800909#define HL_MAX_JOBS_PER_CS 512
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000910#define HL_ENGINE_CORE_HALT (1 << 0)
911#define HL_ENGINE_CORE_RUN (1 << 1)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700912struct hl_cs_in {
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000913 union {
914 struct {
915 __u64 chunks_restore;
916 __u64 chunks_execute;
917 };
918 struct {
919 __u64 engine_cores;
920 __u32 num_engine_cores;
921 __u32 core_command;
922 };
923 };
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700924 union {
925 __u64 seq;
926 __u32 encaps_sig_handle_id;
927 struct {
928 __u32 encaps_signals_count;
929 __u32 encaps_signals_q_idx;
930 };
931 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700932 __u32 num_chunks_restore;
933 __u32 num_chunks_execute;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000934 __u32 timeout;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700935 __u32 cs_flags;
936 __u32 ctx_id;
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700937 __u8 pad[4];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700938};
939struct hl_cs_out {
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700940 union {
941 __u64 seq;
942 struct {
943 __u32 handle_id;
944 __u32 count;
945 };
946 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700947 __u32 status;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700948 __u32 sob_base_addr_offset;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700949 __u16 sob_count_before_submission;
950 __u16 pad[3];
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700951};
952union hl_cs_args {
953 struct hl_cs_in in;
954 struct hl_cs_out out;
955};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000956#define HL_WAIT_CS_FLAGS_INTERRUPT 0x2
957#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700958#define HL_WAIT_CS_FLAGS_ANY_CQ_INTERRUPT 0xFFF00000
959#define HL_WAIT_CS_FLAGS_ANY_DEC_INTERRUPT 0xFFE00000
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700960#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
Christopher Ferris1ed55342022-03-22 16:06:25 -0700961#define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10
Christopher Ferris10a76e62022-06-08 13:31:52 -0700962#define HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT 0x20
Christopher Ferris2abfa9e2021-11-01 16:26:06 -0700963#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700964struct hl_wait_cs_in {
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000965 union {
966 struct {
967 __u64 seq;
968 __u64 timeout_us;
969 };
970 struct {
Christopher Ferris1ed55342022-03-22 16:06:25 -0700971 union {
972 __u64 addr;
973 __u64 cq_counters_handle;
974 };
Christopher Ferrisa4792612022-01-10 13:51:15 -0800975 __u64 target;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000976 };
977 };
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700978 __u32 ctx_id;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000979 __u32 flags;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700980 union {
981 struct {
982 __u8 seq_arr_len;
983 __u8 pad[7];
984 };
985 __u64 interrupt_timeout_us;
986 };
987 __u64 cq_counters_offset;
Christopher Ferris10a76e62022-06-08 13:31:52 -0700988 __u64 timestamp_handle;
989 __u64 timestamp_offset;
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700990};
991#define HL_WAIT_CS_STATUS_COMPLETED 0
992#define HL_WAIT_CS_STATUS_BUSY 1
993#define HL_WAIT_CS_STATUS_TIMEDOUT 2
994#define HL_WAIT_CS_STATUS_ABORTED 3
Christopher Ferris05667cd2021-02-16 16:01:34 -0800995#define HL_WAIT_CS_STATUS_FLAG_GONE 0x1
996#define HL_WAIT_CS_STATUS_FLAG_TIMESTAMP_VLD 0x2
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700997struct hl_wait_cs_out {
998 __u32 status;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800999 __u32 flags;
1000 __s64 timestamp_nsec;
Christopher Ferris2abfa9e2021-11-01 16:26:06 -07001001 __u32 cs_completion_map;
1002 __u32 pad;
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001003};
1004union hl_wait_cs_args {
1005 struct hl_wait_cs_in in;
1006 struct hl_wait_cs_out out;
1007};
1008#define HL_MEM_OP_ALLOC 0
1009#define HL_MEM_OP_FREE 1
1010#define HL_MEM_OP_MAP 2
1011#define HL_MEM_OP_UNMAP 3
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001012#define HL_MEM_OP_MAP_BLOCK 4
Christopher Ferrisa4792612022-01-10 13:51:15 -08001013#define HL_MEM_OP_EXPORT_DMABUF_FD 5
Christopher Ferris10a76e62022-06-08 13:31:52 -07001014#define HL_MEM_OP_TS_ALLOC 6
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001015#define HL_MEM_CONTIGUOUS 0x1
1016#define HL_MEM_SHARED 0x2
1017#define HL_MEM_USERPTR 0x4
Christopher Ferris2abfa9e2021-11-01 16:26:06 -07001018#define HL_MEM_FORCE_HINT 0x8
Christopher Ferris80ae69d2022-08-02 16:32:21 -07001019#define HL_MEM_PREFETCH 0x40
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001020struct hl_mem_in {
1021 union {
1022 struct {
1023 __u64 mem_size;
Christopher Ferris10a76e62022-06-08 13:31:52 -07001024 __u64 page_size;
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001025 } alloc;
1026 struct {
1027 __u64 handle;
1028 } free;
1029 struct {
1030 __u64 hint_addr;
1031 __u64 handle;
1032 } map_device;
1033 struct {
1034 __u64 host_virt_addr;
1035 __u64 hint_addr;
1036 __u64 mem_size;
1037 } map_host;
1038 struct {
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001039 __u64 block_addr;
1040 } map_block;
1041 struct {
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001042 __u64 device_virt_addr;
1043 } unmap;
Christopher Ferrisa4792612022-01-10 13:51:15 -08001044 struct {
1045 __u64 handle;
1046 __u64 mem_size;
1047 } export_dmabuf_fd;
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001048 };
1049 __u32 op;
1050 __u32 flags;
1051 __u32 ctx_id;
Christopher Ferris10a76e62022-06-08 13:31:52 -07001052 __u32 num_of_elements;
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001053};
1054struct hl_mem_out {
1055 union {
1056 __u64 device_virt_addr;
1057 __u64 handle;
Christopher Ferrisa9750ed2021-05-03 14:02:49 -07001058 struct {
1059 __u64 block_handle;
1060 __u32 block_size;
1061 __u32 pad;
1062 };
Christopher Ferrisa4792612022-01-10 13:51:15 -08001063 __s32 fd;
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001064 };
1065};
1066union hl_mem_args {
1067 struct hl_mem_in in;
1068 struct hl_mem_out out;
1069};
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001070#define HL_DEBUG_MAX_AUX_VALUES 10
1071struct hl_debug_params_etr {
1072 __u64 buffer_address;
1073 __u64 buffer_size;
1074 __u32 sink_mode;
1075 __u32 pad;
1076};
1077struct hl_debug_params_etf {
1078 __u64 buffer_address;
1079 __u64 buffer_size;
1080 __u32 sink_mode;
1081 __u32 pad;
1082};
1083struct hl_debug_params_stm {
1084 __u64 he_mask;
1085 __u64 sp_mask;
1086 __u32 id;
1087 __u32 frequency;
1088};
1089struct hl_debug_params_bmon {
1090 __u64 start_addr0;
1091 __u64 addr_mask0;
1092 __u64 start_addr1;
1093 __u64 addr_mask1;
1094 __u32 bw_win;
1095 __u32 win_capture;
1096 __u32 id;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001097 __u32 control;
1098 __u64 start_addr2;
1099 __u64 end_addr2;
1100 __u64 start_addr3;
1101 __u64 end_addr3;
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001102};
1103struct hl_debug_params_spmu {
1104 __u64 event_types[HL_DEBUG_MAX_AUX_VALUES];
1105 __u32 event_types_num;
Christopher Ferris7447a1c2022-10-04 18:24:44 -07001106 __u32 pmtrc_val;
1107 __u32 trc_ctrl_host_val;
1108 __u32 trc_en_host_val;
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001109};
1110#define HL_DEBUG_OP_ETR 0
1111#define HL_DEBUG_OP_ETF 1
1112#define HL_DEBUG_OP_STM 2
1113#define HL_DEBUG_OP_FUNNEL 3
1114#define HL_DEBUG_OP_BMON 4
1115#define HL_DEBUG_OP_SPMU 5
1116#define HL_DEBUG_OP_TIMESTAMP 6
1117#define HL_DEBUG_OP_SET_MODE 7
1118struct hl_debug_args {
1119 __u64 input_ptr;
1120 __u64 output_ptr;
1121 __u32 input_size;
1122 __u32 output_size;
1123 __u32 op;
1124 __u32 reg_idx;
1125 __u32 enable;
1126 __u32 ctx_id;
1127};
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001128#define HL_IOCTL_INFO _IOWR('H', 0x01, struct hl_info_args)
1129#define HL_IOCTL_CB _IOWR('H', 0x02, union hl_cb_args)
1130#define HL_IOCTL_CS _IOWR('H', 0x03, union hl_cs_args)
1131#define HL_IOCTL_WAIT_CS _IOWR('H', 0x04, union hl_wait_cs_args)
1132#define HL_IOCTL_MEMORY _IOWR('H', 0x05, union hl_mem_args)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001133#define HL_IOCTL_DEBUG _IOWR('H', 0x06, struct hl_debug_args)
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001134#define HL_COMMAND_START 0x01
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -07001135#define HL_COMMAND_END 0x07
Christopher Ferris24f97eb2019-05-20 12:58:13 -07001136#endif