blob: 2966447f0e60d85efe366e0f49392aa0c5be7028 [file] [log] [blame]
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -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 _USR_IDXD_H_
20#define _USR_IDXD_H_
21#include <stdint.h>
Christopher Ferris2abfa9e2021-11-01 16:26:06 -070022enum idxd_scmd_stat {
23 IDXD_SCMD_DEV_ENABLED = 0x80000010,
24 IDXD_SCMD_DEV_NOT_ENABLED = 0x80000020,
25 IDXD_SCMD_WQ_ENABLED = 0x80000021,
26 IDXD_SCMD_DEV_DMA_ERR = 0x80020000,
27 IDXD_SCMD_WQ_NO_GRP = 0x80030000,
28 IDXD_SCMD_WQ_NO_NAME = 0x80040000,
29 IDXD_SCMD_WQ_NO_SVM = 0x80050000,
30 IDXD_SCMD_WQ_NO_THRESH = 0x80060000,
31 IDXD_SCMD_WQ_PORTAL_ERR = 0x80070000,
32 IDXD_SCMD_WQ_RES_ALLOC_ERR = 0x80080000,
33 IDXD_SCMD_PERCPU_ERR = 0x80090000,
34 IDXD_SCMD_DMA_CHAN_ERR = 0x800a0000,
35 IDXD_SCMD_CDEV_ERR = 0x800b0000,
36 IDXD_SCMD_WQ_NO_SWQ_SUPPORT = 0x800c0000,
37 IDXD_SCMD_WQ_NONE_CONFIGURED = 0x800d0000,
38 IDXD_SCMD_WQ_NO_SIZE = 0x800e0000,
39 IDXD_SCMD_WQ_NO_PRIV = 0x800f0000,
40};
41#define IDXD_SCMD_SOFTERR_MASK 0x80000000
42#define IDXD_SCMD_SOFTERR_SHIFT 16
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070043#define IDXD_OP_FLAG_FENCE 0x0001
44#define IDXD_OP_FLAG_BOF 0x0002
45#define IDXD_OP_FLAG_CRAV 0x0004
46#define IDXD_OP_FLAG_RCR 0x0008
47#define IDXD_OP_FLAG_RCI 0x0010
48#define IDXD_OP_FLAG_CRSTS 0x0020
49#define IDXD_OP_FLAG_CR 0x0080
50#define IDXD_OP_FLAG_CC 0x0100
51#define IDXD_OP_FLAG_ADDR1_TCS 0x0200
52#define IDXD_OP_FLAG_ADDR2_TCS 0x0400
53#define IDXD_OP_FLAG_ADDR3_TCS 0x0800
54#define IDXD_OP_FLAG_CR_TCS 0x1000
55#define IDXD_OP_FLAG_STORD 0x2000
56#define IDXD_OP_FLAG_DRDBK 0x4000
57#define IDXD_OP_FLAG_DSTS 0x8000
Christopher Ferris05667cd2021-02-16 16:01:34 -080058#define IDXD_OP_FLAG_RD_SRC2_AECS 0x010000
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070059enum dsa_opcode {
60 DSA_OPCODE_NOOP = 0,
61 DSA_OPCODE_BATCH,
62 DSA_OPCODE_DRAIN,
63 DSA_OPCODE_MEMMOVE,
64 DSA_OPCODE_MEMFILL,
65 DSA_OPCODE_COMPARE,
66 DSA_OPCODE_COMPVAL,
67 DSA_OPCODE_CR_DELTA,
68 DSA_OPCODE_AP_DELTA,
69 DSA_OPCODE_DUALCAST,
70 DSA_OPCODE_CRCGEN = 0x10,
71 DSA_OPCODE_COPY_CRC,
72 DSA_OPCODE_DIF_CHECK,
73 DSA_OPCODE_DIF_INS,
74 DSA_OPCODE_DIF_STRP,
75 DSA_OPCODE_DIF_UPDT,
76 DSA_OPCODE_CFLUSH = 0x20,
77};
Christopher Ferris05667cd2021-02-16 16:01:34 -080078enum iax_opcode {
79 IAX_OPCODE_NOOP = 0,
80 IAX_OPCODE_DRAIN = 2,
81 IAX_OPCODE_MEMMOVE,
82 IAX_OPCODE_DECOMPRESS = 0x42,
83 IAX_OPCODE_COMPRESS,
84};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -070085enum dsa_completion_status {
86 DSA_COMP_NONE = 0,
87 DSA_COMP_SUCCESS,
88 DSA_COMP_SUCCESS_PRED,
89 DSA_COMP_PAGE_FAULT_NOBOF,
90 DSA_COMP_PAGE_FAULT_IR,
91 DSA_COMP_BATCH_FAIL,
92 DSA_COMP_BATCH_PAGE_FAULT,
93 DSA_COMP_DR_OFFSET_NOINC,
94 DSA_COMP_DR_OFFSET_ERANGE,
95 DSA_COMP_DIF_ERR,
96 DSA_COMP_BAD_OPCODE = 0x10,
97 DSA_COMP_INVALID_FLAGS,
98 DSA_COMP_NOZERO_RESERVE,
99 DSA_COMP_XFER_ERANGE,
100 DSA_COMP_DESC_CNT_ERANGE,
101 DSA_COMP_DR_ERANGE,
102 DSA_COMP_OVERLAP_BUFFERS,
103 DSA_COMP_DCAST_ERR,
104 DSA_COMP_DESCLIST_ALIGN,
105 DSA_COMP_INT_HANDLE_INVAL,
106 DSA_COMP_CRA_XLAT,
107 DSA_COMP_CRA_ALIGN,
108 DSA_COMP_ADDR_ALIGN,
109 DSA_COMP_PRIV_BAD,
110 DSA_COMP_TRAFFIC_CLASS_CONF,
111 DSA_COMP_PFAULT_RDBA,
112 DSA_COMP_HW_ERR1,
113 DSA_COMP_HW_ERR_DRB,
114 DSA_COMP_TRANSLATION_FAIL,
115};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800116enum iax_completion_status {
117 IAX_COMP_NONE = 0,
118 IAX_COMP_SUCCESS,
119 IAX_COMP_PAGE_FAULT_IR = 0x04,
120 IAX_COMP_OUTBUF_OVERFLOW,
121 IAX_COMP_BAD_OPCODE = 0x10,
122 IAX_COMP_INVALID_FLAGS,
123 IAX_COMP_NOZERO_RESERVE,
124 IAX_COMP_INVALID_SIZE,
125 IAX_COMP_OVERLAP_BUFFERS = 0x16,
126 IAX_COMP_INT_HANDLE_INVAL = 0x19,
127 IAX_COMP_CRA_XLAT,
128 IAX_COMP_CRA_ALIGN,
129 IAX_COMP_ADDR_ALIGN,
130 IAX_COMP_PRIV_BAD,
131 IAX_COMP_TRAFFIC_CLASS_CONF,
132 IAX_COMP_PFAULT_RDBA,
133 IAX_COMP_HW_ERR1,
134 IAX_COMP_HW_ERR_DRB,
135 IAX_COMP_TRANSLATION_FAIL,
136 IAX_COMP_PRS_TIMEOUT,
137 IAX_COMP_WATCHDOG,
138 IAX_COMP_INVALID_COMP_FLAG = 0x30,
139 IAX_COMP_INVALID_FILTER_FLAG,
140 IAX_COMP_INVALID_NUM_ELEMS = 0x33,
141};
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700142#define DSA_COMP_STATUS_MASK 0x7f
143#define DSA_COMP_STATUS_WRITE 0x80
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700144struct dsa_hw_desc {
145 uint32_t pasid : 20;
146 uint32_t rsvd : 11;
147 uint32_t priv : 1;
148 uint32_t flags : 24;
149 uint32_t opcode : 8;
150 uint64_t completion_addr;
151 union {
152 uint64_t src_addr;
153 uint64_t rdback_addr;
154 uint64_t pattern;
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700155 uint64_t desc_list_addr;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700156 };
157 union {
158 uint64_t dst_addr;
159 uint64_t rdback_addr2;
160 uint64_t src2_addr;
161 uint64_t comp_pattern;
162 };
Christopher Ferrisaf09c702020-06-01 20:29:29 -0700163 union {
164 uint32_t xfer_size;
165 uint32_t desc_count;
166 };
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700167 uint16_t int_handle;
168 uint16_t rsvd1;
169 union {
170 uint8_t expected_res;
171 struct {
172 uint64_t delta_addr;
173 uint32_t max_delta_size;
Christopher Ferris8177cdf2020-08-03 11:53:55 -0700174 uint32_t delt_rsvd;
175 uint8_t expected_res_mask;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700176 };
177 uint32_t delta_rec_size;
178 uint64_t dest2;
179 struct {
180 uint32_t crc_seed;
181 uint32_t crc_rsvd;
182 uint64_t seed_addr;
183 };
184 struct {
185 uint8_t src_dif_flags;
186 uint8_t dif_chk_res;
187 uint8_t dif_chk_flags;
188 uint8_t dif_chk_res2[5];
189 uint32_t chk_ref_tag_seed;
190 uint16_t chk_app_tag_mask;
191 uint16_t chk_app_tag_seed;
192 };
193 struct {
194 uint8_t dif_ins_res;
195 uint8_t dest_dif_flag;
196 uint8_t dif_ins_flags;
197 uint8_t dif_ins_res2[13];
198 uint32_t ins_ref_tag_seed;
199 uint16_t ins_app_tag_mask;
200 uint16_t ins_app_tag_seed;
201 };
202 struct {
203 uint8_t src_upd_flags;
204 uint8_t upd_dest_flags;
205 uint8_t dif_upd_flags;
206 uint8_t dif_upd_res[5];
207 uint32_t src_ref_tag_seed;
208 uint16_t src_app_tag_mask;
209 uint16_t src_app_tag_seed;
210 uint32_t dest_ref_tag_seed;
211 uint16_t dest_app_tag_mask;
212 uint16_t dest_app_tag_seed;
213 };
214 uint8_t op_specific[24];
215 };
216} __attribute__((packed));
Christopher Ferris05667cd2021-02-16 16:01:34 -0800217struct iax_hw_desc {
218 uint32_t pasid : 20;
219 uint32_t rsvd : 11;
220 uint32_t priv : 1;
221 uint32_t flags : 24;
222 uint32_t opcode : 8;
223 uint64_t completion_addr;
224 uint64_t src1_addr;
225 uint64_t dst_addr;
226 uint32_t src1_size;
227 uint16_t int_handle;
228 union {
229 uint16_t compr_flags;
230 uint16_t decompr_flags;
231 };
232 uint64_t src2_addr;
233 uint32_t max_dst_size;
234 uint32_t src2_size;
235 uint32_t filter_flags;
236 uint32_t num_inputs;
237} __attribute__((packed));
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700238struct dsa_raw_desc {
239 uint64_t field[8];
240} __attribute__((packed));
241struct dsa_completion_record {
242 volatile uint8_t status;
243 union {
244 uint8_t result;
245 uint8_t dif_status;
246 };
247 uint16_t rsvd;
248 uint32_t bytes_completed;
249 uint64_t fault_addr;
250 union {
Christopher Ferris25c18d42020-10-14 17:42:58 -0700251 struct {
252 uint32_t invalid_flags : 24;
253 uint32_t rsvd2 : 8;
254 };
Christopher Ferrisa9750ed2021-05-03 14:02:49 -0700255 uint32_t delta_rec_size;
256 uint32_t crc_val;
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700257 struct {
258 uint32_t dif_chk_ref_tag;
259 uint16_t dif_chk_app_tag_mask;
260 uint16_t dif_chk_app_tag;
261 };
262 struct {
263 uint64_t dif_ins_res;
264 uint32_t dif_ins_ref_tag;
265 uint16_t dif_ins_app_tag_mask;
266 uint16_t dif_ins_app_tag;
267 };
268 struct {
269 uint32_t dif_upd_src_ref_tag;
270 uint16_t dif_upd_src_app_tag_mask;
271 uint16_t dif_upd_src_app_tag;
272 uint32_t dif_upd_dest_ref_tag;
273 uint16_t dif_upd_dest_app_tag_mask;
274 uint16_t dif_upd_dest_app_tag;
275 };
276 uint8_t op_specific[16];
277 };
278} __attribute__((packed));
279struct dsa_raw_completion_record {
280 uint64_t field[4];
281} __attribute__((packed));
Christopher Ferris05667cd2021-02-16 16:01:34 -0800282struct iax_completion_record {
283 volatile uint8_t status;
284 uint8_t error_code;
285 uint16_t rsvd;
286 uint32_t bytes_completed;
287 uint64_t fault_addr;
288 uint32_t invalid_flags;
289 uint32_t rsvd2;
290 uint32_t output_size;
291 uint8_t output_bits;
292 uint8_t rsvd3;
293 uint16_t rsvd4;
294 uint64_t rsvd5[4];
295} __attribute__((packed));
296struct iax_raw_completion_record {
297 uint64_t field[8];
298} __attribute__((packed));
Christopher Ferrisbb9fcb42020-04-06 11:38:04 -0700299#endif