genwqe_card.h revision 38062f954c637861348dd8078cefb73554e6f12c
1/****************************************************************************
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 __GENWQE_CARD_H__
20#define __GENWQE_CARD_H__
21#include <linux/types.h>
22#include <linux/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define GENWQE_DEVNAME "genwqe"
25#define GENWQE_TYPE_ALTERA_230 0x00
26#define GENWQE_TYPE_ALTERA_530 0x01
27#define GENWQE_TYPE_ALTERA_A4 0x02
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define GENWQE_TYPE_ALTERA_A7 0x03
30#define GENWQE_UID_OFFS(uid) ((uid) << 24)
31#define GENWQE_SLU_OFFS GENWQE_UID_OFFS(0)
32#define GENWQE_HSU_OFFS GENWQE_UID_OFFS(1)
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define GENWQE_APP_OFFS GENWQE_UID_OFFS(2)
35#define GENWQE_MAX_UNITS 3
36#define IO_EXTENDED_ERROR_POINTER 0x00000048
37#define IO_ERROR_INJECT_SELECTOR 0x00000060
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define IO_EXTENDED_DIAG_SELECTOR 0x00000070
40#define IO_EXTENDED_DIAG_READ_MBX 0x00000078
41#define IO_EXTENDED_DIAG_MAP(ring) (0x00000500 | ((ring) << 3))
42#define GENWQE_EXTENDED_DIAG_SELECTOR(ring, trace) (((ring) << 8) | (trace))
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define IO_SLU_UNITCFG 0x00000000
45#define IO_SLU_UNITCFG_TYPE_MASK 0x000000000ff00000
46#define IO_SLU_FIR 0x00000008
47#define IO_SLU_FIR_CLR 0x00000010
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define IO_SLU_FEC 0x00000018
50#define IO_SLU_ERR_ACT_MASK 0x00000020
51#define IO_SLU_ERR_ATTN_MASK 0x00000028
52#define IO_SLU_FIRX1_ACT_MASK 0x00000030
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define IO_SLU_FIRX0_ACT_MASK 0x00000038
55#define IO_SLU_SEC_LEM_DEBUG_OVR 0x00000040
56#define IO_SLU_EXTENDED_ERR_PTR 0x00000048
57#define IO_SLU_COMMON_CONFIG 0x00000060
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define IO_SLU_FLASH_FIR 0x00000108
60#define IO_SLU_SLC_FIR 0x00000110
61#define IO_SLU_RIU_TRAP 0x00000280
62#define IO_SLU_FLASH_FEC 0x00000308
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define IO_SLU_SLC_FEC 0x00000310
65#define IO_SLC_QUEUE_SEGMENT 0x00010000
66#define IO_SLC_VF_QUEUE_SEGMENT 0x00050000
67#define IO_SLC_QUEUE_OFFSET 0x00010008
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define IO_SLC_VF_QUEUE_OFFSET 0x00050008
70#define IO_SLC_QUEUE_CONFIG 0x00010010
71#define IO_SLC_VF_QUEUE_CONFIG 0x00050010
72#define IO_SLC_APPJOB_TIMEOUT 0x00010018
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define IO_SLC_VF_APPJOB_TIMEOUT 0x00050018
75#define TIMEOUT_250MS 0x0000000f
76#define HEARTBEAT_DISABLE 0x0000ff00
77#define IO_SLC_QUEUE_INITSQN 0x00010020
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define IO_SLC_VF_QUEUE_INITSQN 0x00050020
80#define IO_SLC_QUEUE_WRAP 0x00010028
81#define IO_SLC_VF_QUEUE_WRAP 0x00050028
82#define IO_SLC_QUEUE_STATUS 0x00010100
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84#define IO_SLC_VF_QUEUE_STATUS 0x00050100
85#define IO_SLC_QUEUE_WTIME 0x00010030
86#define IO_SLC_VF_QUEUE_WTIME 0x00050030
87#define IO_SLC_QUEUE_ERRCNTS 0x00010038
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#define IO_SLC_VF_QUEUE_ERRCNTS 0x00050038
90#define IO_SLC_QUEUE_LRW 0x00010040
91#define IO_SLC_VF_QUEUE_LRW 0x00050040
92#define IO_SLC_FREE_RUNNING_TIMER 0x00010108
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94#define IO_SLC_VF_FREE_RUNNING_TIMER 0x00050108
95#define IO_PF_SLC_VIRTUAL_REGION 0x00050000
96#define IO_PF_SLC_VIRTUAL_WINDOW 0x00060000
97#define IO_PF_SLC_JOBPEND(n) (0x00061000 + 8*(n))
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99#define IO_SLC_JOBPEND(n) IO_PF_SLC_JOBPEND(n)
100#define IO_SLU_SLC_PARSE_TRAP(n) (0x00011000 + 8*(n))
101#define IO_SLU_SLC_DISP_TRAP(n) (0x00011200 + 8*(n))
102#define IO_SLC_CFGREG_GFIR 0x00020000
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104#define GFIR_ERR_TRIGGER 0x0000ffff
105#define IO_SLC_CFGREG_SOFTRESET 0x00020018
106#define IO_SLC_MISC_DEBUG 0x00020060
107#define IO_SLC_MISC_DEBUG_CLR 0x00020068
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109#define IO_SLC_MISC_DEBUG_SET 0x00020070
110#define IO_SLU_TEMPERATURE_SENSOR 0x00030000
111#define IO_SLU_TEMPERATURE_CONFIG 0x00030008
112#define IO_SLU_VOLTAGE_CONTROL 0x00030080
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#define IO_SLU_VOLTAGE_NOMINAL 0x00000000
115#define IO_SLU_VOLTAGE_DOWN5 0x00000006
116#define IO_SLU_VOLTAGE_UP5 0x00000007
117#define IO_SLU_LEDCONTROL 0x00030100
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define IO_SLU_FLASH_DIRECTACCESS 0x00040010
120#define IO_SLU_FLASH_DIRECTACCESS2 0x00040020
121#define IO_SLU_FLASH_CMDINTF 0x00040030
122#define IO_SLU_BITSTREAM 0x00040040
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#define IO_HSU_ERR_BEHAVIOR 0x01001010
125#define IO_SLC2_SQB_TRAP 0x00062000
126#define IO_SLC2_QUEUE_MANAGER_TRAP 0x00062008
127#define IO_SLC2_FLS_MASTER_TRAP 0x00062010
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129#define IO_HSU_UNITCFG 0x01000000
130#define IO_HSU_FIR 0x01000008
131#define IO_HSU_FIR_CLR 0x01000010
132#define IO_HSU_FEC 0x01000018
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134#define IO_HSU_ERR_ACT_MASK 0x01000020
135#define IO_HSU_ERR_ATTN_MASK 0x01000028
136#define IO_HSU_FIRX1_ACT_MASK 0x01000030
137#define IO_HSU_FIRX0_ACT_MASK 0x01000038
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139#define IO_HSU_SEC_LEM_DEBUG_OVR 0x01000040
140#define IO_HSU_EXTENDED_ERR_PTR 0x01000048
141#define IO_HSU_COMMON_CONFIG 0x01000060
142#define IO_APP_UNITCFG 0x02000000
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144#define IO_APP_FIR 0x02000008
145#define IO_APP_FIR_CLR 0x02000010
146#define IO_APP_FEC 0x02000018
147#define IO_APP_ERR_ACT_MASK 0x02000020
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149#define IO_APP_ERR_ATTN_MASK 0x02000028
150#define IO_APP_FIRX1_ACT_MASK 0x02000030
151#define IO_APP_FIRX0_ACT_MASK 0x02000038
152#define IO_APP_SEC_LEM_DEBUG_OVR 0x02000040
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154#define IO_APP_EXTENDED_ERR_PTR 0x02000048
155#define IO_APP_COMMON_CONFIG 0x02000060
156#define IO_APP_DEBUG_REG_01 0x02010000
157#define IO_APP_DEBUG_REG_02 0x02010008
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159#define IO_APP_DEBUG_REG_03 0x02010010
160#define IO_APP_DEBUG_REG_04 0x02010018
161#define IO_APP_DEBUG_REG_05 0x02010020
162#define IO_APP_DEBUG_REG_06 0x02010028
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164#define IO_APP_DEBUG_REG_07 0x02010030
165#define IO_APP_DEBUG_REG_08 0x02010038
166#define IO_APP_DEBUG_REG_09 0x02010040
167#define IO_APP_DEBUG_REG_10 0x02010048
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169#define IO_APP_DEBUG_REG_11 0x02010050
170#define IO_APP_DEBUG_REG_12 0x02010058
171#define IO_APP_DEBUG_REG_13 0x02010060
172#define IO_APP_DEBUG_REG_14 0x02010068
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174#define IO_APP_DEBUG_REG_15 0x02010070
175#define IO_APP_DEBUG_REG_16 0x02010078
176#define IO_APP_DEBUG_REG_17 0x02010080
177#define IO_APP_DEBUG_REG_18 0x02010088
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179struct genwqe_reg_io {
180 __u64 num;
181 __u64 val64;
182};
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184#define IO_ILLEGAL_VALUE 0xffffffffffffffffull
185#define DDCB_ACFUNC_SLU 0x00
186#define DDCB_ACFUNC_APP 0x01
187#define DDCB_RETC_IDLE 0x0000
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189#define DDCB_RETC_PENDING 0x0101
190#define DDCB_RETC_COMPLETE 0x0102
191#define DDCB_RETC_FAULT 0x0104
192#define DDCB_RETC_ERROR 0x0108
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194#define DDCB_RETC_FORCED_ERROR 0x01ff
195#define DDCB_RETC_UNEXEC 0x0110
196#define DDCB_RETC_TERM 0x0120
197#define DDCB_RETC_RES0 0x0140
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199#define DDCB_RETC_RES1 0x0180
200#define DDCB_OPT_ECHO_FORCE_NO 0x0000
201#define DDCB_OPT_ECHO_FORCE_102 0x0001
202#define DDCB_OPT_ECHO_FORCE_104 0x0002
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204#define DDCB_OPT_ECHO_FORCE_108 0x0003
205#define DDCB_OPT_ECHO_FORCE_110 0x0004
206#define DDCB_OPT_ECHO_FORCE_120 0x0005
207#define DDCB_OPT_ECHO_FORCE_140 0x0006
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209#define DDCB_OPT_ECHO_FORCE_180 0x0007
210#define DDCB_OPT_ECHO_COPY_NONE (0 << 5)
211#define DDCB_OPT_ECHO_COPY_ALL (1 << 5)
212#define SLCMD_ECHO_SYNC 0x00
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214#define SLCMD_MOVE_FLASH 0x06
215#define SLCMD_MOVE_FLASH_FLAGS_MODE 0x03
216#define SLCMD_MOVE_FLASH_FLAGS_DLOAD 0
217#define SLCMD_MOVE_FLASH_FLAGS_EMUL 1
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219#define SLCMD_MOVE_FLASH_FLAGS_UPLOAD 2
220#define SLCMD_MOVE_FLASH_FLAGS_VERIFY 3
221#define SLCMD_MOVE_FLASH_FLAG_NOTAP (1 << 2)
222#define SLCMD_MOVE_FLASH_FLAG_POLL (1 << 3)
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224#define SLCMD_MOVE_FLASH_FLAG_PARTITION (1 << 4)
225#define SLCMD_MOVE_FLASH_FLAG_ERASE (1 << 5)
226enum genwqe_card_state {
227 GENWQE_CARD_UNUSED = 0,
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 GENWQE_CARD_USED = 1,
230 GENWQE_CARD_FATAL_ERROR = 2,
231 GENWQE_CARD_STATE_MAX,
232};
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234struct genwqe_bitstream {
235 __u64 data_addr;
236 __u32 size;
237 __u32 crc;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 __u64 target_addr;
240 __u32 partition;
241 __u32 uid;
242 __u64 slu_id;
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 __u64 app_id;
245 __u16 retc;
246 __u16 attn;
247 __u32 progress;
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249};
250#define DDCB_LENGTH 256
251#define DDCB_ASIV_LENGTH 104
252#define DDCB_ASIV_LENGTH_ATS 96
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254#define DDCB_ASV_LENGTH 64
255#define DDCB_FIXUPS 12
256struct genwqe_debug_data {
257 char driver_version[64];
258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 __u64 slu_unitcfg;
260 __u64 app_unitcfg;
261 __u8 ddcb_before[DDCB_LENGTH];
262 __u8 ddcb_prev[DDCB_LENGTH];
263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 __u8 ddcb_finished[DDCB_LENGTH];
265};
266#define ATS_TYPE_DATA 0x0ull
267#define ATS_TYPE_FLAT_RD 0x4ull
268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269#define ATS_TYPE_FLAT_RDWR 0x5ull
270#define ATS_TYPE_SGL_RD 0x6ull
271#define ATS_TYPE_SGL_RDWR 0x7ull
272#define ATS_SET_FLAGS(_struct, _field, _flags)   (((_flags) & 0xf) << (44 - (4 * (offsetof(_struct, _field) / 8))))
273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274#define ATS_GET_FLAGS(_ats, _byte_offs)   (((_ats) >> (44 - (4 * ((_byte_offs) / 8)))) & 0xf)
275struct genwqe_ddcb_cmd {
276 __u64 next_addr;
277 __u64 flags;
278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279 __u8 acfunc;
280 __u8 cmd;
281 __u8 asiv_length;
282 __u8 asv_length;
283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284 __u16 cmdopts;
285 __u16 retc;
286 __u16 attn;
287 __u16 vcrc;
288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 __u32 progress;
290 __u64 deque_ts;
291 __u64 cmplt_ts;
292 __u64 disp_ts;
293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 __u64 ddata_addr;
295 __u8 asv[DDCB_ASV_LENGTH];
296 union {
297 struct {
298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 __u64 ats;
300 __u8 asiv[DDCB_ASIV_LENGTH_ATS];
301 };
302 __u8 __asiv[DDCB_ASIV_LENGTH];
303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 };
305};
306#define GENWQE_IOC_CODE 0xa5
307#define GENWQE_READ_REG64 _IOR(GENWQE_IOC_CODE, 30, struct genwqe_reg_io)
308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309#define GENWQE_WRITE_REG64 _IOW(GENWQE_IOC_CODE, 31, struct genwqe_reg_io)
310#define GENWQE_READ_REG32 _IOR(GENWQE_IOC_CODE, 32, struct genwqe_reg_io)
311#define GENWQE_WRITE_REG32 _IOW(GENWQE_IOC_CODE, 33, struct genwqe_reg_io)
312#define GENWQE_READ_REG16 _IOR(GENWQE_IOC_CODE, 34, struct genwqe_reg_io)
313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314#define GENWQE_WRITE_REG16 _IOW(GENWQE_IOC_CODE, 35, struct genwqe_reg_io)
315#define GENWQE_GET_CARD_STATE _IOR(GENWQE_IOC_CODE, 36, enum genwqe_card_state)
316struct genwqe_mem {
317 __u64 addr;
318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319 __u64 size;
320 __u64 direction;
321 __u64 flags;
322};
323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324#define GENWQE_PIN_MEM _IOWR(GENWQE_IOC_CODE, 40, struct genwqe_mem)
325#define GENWQE_UNPIN_MEM _IOWR(GENWQE_IOC_CODE, 41, struct genwqe_mem)
326#define GENWQE_EXECUTE_DDCB   _IOWR(GENWQE_IOC_CODE, 50, struct genwqe_ddcb_cmd)
327#define GENWQE_EXECUTE_RAW_DDCB   _IOWR(GENWQE_IOC_CODE, 51, struct genwqe_ddcb_cmd)
328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329#define GENWQE_SLU_UPDATE _IOWR(GENWQE_IOC_CODE, 80, struct genwqe_bitstream)
330#define GENWQE_SLU_READ _IOWR(GENWQE_IOC_CODE, 81, struct genwqe_bitstream)
331#endif
332