• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * CAAM descriptor composition header
4  * Definitions to support CAAM descriptor instruction generation
5  *
6  * Copyright 2008-2011 Freescale Semiconductor, Inc.
7  * Copyright 2018 NXP
8  */
9 
10 #ifndef DESC_H
11 #define DESC_H
12 
13 /*
14  * 16-byte hardware scatter/gather table
15  * An 8-byte table exists in the hardware spec, but has never been
16  * implemented to date. The 8/16 option is selected at RTL-compile-time.
17  * and this selection is visible in the Compile Time Parameters Register
18  */
19 
20 #define SEC4_SG_LEN_EXT		0x80000000	/* Entry points to table */
21 #define SEC4_SG_LEN_FIN		0x40000000	/* Last entry in table */
22 #define SEC4_SG_BPID_MASK	0x000000ff
23 #define SEC4_SG_BPID_SHIFT	16
24 #define SEC4_SG_LEN_MASK	0x3fffffff	/* Excludes EXT and FINAL */
25 #define SEC4_SG_OFFSET_MASK	0x00001fff
26 
27 /* Max size of any CAAM descriptor in 32-bit words, inclusive of header */
28 #define MAX_CAAM_DESCSIZE	64
29 
30 /* Block size of any entity covered/uncovered with a KEK/TKEK */
31 #define KEK_BLOCKSIZE		16
32 
33 /*
34  * Supported descriptor command types as they show up
35  * inside a descriptor command word.
36  */
37 #define CMD_SHIFT		27
38 #define CMD_MASK		0xf8000000
39 
40 #define CMD_KEY			(0x00 << CMD_SHIFT)
41 #define CMD_SEQ_KEY		(0x01 << CMD_SHIFT)
42 #define CMD_LOAD		(0x02 << CMD_SHIFT)
43 #define CMD_SEQ_LOAD		(0x03 << CMD_SHIFT)
44 #define CMD_FIFO_LOAD		(0x04 << CMD_SHIFT)
45 #define CMD_SEQ_FIFO_LOAD	(0x05 << CMD_SHIFT)
46 #define CMD_STORE		(0x0a << CMD_SHIFT)
47 #define CMD_SEQ_STORE		(0x0b << CMD_SHIFT)
48 #define CMD_FIFO_STORE		(0x0c << CMD_SHIFT)
49 #define CMD_SEQ_FIFO_STORE	(0x0d << CMD_SHIFT)
50 #define CMD_MOVE_LEN		(0x0e << CMD_SHIFT)
51 #define CMD_MOVE		(0x0f << CMD_SHIFT)
52 #define CMD_OPERATION		(0x10 << CMD_SHIFT)
53 #define CMD_SIGNATURE		(0x12 << CMD_SHIFT)
54 #define CMD_JUMP		(0x14 << CMD_SHIFT)
55 #define CMD_MATH		(0x15 << CMD_SHIFT)
56 #define CMD_DESC_HDR		(0x16 << CMD_SHIFT)
57 #define CMD_SHARED_DESC_HDR	(0x17 << CMD_SHIFT)
58 #define CMD_SEQ_IN_PTR		(0x1e << CMD_SHIFT)
59 #define CMD_SEQ_OUT_PTR		(0x1f << CMD_SHIFT)
60 
61 /* General-purpose class selector for all commands */
62 #define CLASS_SHIFT		25
63 #define CLASS_MASK		(0x03 << CLASS_SHIFT)
64 
65 #define CLASS_NONE		(0x00 << CLASS_SHIFT)
66 #define CLASS_1			(0x01 << CLASS_SHIFT)
67 #define CLASS_2			(0x02 << CLASS_SHIFT)
68 #define CLASS_BOTH		(0x03 << CLASS_SHIFT)
69 
70 /*
71  * Descriptor header command constructs
72  * Covers shared, job, and trusted descriptor headers
73  */
74 
75 /*
76  * Do Not Run - marks a descriptor inexecutable if there was
77  * a preceding error somewhere
78  */
79 #define HDR_DNR			0x01000000
80 
81 /*
82  * ONE - should always be set. Combination of ONE (always
83  * set) and ZRO (always clear) forms an endianness sanity check
84  */
85 #define HDR_ONE			0x00800000
86 #define HDR_ZRO			0x00008000
87 
88 /* Start Index or SharedDesc Length */
89 #define HDR_START_IDX_SHIFT	16
90 #define HDR_START_IDX_MASK	(0x3f << HDR_START_IDX_SHIFT)
91 
92 /* If shared descriptor header, 6-bit length */
93 #define HDR_DESCLEN_SHR_MASK	0x3f
94 
95 /* If non-shared header, 7-bit length */
96 #define HDR_DESCLEN_MASK	0x7f
97 
98 /* This is a TrustedDesc (if not SharedDesc) */
99 #define HDR_TRUSTED		0x00004000
100 
101 /* Make into TrustedDesc (if not SharedDesc) */
102 #define HDR_MAKE_TRUSTED	0x00002000
103 
104 /* Save context if self-shared (if SharedDesc) */
105 #define HDR_SAVECTX		0x00001000
106 
107 /* Next item points to SharedDesc */
108 #define HDR_SHARED		0x00001000
109 
110 /*
111  * Reverse Execution Order - execute JobDesc first, then
112  * execute SharedDesc (normally SharedDesc goes first).
113  */
114 #define HDR_REVERSE		0x00000800
115 
116 /* Propagate DNR property to SharedDesc */
117 #define HDR_PROP_DNR		0x00000800
118 
119 /* JobDesc/SharedDesc share property */
120 #define HDR_SD_SHARE_SHIFT	8
121 #define HDR_SD_SHARE_MASK	(0x03 << HDR_SD_SHARE_SHIFT)
122 #define HDR_JD_SHARE_SHIFT	8
123 #define HDR_JD_SHARE_MASK	(0x07 << HDR_JD_SHARE_SHIFT)
124 
125 #define HDR_SHARE_NEVER		(0x00 << HDR_SD_SHARE_SHIFT)
126 #define HDR_SHARE_WAIT		(0x01 << HDR_SD_SHARE_SHIFT)
127 #define HDR_SHARE_SERIAL	(0x02 << HDR_SD_SHARE_SHIFT)
128 #define HDR_SHARE_ALWAYS	(0x03 << HDR_SD_SHARE_SHIFT)
129 #define HDR_SHARE_DEFER		(0x04 << HDR_SD_SHARE_SHIFT)
130 
131 /* JobDesc/SharedDesc descriptor length */
132 #define HDR_JD_LENGTH_MASK	0x7f
133 #define HDR_SD_LENGTH_MASK	0x3f
134 
135 /*
136  * KEY/SEQ_KEY Command Constructs
137  */
138 
139 /* Key Destination Class: 01 = Class 1, 02 - Class 2 */
140 #define KEY_DEST_CLASS_SHIFT	25	/* use CLASS_1 or CLASS_2 */
141 #define KEY_DEST_CLASS_MASK	(0x03 << KEY_DEST_CLASS_SHIFT)
142 
143 /* Scatter-Gather Table/Variable Length Field */
144 #define KEY_SGF			0x01000000
145 #define KEY_VLF			0x01000000
146 
147 /* Immediate - Key follows command in the descriptor */
148 #define KEY_IMM			0x00800000
149 
150 /*
151  * Encrypted - Key is encrypted either with the KEK, or
152  * with the TDKEK if TK is set
153  */
154 #define KEY_ENC			0x00400000
155 
156 /*
157  * No Write Back - Do not allow key to be FIFO STOREd
158  */
159 #define KEY_NWB			0x00200000
160 
161 /*
162  * Enhanced Encryption of Key
163  */
164 #define KEY_EKT			0x00100000
165 
166 /*
167  * Encrypted with Trusted Key
168  */
169 #define KEY_TK			0x00008000
170 
171 /*
172  * KDEST - Key Destination: 0 - class key register,
173  * 1 - PKHA 'e', 2 - AFHA Sbox, 3 - MDHA split-key
174  */
175 #define KEY_DEST_SHIFT		16
176 #define KEY_DEST_MASK		(0x03 << KEY_DEST_SHIFT)
177 
178 #define KEY_DEST_CLASS_REG	(0x00 << KEY_DEST_SHIFT)
179 #define KEY_DEST_PKHA_E		(0x01 << KEY_DEST_SHIFT)
180 #define KEY_DEST_AFHA_SBOX	(0x02 << KEY_DEST_SHIFT)
181 #define KEY_DEST_MDHA_SPLIT	(0x03 << KEY_DEST_SHIFT)
182 
183 /* Length in bytes */
184 #define KEY_LENGTH_MASK		0x000003ff
185 
186 /*
187  * LOAD/SEQ_LOAD/STORE/SEQ_STORE Command Constructs
188  */
189 
190 /*
191  * Load/Store Destination: 0 = class independent CCB,
192  * 1 = class 1 CCB, 2 = class 2 CCB, 3 = DECO
193  */
194 #define LDST_CLASS_SHIFT	25
195 #define LDST_CLASS_MASK		(0x03 << LDST_CLASS_SHIFT)
196 #define LDST_CLASS_IND_CCB	(0x00 << LDST_CLASS_SHIFT)
197 #define LDST_CLASS_1_CCB	(0x01 << LDST_CLASS_SHIFT)
198 #define LDST_CLASS_2_CCB	(0x02 << LDST_CLASS_SHIFT)
199 #define LDST_CLASS_DECO		(0x03 << LDST_CLASS_SHIFT)
200 
201 /* Scatter-Gather Table/Variable Length Field */
202 #define LDST_SGF		0x01000000
203 #define LDST_VLF		LDST_SGF
204 
205 /* Immediate - Key follows this command in descriptor */
206 #define LDST_IMM_MASK		1
207 #define LDST_IMM_SHIFT		23
208 #define LDST_IMM		(LDST_IMM_MASK << LDST_IMM_SHIFT)
209 
210 /* SRC/DST - Destination for LOAD, Source for STORE */
211 #define LDST_SRCDST_SHIFT	16
212 #define LDST_SRCDST_MASK	(0x7f << LDST_SRCDST_SHIFT)
213 
214 #define LDST_SRCDST_BYTE_CONTEXT	(0x20 << LDST_SRCDST_SHIFT)
215 #define LDST_SRCDST_BYTE_KEY		(0x40 << LDST_SRCDST_SHIFT)
216 #define LDST_SRCDST_BYTE_INFIFO		(0x7c << LDST_SRCDST_SHIFT)
217 #define LDST_SRCDST_BYTE_OUTFIFO	(0x7e << LDST_SRCDST_SHIFT)
218 
219 #define LDST_SRCDST_WORD_MODE_REG	(0x00 << LDST_SRCDST_SHIFT)
220 #define LDST_SRCDST_WORD_KEYSZ_REG	(0x01 << LDST_SRCDST_SHIFT)
221 #define LDST_SRCDST_WORD_DATASZ_REG	(0x02 << LDST_SRCDST_SHIFT)
222 #define LDST_SRCDST_WORD_ICVSZ_REG	(0x03 << LDST_SRCDST_SHIFT)
223 #define LDST_SRCDST_WORD_CHACTRL	(0x06 << LDST_SRCDST_SHIFT)
224 #define LDST_SRCDST_WORD_DECOCTRL	(0x06 << LDST_SRCDST_SHIFT)
225 #define LDST_SRCDST_WORD_IRQCTRL	(0x07 << LDST_SRCDST_SHIFT)
226 #define LDST_SRCDST_WORD_DECO_PCLOVRD	(0x07 << LDST_SRCDST_SHIFT)
227 #define LDST_SRCDST_WORD_CLRW		(0x08 << LDST_SRCDST_SHIFT)
228 #define LDST_SRCDST_WORD_DECO_MATH0	(0x08 << LDST_SRCDST_SHIFT)
229 #define LDST_SRCDST_WORD_STAT		(0x09 << LDST_SRCDST_SHIFT)
230 #define LDST_SRCDST_WORD_DECO_MATH1	(0x09 << LDST_SRCDST_SHIFT)
231 #define LDST_SRCDST_WORD_DECO_MATH2	(0x0a << LDST_SRCDST_SHIFT)
232 #define LDST_SRCDST_WORD_DECO_AAD_SZ	(0x0b << LDST_SRCDST_SHIFT)
233 #define LDST_SRCDST_WORD_DECO_MATH3	(0x0b << LDST_SRCDST_SHIFT)
234 #define LDST_SRCDST_WORD_CLASS1_IV_SZ	(0x0c << LDST_SRCDST_SHIFT)
235 #define LDST_SRCDST_WORD_ALTDS_CLASS1	(0x0f << LDST_SRCDST_SHIFT)
236 #define LDST_SRCDST_WORD_PKHA_A_SZ	(0x10 << LDST_SRCDST_SHIFT)
237 #define LDST_SRCDST_WORD_PKHA_B_SZ	(0x11 << LDST_SRCDST_SHIFT)
238 #define LDST_SRCDST_WORD_PKHA_N_SZ	(0x12 << LDST_SRCDST_SHIFT)
239 #define LDST_SRCDST_WORD_PKHA_E_SZ	(0x13 << LDST_SRCDST_SHIFT)
240 #define LDST_SRCDST_WORD_CLASS_CTX	(0x20 << LDST_SRCDST_SHIFT)
241 #define LDST_SRCDST_WORD_DESCBUF	(0x40 << LDST_SRCDST_SHIFT)
242 #define LDST_SRCDST_WORD_DESCBUF_JOB	(0x41 << LDST_SRCDST_SHIFT)
243 #define LDST_SRCDST_WORD_DESCBUF_SHARED	(0x42 << LDST_SRCDST_SHIFT)
244 #define LDST_SRCDST_WORD_DESCBUF_JOB_WE	(0x45 << LDST_SRCDST_SHIFT)
245 #define LDST_SRCDST_WORD_DESCBUF_SHARED_WE (0x46 << LDST_SRCDST_SHIFT)
246 #define LDST_SRCDST_WORD_INFO_FIFO_SM	(0x71 << LDST_SRCDST_SHIFT)
247 #define LDST_SRCDST_WORD_INFO_FIFO	(0x7a << LDST_SRCDST_SHIFT)
248 
249 /* Offset in source/destination */
250 #define LDST_OFFSET_SHIFT	8
251 #define LDST_OFFSET_MASK	(0xff << LDST_OFFSET_SHIFT)
252 
253 /* LDOFF definitions used when DST = LDST_SRCDST_WORD_DECOCTRL */
254 /* These could also be shifted by LDST_OFFSET_SHIFT - this reads better */
255 #define LDOFF_CHG_SHARE_SHIFT		0
256 #define LDOFF_CHG_SHARE_MASK		(0x3 << LDOFF_CHG_SHARE_SHIFT)
257 #define LDOFF_CHG_SHARE_NEVER		(0x1 << LDOFF_CHG_SHARE_SHIFT)
258 #define LDOFF_CHG_SHARE_OK_PROP		(0x2 << LDOFF_CHG_SHARE_SHIFT)
259 #define LDOFF_CHG_SHARE_OK_NO_PROP	(0x3 << LDOFF_CHG_SHARE_SHIFT)
260 
261 #define LDOFF_ENABLE_AUTO_NFIFO		(1 << 2)
262 #define LDOFF_DISABLE_AUTO_NFIFO	(1 << 3)
263 
264 #define LDOFF_CHG_NONSEQLIODN_SHIFT	4
265 #define LDOFF_CHG_NONSEQLIODN_MASK	(0x3 << LDOFF_CHG_NONSEQLIODN_SHIFT)
266 #define LDOFF_CHG_NONSEQLIODN_SEQ	(0x1 << LDOFF_CHG_NONSEQLIODN_SHIFT)
267 #define LDOFF_CHG_NONSEQLIODN_NON_SEQ	(0x2 << LDOFF_CHG_NONSEQLIODN_SHIFT)
268 #define LDOFF_CHG_NONSEQLIODN_TRUSTED	(0x3 << LDOFF_CHG_NONSEQLIODN_SHIFT)
269 
270 #define LDOFF_CHG_SEQLIODN_SHIFT	6
271 #define LDOFF_CHG_SEQLIODN_MASK		(0x3 << LDOFF_CHG_SEQLIODN_SHIFT)
272 #define LDOFF_CHG_SEQLIODN_SEQ		(0x1 << LDOFF_CHG_SEQLIODN_SHIFT)
273 #define LDOFF_CHG_SEQLIODN_NON_SEQ	(0x2 << LDOFF_CHG_SEQLIODN_SHIFT)
274 #define LDOFF_CHG_SEQLIODN_TRUSTED	(0x3 << LDOFF_CHG_SEQLIODN_SHIFT)
275 
276 /* Data length in bytes	*/
277 #define LDST_LEN_SHIFT		0
278 #define LDST_LEN_MASK		(0xff << LDST_LEN_SHIFT)
279 
280 /* Special Length definitions when dst=deco-ctrl */
281 #define LDLEN_ENABLE_OSL_COUNT		(1 << 7)
282 #define LDLEN_RST_CHA_OFIFO_PTR		(1 << 6)
283 #define LDLEN_RST_OFIFO			(1 << 5)
284 #define LDLEN_SET_OFIFO_OFF_VALID	(1 << 4)
285 #define LDLEN_SET_OFIFO_OFF_RSVD	(1 << 3)
286 #define LDLEN_SET_OFIFO_OFFSET_SHIFT	0
287 #define LDLEN_SET_OFIFO_OFFSET_MASK	(3 << LDLEN_SET_OFIFO_OFFSET_SHIFT)
288 
289 /* Special Length definitions when dst=sm, nfifo-{sm,m} */
290 #define LDLEN_MATH0			0
291 #define LDLEN_MATH1			1
292 #define LDLEN_MATH2			2
293 #define LDLEN_MATH3			3
294 
295 /*
296  * FIFO_LOAD/FIFO_STORE/SEQ_FIFO_LOAD/SEQ_FIFO_STORE
297  * Command Constructs
298  */
299 
300 /*
301  * Load Destination: 0 = skip (SEQ_FIFO_LOAD only),
302  * 1 = Load for Class1, 2 = Load for Class2, 3 = Load both
303  * Store Source: 0 = normal, 1 = Class1key, 2 = Class2key
304  */
305 #define FIFOLD_CLASS_SHIFT	25
306 #define FIFOLD_CLASS_MASK	(0x03 << FIFOLD_CLASS_SHIFT)
307 #define FIFOLD_CLASS_SKIP	(0x00 << FIFOLD_CLASS_SHIFT)
308 #define FIFOLD_CLASS_CLASS1	(0x01 << FIFOLD_CLASS_SHIFT)
309 #define FIFOLD_CLASS_CLASS2	(0x02 << FIFOLD_CLASS_SHIFT)
310 #define FIFOLD_CLASS_BOTH	(0x03 << FIFOLD_CLASS_SHIFT)
311 
312 #define FIFOST_CLASS_SHIFT	25
313 #define FIFOST_CLASS_MASK	(0x03 << FIFOST_CLASS_SHIFT)
314 #define FIFOST_CLASS_NORMAL	(0x00 << FIFOST_CLASS_SHIFT)
315 #define FIFOST_CLASS_CLASS1KEY	(0x01 << FIFOST_CLASS_SHIFT)
316 #define FIFOST_CLASS_CLASS2KEY	(0x02 << FIFOST_CLASS_SHIFT)
317 
318 /*
319  * Scatter-Gather Table/Variable Length Field
320  * If set for FIFO_LOAD, refers to a SG table. Within
321  * SEQ_FIFO_LOAD, is variable input sequence
322  */
323 #define FIFOLDST_SGF_SHIFT	24
324 #define FIFOLDST_SGF_MASK	(1 << FIFOLDST_SGF_SHIFT)
325 #define FIFOLDST_VLF_MASK	(1 << FIFOLDST_SGF_SHIFT)
326 #define FIFOLDST_SGF		(1 << FIFOLDST_SGF_SHIFT)
327 #define FIFOLDST_VLF		(1 << FIFOLDST_SGF_SHIFT)
328 
329 /* Immediate - Data follows command in descriptor */
330 #define FIFOLD_IMM_SHIFT	23
331 #define FIFOLD_IMM_MASK		(1 << FIFOLD_IMM_SHIFT)
332 #define FIFOLD_IMM		(1 << FIFOLD_IMM_SHIFT)
333 
334 /* Continue - Not the last FIFO store to come */
335 #define FIFOST_CONT_SHIFT	23
336 #define FIFOST_CONT_MASK	(1 << FIFOST_CONT_SHIFT)
337 
338 /*
339  * Extended Length - use 32-bit extended length that
340  * follows the pointer field. Illegal with IMM set
341  */
342 #define FIFOLDST_EXT_SHIFT	22
343 #define FIFOLDST_EXT_MASK	(1 << FIFOLDST_EXT_SHIFT)
344 #define FIFOLDST_EXT		(1 << FIFOLDST_EXT_SHIFT)
345 
346 /* Input data type.*/
347 #define FIFOLD_TYPE_SHIFT	16
348 #define FIFOLD_CONT_TYPE_SHIFT	19 /* shift past last-flush bits */
349 #define FIFOLD_TYPE_MASK	(0x3f << FIFOLD_TYPE_SHIFT)
350 
351 /* PK types */
352 #define FIFOLD_TYPE_PK		(0x00 << FIFOLD_TYPE_SHIFT)
353 #define FIFOLD_TYPE_PK_MASK	(0x30 << FIFOLD_TYPE_SHIFT)
354 #define FIFOLD_TYPE_PK_TYPEMASK (0x0f << FIFOLD_TYPE_SHIFT)
355 #define FIFOLD_TYPE_PK_A0	(0x00 << FIFOLD_TYPE_SHIFT)
356 #define FIFOLD_TYPE_PK_A1	(0x01 << FIFOLD_TYPE_SHIFT)
357 #define FIFOLD_TYPE_PK_A2	(0x02 << FIFOLD_TYPE_SHIFT)
358 #define FIFOLD_TYPE_PK_A3	(0x03 << FIFOLD_TYPE_SHIFT)
359 #define FIFOLD_TYPE_PK_B0	(0x04 << FIFOLD_TYPE_SHIFT)
360 #define FIFOLD_TYPE_PK_B1	(0x05 << FIFOLD_TYPE_SHIFT)
361 #define FIFOLD_TYPE_PK_B2	(0x06 << FIFOLD_TYPE_SHIFT)
362 #define FIFOLD_TYPE_PK_B3	(0x07 << FIFOLD_TYPE_SHIFT)
363 #define FIFOLD_TYPE_PK_N	(0x08 << FIFOLD_TYPE_SHIFT)
364 #define FIFOLD_TYPE_PK_A	(0x0c << FIFOLD_TYPE_SHIFT)
365 #define FIFOLD_TYPE_PK_B	(0x0d << FIFOLD_TYPE_SHIFT)
366 
367 /* Other types. Need to OR in last/flush bits as desired */
368 #define FIFOLD_TYPE_MSG_MASK	(0x38 << FIFOLD_TYPE_SHIFT)
369 #define FIFOLD_TYPE_MSG		(0x10 << FIFOLD_TYPE_SHIFT)
370 #define FIFOLD_TYPE_MSG1OUT2	(0x18 << FIFOLD_TYPE_SHIFT)
371 #define FIFOLD_TYPE_IV		(0x20 << FIFOLD_TYPE_SHIFT)
372 #define FIFOLD_TYPE_BITDATA	(0x28 << FIFOLD_TYPE_SHIFT)
373 #define FIFOLD_TYPE_AAD		(0x30 << FIFOLD_TYPE_SHIFT)
374 #define FIFOLD_TYPE_ICV		(0x38 << FIFOLD_TYPE_SHIFT)
375 
376 /* Last/Flush bits for use with "other" types above */
377 #define FIFOLD_TYPE_ACT_MASK	(0x07 << FIFOLD_TYPE_SHIFT)
378 #define FIFOLD_TYPE_NOACTION	(0x00 << FIFOLD_TYPE_SHIFT)
379 #define FIFOLD_TYPE_FLUSH1	(0x01 << FIFOLD_TYPE_SHIFT)
380 #define FIFOLD_TYPE_LAST1	(0x02 << FIFOLD_TYPE_SHIFT)
381 #define FIFOLD_TYPE_LAST2FLUSH	(0x03 << FIFOLD_TYPE_SHIFT)
382 #define FIFOLD_TYPE_LAST2	(0x04 << FIFOLD_TYPE_SHIFT)
383 #define FIFOLD_TYPE_LAST2FLUSH1 (0x05 << FIFOLD_TYPE_SHIFT)
384 #define FIFOLD_TYPE_LASTBOTH	(0x06 << FIFOLD_TYPE_SHIFT)
385 #define FIFOLD_TYPE_LASTBOTHFL	(0x07 << FIFOLD_TYPE_SHIFT)
386 #define FIFOLD_TYPE_NOINFOFIFO	(0x0F << FIFOLD_TYPE_SHIFT)
387 
388 #define FIFOLDST_LEN_MASK	0xffff
389 #define FIFOLDST_EXT_LEN_MASK	0xffffffff
390 
391 /* Output data types */
392 #define FIFOST_TYPE_SHIFT	16
393 #define FIFOST_TYPE_MASK	(0x3f << FIFOST_TYPE_SHIFT)
394 
395 #define FIFOST_TYPE_PKHA_A0	 (0x00 << FIFOST_TYPE_SHIFT)
396 #define FIFOST_TYPE_PKHA_A1	 (0x01 << FIFOST_TYPE_SHIFT)
397 #define FIFOST_TYPE_PKHA_A2	 (0x02 << FIFOST_TYPE_SHIFT)
398 #define FIFOST_TYPE_PKHA_A3	 (0x03 << FIFOST_TYPE_SHIFT)
399 #define FIFOST_TYPE_PKHA_B0	 (0x04 << FIFOST_TYPE_SHIFT)
400 #define FIFOST_TYPE_PKHA_B1	 (0x05 << FIFOST_TYPE_SHIFT)
401 #define FIFOST_TYPE_PKHA_B2	 (0x06 << FIFOST_TYPE_SHIFT)
402 #define FIFOST_TYPE_PKHA_B3	 (0x07 << FIFOST_TYPE_SHIFT)
403 #define FIFOST_TYPE_PKHA_N	 (0x08 << FIFOST_TYPE_SHIFT)
404 #define FIFOST_TYPE_PKHA_A	 (0x0c << FIFOST_TYPE_SHIFT)
405 #define FIFOST_TYPE_PKHA_B	 (0x0d << FIFOST_TYPE_SHIFT)
406 #define FIFOST_TYPE_AF_SBOX_JKEK (0x20 << FIFOST_TYPE_SHIFT)
407 #define FIFOST_TYPE_AF_SBOX_TKEK (0x21 << FIFOST_TYPE_SHIFT)
408 #define FIFOST_TYPE_PKHA_E_JKEK	 (0x22 << FIFOST_TYPE_SHIFT)
409 #define FIFOST_TYPE_PKHA_E_TKEK	 (0x23 << FIFOST_TYPE_SHIFT)
410 #define FIFOST_TYPE_KEY_KEK	 (0x24 << FIFOST_TYPE_SHIFT)
411 #define FIFOST_TYPE_KEY_TKEK	 (0x25 << FIFOST_TYPE_SHIFT)
412 #define FIFOST_TYPE_SPLIT_KEK	 (0x26 << FIFOST_TYPE_SHIFT)
413 #define FIFOST_TYPE_SPLIT_TKEK	 (0x27 << FIFOST_TYPE_SHIFT)
414 #define FIFOST_TYPE_OUTFIFO_KEK	 (0x28 << FIFOST_TYPE_SHIFT)
415 #define FIFOST_TYPE_OUTFIFO_TKEK (0x29 << FIFOST_TYPE_SHIFT)
416 #define FIFOST_TYPE_MESSAGE_DATA (0x30 << FIFOST_TYPE_SHIFT)
417 #define FIFOST_TYPE_RNGSTORE	 (0x34 << FIFOST_TYPE_SHIFT)
418 #define FIFOST_TYPE_RNGFIFO	 (0x35 << FIFOST_TYPE_SHIFT)
419 #define FIFOST_TYPE_METADATA	 (0x3e << FIFOST_TYPE_SHIFT)
420 #define FIFOST_TYPE_SKIP	 (0x3f << FIFOST_TYPE_SHIFT)
421 
422 /*
423  * OPERATION Command Constructs
424  */
425 
426 /* Operation type selectors - OP TYPE */
427 #define OP_TYPE_SHIFT		24
428 #define OP_TYPE_MASK		(0x07 << OP_TYPE_SHIFT)
429 
430 #define OP_TYPE_UNI_PROTOCOL	(0x00 << OP_TYPE_SHIFT)
431 #define OP_TYPE_PK		(0x01 << OP_TYPE_SHIFT)
432 #define OP_TYPE_CLASS1_ALG	(0x02 << OP_TYPE_SHIFT)
433 #define OP_TYPE_CLASS2_ALG	(0x04 << OP_TYPE_SHIFT)
434 #define OP_TYPE_DECAP_PROTOCOL	(0x06 << OP_TYPE_SHIFT)
435 #define OP_TYPE_ENCAP_PROTOCOL	(0x07 << OP_TYPE_SHIFT)
436 
437 /* ProtocolID selectors - PROTID */
438 #define OP_PCLID_SHIFT		16
439 #define OP_PCLID_MASK		(0xff << 16)
440 
441 /* Assuming OP_TYPE = OP_TYPE_UNI_PROTOCOL */
442 #define OP_PCLID_IKEV1_PRF	(0x01 << OP_PCLID_SHIFT)
443 #define OP_PCLID_IKEV2_PRF	(0x02 << OP_PCLID_SHIFT)
444 #define OP_PCLID_SSL30_PRF	(0x08 << OP_PCLID_SHIFT)
445 #define OP_PCLID_TLS10_PRF	(0x09 << OP_PCLID_SHIFT)
446 #define OP_PCLID_TLS11_PRF	(0x0a << OP_PCLID_SHIFT)
447 #define OP_PCLID_DTLS10_PRF	(0x0c << OP_PCLID_SHIFT)
448 #define OP_PCLID_PRF		(0x06 << OP_PCLID_SHIFT)
449 #define OP_PCLID_BLOB		(0x0d << OP_PCLID_SHIFT)
450 #define OP_PCLID_SECRETKEY	(0x11 << OP_PCLID_SHIFT)
451 #define OP_PCLID_PUBLICKEYPAIR	(0x14 << OP_PCLID_SHIFT)
452 #define OP_PCLID_DSASIGN	(0x15 << OP_PCLID_SHIFT)
453 #define OP_PCLID_DSAVERIFY	(0x16 << OP_PCLID_SHIFT)
454 #define OP_PCLID_RSAENC_PUBKEY  (0x18 << OP_PCLID_SHIFT)
455 #define OP_PCLID_RSADEC_PRVKEY  (0x19 << OP_PCLID_SHIFT)
456 #define OP_PCLID_DKP_MD5	(0x20 << OP_PCLID_SHIFT)
457 #define OP_PCLID_DKP_SHA1	(0x21 << OP_PCLID_SHIFT)
458 #define OP_PCLID_DKP_SHA224	(0x22 << OP_PCLID_SHIFT)
459 #define OP_PCLID_DKP_SHA256	(0x23 << OP_PCLID_SHIFT)
460 #define OP_PCLID_DKP_SHA384	(0x24 << OP_PCLID_SHIFT)
461 #define OP_PCLID_DKP_SHA512	(0x25 << OP_PCLID_SHIFT)
462 #define OP_PCLID_DKP_RIF_MD5	(0x60 << OP_PCLID_SHIFT)
463 #define OP_PCLID_DKP_RIF_SHA1	(0x61 << OP_PCLID_SHIFT)
464 #define OP_PCLID_DKP_RIF_SHA224	(0x62 << OP_PCLID_SHIFT)
465 #define OP_PCLID_DKP_RIF_SHA256	(0x63 << OP_PCLID_SHIFT)
466 #define OP_PCLID_DKP_RIF_SHA384	(0x64 << OP_PCLID_SHIFT)
467 #define OP_PCLID_DKP_RIF_SHA512	(0x65 << OP_PCLID_SHIFT)
468 
469 /* Assuming OP_TYPE = OP_TYPE_DECAP_PROTOCOL/ENCAP_PROTOCOL */
470 #define OP_PCLID_IPSEC		(0x01 << OP_PCLID_SHIFT)
471 #define OP_PCLID_SRTP		(0x02 << OP_PCLID_SHIFT)
472 #define OP_PCLID_MACSEC		(0x03 << OP_PCLID_SHIFT)
473 #define OP_PCLID_WIFI		(0x04 << OP_PCLID_SHIFT)
474 #define OP_PCLID_WIMAX		(0x05 << OP_PCLID_SHIFT)
475 #define OP_PCLID_SSL30		(0x08 << OP_PCLID_SHIFT)
476 #define OP_PCLID_TLS10		(0x09 << OP_PCLID_SHIFT)
477 #define OP_PCLID_TLS11		(0x0a << OP_PCLID_SHIFT)
478 #define OP_PCLID_TLS12		(0x0b << OP_PCLID_SHIFT)
479 #define OP_PCLID_DTLS		(0x0c << OP_PCLID_SHIFT)
480 
481 /*
482  * ProtocolInfo selectors
483  */
484 #define OP_PCLINFO_MASK				 0xffff
485 
486 /* for OP_PCLID_IPSEC */
487 #define OP_PCL_IPSEC_CIPHER_MASK		 0xff00
488 #define OP_PCL_IPSEC_AUTH_MASK			 0x00ff
489 
490 #define OP_PCL_IPSEC_DES_IV64			 0x0100
491 #define OP_PCL_IPSEC_DES			 0x0200
492 #define OP_PCL_IPSEC_3DES			 0x0300
493 #define OP_PCL_IPSEC_AES_CBC			 0x0c00
494 #define OP_PCL_IPSEC_AES_CTR			 0x0d00
495 #define OP_PCL_IPSEC_AES_XTS			 0x1600
496 #define OP_PCL_IPSEC_AES_CCM8			 0x0e00
497 #define OP_PCL_IPSEC_AES_CCM12			 0x0f00
498 #define OP_PCL_IPSEC_AES_CCM16			 0x1000
499 #define OP_PCL_IPSEC_AES_GCM8			 0x1200
500 #define OP_PCL_IPSEC_AES_GCM12			 0x1300
501 #define OP_PCL_IPSEC_AES_GCM16			 0x1400
502 
503 #define OP_PCL_IPSEC_HMAC_NULL			 0x0000
504 #define OP_PCL_IPSEC_HMAC_MD5_96		 0x0001
505 #define OP_PCL_IPSEC_HMAC_SHA1_96		 0x0002
506 #define OP_PCL_IPSEC_AES_XCBC_MAC_96		 0x0005
507 #define OP_PCL_IPSEC_HMAC_MD5_128		 0x0006
508 #define OP_PCL_IPSEC_HMAC_SHA1_160		 0x0007
509 #define OP_PCL_IPSEC_HMAC_SHA2_256_128		 0x000c
510 #define OP_PCL_IPSEC_HMAC_SHA2_384_192		 0x000d
511 #define OP_PCL_IPSEC_HMAC_SHA2_512_256		 0x000e
512 
513 /* For SRTP - OP_PCLID_SRTP */
514 #define OP_PCL_SRTP_CIPHER_MASK			 0xff00
515 #define OP_PCL_SRTP_AUTH_MASK			 0x00ff
516 
517 #define OP_PCL_SRTP_AES_CTR			 0x0d00
518 
519 #define OP_PCL_SRTP_HMAC_SHA1_160		 0x0007
520 
521 /* For SSL 3.0 - OP_PCLID_SSL30 */
522 #define OP_PCL_SSL30_AES_128_CBC_SHA		 0x002f
523 #define OP_PCL_SSL30_AES_128_CBC_SHA_2		 0x0030
524 #define OP_PCL_SSL30_AES_128_CBC_SHA_3		 0x0031
525 #define OP_PCL_SSL30_AES_128_CBC_SHA_4		 0x0032
526 #define OP_PCL_SSL30_AES_128_CBC_SHA_5		 0x0033
527 #define OP_PCL_SSL30_AES_128_CBC_SHA_6		 0x0034
528 #define OP_PCL_SSL30_AES_128_CBC_SHA_7		 0x008c
529 #define OP_PCL_SSL30_AES_128_CBC_SHA_8		 0x0090
530 #define OP_PCL_SSL30_AES_128_CBC_SHA_9		 0x0094
531 #define OP_PCL_SSL30_AES_128_CBC_SHA_10		 0xc004
532 #define OP_PCL_SSL30_AES_128_CBC_SHA_11		 0xc009
533 #define OP_PCL_SSL30_AES_128_CBC_SHA_12		 0xc00e
534 #define OP_PCL_SSL30_AES_128_CBC_SHA_13		 0xc013
535 #define OP_PCL_SSL30_AES_128_CBC_SHA_14		 0xc018
536 #define OP_PCL_SSL30_AES_128_CBC_SHA_15		 0xc01d
537 #define OP_PCL_SSL30_AES_128_CBC_SHA_16		 0xc01e
538 #define OP_PCL_SSL30_AES_128_CBC_SHA_17		 0xc01f
539 
540 #define OP_PCL_SSL30_AES_256_CBC_SHA		 0x0035
541 #define OP_PCL_SSL30_AES_256_CBC_SHA_2		 0x0036
542 #define OP_PCL_SSL30_AES_256_CBC_SHA_3		 0x0037
543 #define OP_PCL_SSL30_AES_256_CBC_SHA_4		 0x0038
544 #define OP_PCL_SSL30_AES_256_CBC_SHA_5		 0x0039
545 #define OP_PCL_SSL30_AES_256_CBC_SHA_6		 0x003a
546 #define OP_PCL_SSL30_AES_256_CBC_SHA_7		 0x008d
547 #define OP_PCL_SSL30_AES_256_CBC_SHA_8		 0x0091
548 #define OP_PCL_SSL30_AES_256_CBC_SHA_9		 0x0095
549 #define OP_PCL_SSL30_AES_256_CBC_SHA_10		 0xc005
550 #define OP_PCL_SSL30_AES_256_CBC_SHA_11		 0xc00a
551 #define OP_PCL_SSL30_AES_256_CBC_SHA_12		 0xc00f
552 #define OP_PCL_SSL30_AES_256_CBC_SHA_13		 0xc014
553 #define OP_PCL_SSL30_AES_256_CBC_SHA_14		 0xc019
554 #define OP_PCL_SSL30_AES_256_CBC_SHA_15		 0xc020
555 #define OP_PCL_SSL30_AES_256_CBC_SHA_16		 0xc021
556 #define OP_PCL_SSL30_AES_256_CBC_SHA_17		 0xc022
557 
558 #define OP_PCL_SSL30_3DES_EDE_CBC_MD5		 0x0023
559 
560 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA		 0x001f
561 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_2		 0x008b
562 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_3		 0x008f
563 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_4		 0x0093
564 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_5		 0x000a
565 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_6		 0x000d
566 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_7		 0x0010
567 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_8		 0x0013
568 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_9		 0x0016
569 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_10	 0x001b
570 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_11	 0xc003
571 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_12	 0xc008
572 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_13	 0xc00d
573 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_14	 0xc012
574 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_15	 0xc017
575 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_16	 0xc01a
576 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_17	 0xc01b
577 #define OP_PCL_SSL30_3DES_EDE_CBC_SHA_18	 0xc01c
578 
579 #define OP_PCL_SSL30_DES40_CBC_MD5		 0x0029
580 
581 #define OP_PCL_SSL30_DES_CBC_MD5		 0x0022
582 
583 #define OP_PCL_SSL30_DES40_CBC_SHA		 0x0008
584 #define OP_PCL_SSL30_DES40_CBC_SHA_2		 0x000b
585 #define OP_PCL_SSL30_DES40_CBC_SHA_3		 0x000e
586 #define OP_PCL_SSL30_DES40_CBC_SHA_4		 0x0011
587 #define OP_PCL_SSL30_DES40_CBC_SHA_5		 0x0014
588 #define OP_PCL_SSL30_DES40_CBC_SHA_6		 0x0019
589 #define OP_PCL_SSL30_DES40_CBC_SHA_7		 0x0026
590 
591 #define OP_PCL_SSL30_DES_CBC_SHA		 0x001e
592 #define OP_PCL_SSL30_DES_CBC_SHA_2		 0x0009
593 #define OP_PCL_SSL30_DES_CBC_SHA_3		 0x000c
594 #define OP_PCL_SSL30_DES_CBC_SHA_4		 0x000f
595 #define OP_PCL_SSL30_DES_CBC_SHA_5		 0x0012
596 #define OP_PCL_SSL30_DES_CBC_SHA_6		 0x0015
597 #define OP_PCL_SSL30_DES_CBC_SHA_7		 0x001a
598 
599 #define OP_PCL_SSL30_RC4_128_MD5		 0x0024
600 #define OP_PCL_SSL30_RC4_128_MD5_2		 0x0004
601 #define OP_PCL_SSL30_RC4_128_MD5_3		 0x0018
602 
603 #define OP_PCL_SSL30_RC4_40_MD5			 0x002b
604 #define OP_PCL_SSL30_RC4_40_MD5_2		 0x0003
605 #define OP_PCL_SSL30_RC4_40_MD5_3		 0x0017
606 
607 #define OP_PCL_SSL30_RC4_128_SHA		 0x0020
608 #define OP_PCL_SSL30_RC4_128_SHA_2		 0x008a
609 #define OP_PCL_SSL30_RC4_128_SHA_3		 0x008e
610 #define OP_PCL_SSL30_RC4_128_SHA_4		 0x0092
611 #define OP_PCL_SSL30_RC4_128_SHA_5		 0x0005
612 #define OP_PCL_SSL30_RC4_128_SHA_6		 0xc002
613 #define OP_PCL_SSL30_RC4_128_SHA_7		 0xc007
614 #define OP_PCL_SSL30_RC4_128_SHA_8		 0xc00c
615 #define OP_PCL_SSL30_RC4_128_SHA_9		 0xc011
616 #define OP_PCL_SSL30_RC4_128_SHA_10		 0xc016
617 
618 #define OP_PCL_SSL30_RC4_40_SHA			 0x0028
619 
620 
621 /* For TLS 1.0 - OP_PCLID_TLS10 */
622 #define OP_PCL_TLS10_AES_128_CBC_SHA		 0x002f
623 #define OP_PCL_TLS10_AES_128_CBC_SHA_2		 0x0030
624 #define OP_PCL_TLS10_AES_128_CBC_SHA_3		 0x0031
625 #define OP_PCL_TLS10_AES_128_CBC_SHA_4		 0x0032
626 #define OP_PCL_TLS10_AES_128_CBC_SHA_5		 0x0033
627 #define OP_PCL_TLS10_AES_128_CBC_SHA_6		 0x0034
628 #define OP_PCL_TLS10_AES_128_CBC_SHA_7		 0x008c
629 #define OP_PCL_TLS10_AES_128_CBC_SHA_8		 0x0090
630 #define OP_PCL_TLS10_AES_128_CBC_SHA_9		 0x0094
631 #define OP_PCL_TLS10_AES_128_CBC_SHA_10		 0xc004
632 #define OP_PCL_TLS10_AES_128_CBC_SHA_11		 0xc009
633 #define OP_PCL_TLS10_AES_128_CBC_SHA_12		 0xc00e
634 #define OP_PCL_TLS10_AES_128_CBC_SHA_13		 0xc013
635 #define OP_PCL_TLS10_AES_128_CBC_SHA_14		 0xc018
636 #define OP_PCL_TLS10_AES_128_CBC_SHA_15		 0xc01d
637 #define OP_PCL_TLS10_AES_128_CBC_SHA_16		 0xc01e
638 #define OP_PCL_TLS10_AES_128_CBC_SHA_17		 0xc01f
639 
640 #define OP_PCL_TLS10_AES_256_CBC_SHA		 0x0035
641 #define OP_PCL_TLS10_AES_256_CBC_SHA_2		 0x0036
642 #define OP_PCL_TLS10_AES_256_CBC_SHA_3		 0x0037
643 #define OP_PCL_TLS10_AES_256_CBC_SHA_4		 0x0038
644 #define OP_PCL_TLS10_AES_256_CBC_SHA_5		 0x0039
645 #define OP_PCL_TLS10_AES_256_CBC_SHA_6		 0x003a
646 #define OP_PCL_TLS10_AES_256_CBC_SHA_7		 0x008d
647 #define OP_PCL_TLS10_AES_256_CBC_SHA_8		 0x0091
648 #define OP_PCL_TLS10_AES_256_CBC_SHA_9		 0x0095
649 #define OP_PCL_TLS10_AES_256_CBC_SHA_10		 0xc005
650 #define OP_PCL_TLS10_AES_256_CBC_SHA_11		 0xc00a
651 #define OP_PCL_TLS10_AES_256_CBC_SHA_12		 0xc00f
652 #define OP_PCL_TLS10_AES_256_CBC_SHA_13		 0xc014
653 #define OP_PCL_TLS10_AES_256_CBC_SHA_14		 0xc019
654 #define OP_PCL_TLS10_AES_256_CBC_SHA_15		 0xc020
655 #define OP_PCL_TLS10_AES_256_CBC_SHA_16		 0xc021
656 #define OP_PCL_TLS10_AES_256_CBC_SHA_17		 0xc022
657 
658 /* #define OP_PCL_TLS10_3DES_EDE_CBC_MD5	0x0023 */
659 
660 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA		 0x001f
661 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_2		 0x008b
662 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_3		 0x008f
663 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_4		 0x0093
664 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_5		 0x000a
665 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_6		 0x000d
666 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_7		 0x0010
667 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_8		 0x0013
668 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_9		 0x0016
669 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_10	 0x001b
670 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_11	 0xc003
671 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_12	 0xc008
672 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_13	 0xc00d
673 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_14	 0xc012
674 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_15	 0xc017
675 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_16	 0xc01a
676 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_17	 0xc01b
677 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA_18	 0xc01c
678 
679 #define OP_PCL_TLS10_DES40_CBC_MD5		 0x0029
680 
681 #define OP_PCL_TLS10_DES_CBC_MD5		 0x0022
682 
683 #define OP_PCL_TLS10_DES40_CBC_SHA		 0x0008
684 #define OP_PCL_TLS10_DES40_CBC_SHA_2		 0x000b
685 #define OP_PCL_TLS10_DES40_CBC_SHA_3		 0x000e
686 #define OP_PCL_TLS10_DES40_CBC_SHA_4		 0x0011
687 #define OP_PCL_TLS10_DES40_CBC_SHA_5		 0x0014
688 #define OP_PCL_TLS10_DES40_CBC_SHA_6		 0x0019
689 #define OP_PCL_TLS10_DES40_CBC_SHA_7		 0x0026
690 
691 
692 #define OP_PCL_TLS10_DES_CBC_SHA		 0x001e
693 #define OP_PCL_TLS10_DES_CBC_SHA_2		 0x0009
694 #define OP_PCL_TLS10_DES_CBC_SHA_3		 0x000c
695 #define OP_PCL_TLS10_DES_CBC_SHA_4		 0x000f
696 #define OP_PCL_TLS10_DES_CBC_SHA_5		 0x0012
697 #define OP_PCL_TLS10_DES_CBC_SHA_6		 0x0015
698 #define OP_PCL_TLS10_DES_CBC_SHA_7		 0x001a
699 
700 #define OP_PCL_TLS10_RC4_128_MD5		 0x0024
701 #define OP_PCL_TLS10_RC4_128_MD5_2		 0x0004
702 #define OP_PCL_TLS10_RC4_128_MD5_3		 0x0018
703 
704 #define OP_PCL_TLS10_RC4_40_MD5			 0x002b
705 #define OP_PCL_TLS10_RC4_40_MD5_2		 0x0003
706 #define OP_PCL_TLS10_RC4_40_MD5_3		 0x0017
707 
708 #define OP_PCL_TLS10_RC4_128_SHA		 0x0020
709 #define OP_PCL_TLS10_RC4_128_SHA_2		 0x008a
710 #define OP_PCL_TLS10_RC4_128_SHA_3		 0x008e
711 #define OP_PCL_TLS10_RC4_128_SHA_4		 0x0092
712 #define OP_PCL_TLS10_RC4_128_SHA_5		 0x0005
713 #define OP_PCL_TLS10_RC4_128_SHA_6		 0xc002
714 #define OP_PCL_TLS10_RC4_128_SHA_7		 0xc007
715 #define OP_PCL_TLS10_RC4_128_SHA_8		 0xc00c
716 #define OP_PCL_TLS10_RC4_128_SHA_9		 0xc011
717 #define OP_PCL_TLS10_RC4_128_SHA_10		 0xc016
718 
719 #define OP_PCL_TLS10_RC4_40_SHA			 0x0028
720 
721 #define OP_PCL_TLS10_3DES_EDE_CBC_MD5		 0xff23
722 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA160	 0xff30
723 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA224	 0xff34
724 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA256	 0xff36
725 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA384	 0xff33
726 #define OP_PCL_TLS10_3DES_EDE_CBC_SHA512	 0xff35
727 #define OP_PCL_TLS10_AES_128_CBC_SHA160		 0xff80
728 #define OP_PCL_TLS10_AES_128_CBC_SHA224		 0xff84
729 #define OP_PCL_TLS10_AES_128_CBC_SHA256		 0xff86
730 #define OP_PCL_TLS10_AES_128_CBC_SHA384		 0xff83
731 #define OP_PCL_TLS10_AES_128_CBC_SHA512		 0xff85
732 #define OP_PCL_TLS10_AES_192_CBC_SHA160		 0xff20
733 #define OP_PCL_TLS10_AES_192_CBC_SHA224		 0xff24
734 #define OP_PCL_TLS10_AES_192_CBC_SHA256		 0xff26
735 #define OP_PCL_TLS10_AES_192_CBC_SHA384		 0xff23
736 #define OP_PCL_TLS10_AES_192_CBC_SHA512		 0xff25
737 #define OP_PCL_TLS10_AES_256_CBC_SHA160		 0xff60
738 #define OP_PCL_TLS10_AES_256_CBC_SHA224		 0xff64
739 #define OP_PCL_TLS10_AES_256_CBC_SHA256		 0xff66
740 #define OP_PCL_TLS10_AES_256_CBC_SHA384		 0xff63
741 #define OP_PCL_TLS10_AES_256_CBC_SHA512		 0xff65
742 
743 
744 
745 /* For TLS 1.1 - OP_PCLID_TLS11 */
746 #define OP_PCL_TLS11_AES_128_CBC_SHA		 0x002f
747 #define OP_PCL_TLS11_AES_128_CBC_SHA_2		 0x0030
748 #define OP_PCL_TLS11_AES_128_CBC_SHA_3		 0x0031
749 #define OP_PCL_TLS11_AES_128_CBC_SHA_4		 0x0032
750 #define OP_PCL_TLS11_AES_128_CBC_SHA_5		 0x0033
751 #define OP_PCL_TLS11_AES_128_CBC_SHA_6		 0x0034
752 #define OP_PCL_TLS11_AES_128_CBC_SHA_7		 0x008c
753 #define OP_PCL_TLS11_AES_128_CBC_SHA_8		 0x0090
754 #define OP_PCL_TLS11_AES_128_CBC_SHA_9		 0x0094
755 #define OP_PCL_TLS11_AES_128_CBC_SHA_10		 0xc004
756 #define OP_PCL_TLS11_AES_128_CBC_SHA_11		 0xc009
757 #define OP_PCL_TLS11_AES_128_CBC_SHA_12		 0xc00e
758 #define OP_PCL_TLS11_AES_128_CBC_SHA_13		 0xc013
759 #define OP_PCL_TLS11_AES_128_CBC_SHA_14		 0xc018
760 #define OP_PCL_TLS11_AES_128_CBC_SHA_15		 0xc01d
761 #define OP_PCL_TLS11_AES_128_CBC_SHA_16		 0xc01e
762 #define OP_PCL_TLS11_AES_128_CBC_SHA_17		 0xc01f
763 
764 #define OP_PCL_TLS11_AES_256_CBC_SHA		 0x0035
765 #define OP_PCL_TLS11_AES_256_CBC_SHA_2		 0x0036
766 #define OP_PCL_TLS11_AES_256_CBC_SHA_3		 0x0037
767 #define OP_PCL_TLS11_AES_256_CBC_SHA_4		 0x0038
768 #define OP_PCL_TLS11_AES_256_CBC_SHA_5		 0x0039
769 #define OP_PCL_TLS11_AES_256_CBC_SHA_6		 0x003a
770 #define OP_PCL_TLS11_AES_256_CBC_SHA_7		 0x008d
771 #define OP_PCL_TLS11_AES_256_CBC_SHA_8		 0x0091
772 #define OP_PCL_TLS11_AES_256_CBC_SHA_9		 0x0095
773 #define OP_PCL_TLS11_AES_256_CBC_SHA_10		 0xc005
774 #define OP_PCL_TLS11_AES_256_CBC_SHA_11		 0xc00a
775 #define OP_PCL_TLS11_AES_256_CBC_SHA_12		 0xc00f
776 #define OP_PCL_TLS11_AES_256_CBC_SHA_13		 0xc014
777 #define OP_PCL_TLS11_AES_256_CBC_SHA_14		 0xc019
778 #define OP_PCL_TLS11_AES_256_CBC_SHA_15		 0xc020
779 #define OP_PCL_TLS11_AES_256_CBC_SHA_16		 0xc021
780 #define OP_PCL_TLS11_AES_256_CBC_SHA_17		 0xc022
781 
782 /* #define OP_PCL_TLS11_3DES_EDE_CBC_MD5	0x0023 */
783 
784 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA		 0x001f
785 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_2		 0x008b
786 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_3		 0x008f
787 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_4		 0x0093
788 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_5		 0x000a
789 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_6		 0x000d
790 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_7		 0x0010
791 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_8		 0x0013
792 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_9		 0x0016
793 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_10	 0x001b
794 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_11	 0xc003
795 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_12	 0xc008
796 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_13	 0xc00d
797 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_14	 0xc012
798 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_15	 0xc017
799 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_16	 0xc01a
800 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_17	 0xc01b
801 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA_18	 0xc01c
802 
803 #define OP_PCL_TLS11_DES40_CBC_MD5		 0x0029
804 
805 #define OP_PCL_TLS11_DES_CBC_MD5		 0x0022
806 
807 #define OP_PCL_TLS11_DES40_CBC_SHA		 0x0008
808 #define OP_PCL_TLS11_DES40_CBC_SHA_2		 0x000b
809 #define OP_PCL_TLS11_DES40_CBC_SHA_3		 0x000e
810 #define OP_PCL_TLS11_DES40_CBC_SHA_4		 0x0011
811 #define OP_PCL_TLS11_DES40_CBC_SHA_5		 0x0014
812 #define OP_PCL_TLS11_DES40_CBC_SHA_6		 0x0019
813 #define OP_PCL_TLS11_DES40_CBC_SHA_7		 0x0026
814 
815 #define OP_PCL_TLS11_DES_CBC_SHA		 0x001e
816 #define OP_PCL_TLS11_DES_CBC_SHA_2		 0x0009
817 #define OP_PCL_TLS11_DES_CBC_SHA_3		 0x000c
818 #define OP_PCL_TLS11_DES_CBC_SHA_4		 0x000f
819 #define OP_PCL_TLS11_DES_CBC_SHA_5		 0x0012
820 #define OP_PCL_TLS11_DES_CBC_SHA_6		 0x0015
821 #define OP_PCL_TLS11_DES_CBC_SHA_7		 0x001a
822 
823 #define OP_PCL_TLS11_RC4_128_MD5		 0x0024
824 #define OP_PCL_TLS11_RC4_128_MD5_2		 0x0004
825 #define OP_PCL_TLS11_RC4_128_MD5_3		 0x0018
826 
827 #define OP_PCL_TLS11_RC4_40_MD5			 0x002b
828 #define OP_PCL_TLS11_RC4_40_MD5_2		 0x0003
829 #define OP_PCL_TLS11_RC4_40_MD5_3		 0x0017
830 
831 #define OP_PCL_TLS11_RC4_128_SHA		 0x0020
832 #define OP_PCL_TLS11_RC4_128_SHA_2		 0x008a
833 #define OP_PCL_TLS11_RC4_128_SHA_3		 0x008e
834 #define OP_PCL_TLS11_RC4_128_SHA_4		 0x0092
835 #define OP_PCL_TLS11_RC4_128_SHA_5		 0x0005
836 #define OP_PCL_TLS11_RC4_128_SHA_6		 0xc002
837 #define OP_PCL_TLS11_RC4_128_SHA_7		 0xc007
838 #define OP_PCL_TLS11_RC4_128_SHA_8		 0xc00c
839 #define OP_PCL_TLS11_RC4_128_SHA_9		 0xc011
840 #define OP_PCL_TLS11_RC4_128_SHA_10		 0xc016
841 
842 #define OP_PCL_TLS11_RC4_40_SHA			 0x0028
843 
844 #define OP_PCL_TLS11_3DES_EDE_CBC_MD5		 0xff23
845 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA160	 0xff30
846 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA224	 0xff34
847 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA256	 0xff36
848 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA384	 0xff33
849 #define OP_PCL_TLS11_3DES_EDE_CBC_SHA512	 0xff35
850 #define OP_PCL_TLS11_AES_128_CBC_SHA160		 0xff80
851 #define OP_PCL_TLS11_AES_128_CBC_SHA224		 0xff84
852 #define OP_PCL_TLS11_AES_128_CBC_SHA256		 0xff86
853 #define OP_PCL_TLS11_AES_128_CBC_SHA384		 0xff83
854 #define OP_PCL_TLS11_AES_128_CBC_SHA512		 0xff85
855 #define OP_PCL_TLS11_AES_192_CBC_SHA160		 0xff20
856 #define OP_PCL_TLS11_AES_192_CBC_SHA224		 0xff24
857 #define OP_PCL_TLS11_AES_192_CBC_SHA256		 0xff26
858 #define OP_PCL_TLS11_AES_192_CBC_SHA384		 0xff23
859 #define OP_PCL_TLS11_AES_192_CBC_SHA512		 0xff25
860 #define OP_PCL_TLS11_AES_256_CBC_SHA160		 0xff60
861 #define OP_PCL_TLS11_AES_256_CBC_SHA224		 0xff64
862 #define OP_PCL_TLS11_AES_256_CBC_SHA256		 0xff66
863 #define OP_PCL_TLS11_AES_256_CBC_SHA384		 0xff63
864 #define OP_PCL_TLS11_AES_256_CBC_SHA512		 0xff65
865 
866 
867 /* For TLS 1.2 - OP_PCLID_TLS12 */
868 #define OP_PCL_TLS12_AES_128_CBC_SHA		 0x002f
869 #define OP_PCL_TLS12_AES_128_CBC_SHA_2		 0x0030
870 #define OP_PCL_TLS12_AES_128_CBC_SHA_3		 0x0031
871 #define OP_PCL_TLS12_AES_128_CBC_SHA_4		 0x0032
872 #define OP_PCL_TLS12_AES_128_CBC_SHA_5		 0x0033
873 #define OP_PCL_TLS12_AES_128_CBC_SHA_6		 0x0034
874 #define OP_PCL_TLS12_AES_128_CBC_SHA_7		 0x008c
875 #define OP_PCL_TLS12_AES_128_CBC_SHA_8		 0x0090
876 #define OP_PCL_TLS12_AES_128_CBC_SHA_9		 0x0094
877 #define OP_PCL_TLS12_AES_128_CBC_SHA_10		 0xc004
878 #define OP_PCL_TLS12_AES_128_CBC_SHA_11		 0xc009
879 #define OP_PCL_TLS12_AES_128_CBC_SHA_12		 0xc00e
880 #define OP_PCL_TLS12_AES_128_CBC_SHA_13		 0xc013
881 #define OP_PCL_TLS12_AES_128_CBC_SHA_14		 0xc018
882 #define OP_PCL_TLS12_AES_128_CBC_SHA_15		 0xc01d
883 #define OP_PCL_TLS12_AES_128_CBC_SHA_16		 0xc01e
884 #define OP_PCL_TLS12_AES_128_CBC_SHA_17		 0xc01f
885 
886 #define OP_PCL_TLS12_AES_256_CBC_SHA		 0x0035
887 #define OP_PCL_TLS12_AES_256_CBC_SHA_2		 0x0036
888 #define OP_PCL_TLS12_AES_256_CBC_SHA_3		 0x0037
889 #define OP_PCL_TLS12_AES_256_CBC_SHA_4		 0x0038
890 #define OP_PCL_TLS12_AES_256_CBC_SHA_5		 0x0039
891 #define OP_PCL_TLS12_AES_256_CBC_SHA_6		 0x003a
892 #define OP_PCL_TLS12_AES_256_CBC_SHA_7		 0x008d
893 #define OP_PCL_TLS12_AES_256_CBC_SHA_8		 0x0091
894 #define OP_PCL_TLS12_AES_256_CBC_SHA_9		 0x0095
895 #define OP_PCL_TLS12_AES_256_CBC_SHA_10		 0xc005
896 #define OP_PCL_TLS12_AES_256_CBC_SHA_11		 0xc00a
897 #define OP_PCL_TLS12_AES_256_CBC_SHA_12		 0xc00f
898 #define OP_PCL_TLS12_AES_256_CBC_SHA_13		 0xc014
899 #define OP_PCL_TLS12_AES_256_CBC_SHA_14		 0xc019
900 #define OP_PCL_TLS12_AES_256_CBC_SHA_15		 0xc020
901 #define OP_PCL_TLS12_AES_256_CBC_SHA_16		 0xc021
902 #define OP_PCL_TLS12_AES_256_CBC_SHA_17		 0xc022
903 
904 /* #define OP_PCL_TLS12_3DES_EDE_CBC_MD5	0x0023 */
905 
906 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA		 0x001f
907 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_2		 0x008b
908 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_3		 0x008f
909 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_4		 0x0093
910 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_5		 0x000a
911 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_6		 0x000d
912 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_7		 0x0010
913 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_8		 0x0013
914 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_9		 0x0016
915 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_10	 0x001b
916 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_11	 0xc003
917 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_12	 0xc008
918 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_13	 0xc00d
919 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_14	 0xc012
920 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_15	 0xc017
921 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_16	 0xc01a
922 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_17	 0xc01b
923 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA_18	 0xc01c
924 
925 #define OP_PCL_TLS12_DES40_CBC_MD5		 0x0029
926 
927 #define OP_PCL_TLS12_DES_CBC_MD5		 0x0022
928 
929 #define OP_PCL_TLS12_DES40_CBC_SHA		 0x0008
930 #define OP_PCL_TLS12_DES40_CBC_SHA_2		 0x000b
931 #define OP_PCL_TLS12_DES40_CBC_SHA_3		 0x000e
932 #define OP_PCL_TLS12_DES40_CBC_SHA_4		 0x0011
933 #define OP_PCL_TLS12_DES40_CBC_SHA_5		 0x0014
934 #define OP_PCL_TLS12_DES40_CBC_SHA_6		 0x0019
935 #define OP_PCL_TLS12_DES40_CBC_SHA_7		 0x0026
936 
937 #define OP_PCL_TLS12_DES_CBC_SHA		 0x001e
938 #define OP_PCL_TLS12_DES_CBC_SHA_2		 0x0009
939 #define OP_PCL_TLS12_DES_CBC_SHA_3		 0x000c
940 #define OP_PCL_TLS12_DES_CBC_SHA_4		 0x000f
941 #define OP_PCL_TLS12_DES_CBC_SHA_5		 0x0012
942 #define OP_PCL_TLS12_DES_CBC_SHA_6		 0x0015
943 #define OP_PCL_TLS12_DES_CBC_SHA_7		 0x001a
944 
945 #define OP_PCL_TLS12_RC4_128_MD5		 0x0024
946 #define OP_PCL_TLS12_RC4_128_MD5_2		 0x0004
947 #define OP_PCL_TLS12_RC4_128_MD5_3		 0x0018
948 
949 #define OP_PCL_TLS12_RC4_40_MD5			 0x002b
950 #define OP_PCL_TLS12_RC4_40_MD5_2		 0x0003
951 #define OP_PCL_TLS12_RC4_40_MD5_3		 0x0017
952 
953 #define OP_PCL_TLS12_RC4_128_SHA		 0x0020
954 #define OP_PCL_TLS12_RC4_128_SHA_2		 0x008a
955 #define OP_PCL_TLS12_RC4_128_SHA_3		 0x008e
956 #define OP_PCL_TLS12_RC4_128_SHA_4		 0x0092
957 #define OP_PCL_TLS12_RC4_128_SHA_5		 0x0005
958 #define OP_PCL_TLS12_RC4_128_SHA_6		 0xc002
959 #define OP_PCL_TLS12_RC4_128_SHA_7		 0xc007
960 #define OP_PCL_TLS12_RC4_128_SHA_8		 0xc00c
961 #define OP_PCL_TLS12_RC4_128_SHA_9		 0xc011
962 #define OP_PCL_TLS12_RC4_128_SHA_10		 0xc016
963 
964 #define OP_PCL_TLS12_RC4_40_SHA			 0x0028
965 
966 /* #define OP_PCL_TLS12_AES_128_CBC_SHA256	0x003c */
967 #define OP_PCL_TLS12_AES_128_CBC_SHA256_2	 0x003e
968 #define OP_PCL_TLS12_AES_128_CBC_SHA256_3	 0x003f
969 #define OP_PCL_TLS12_AES_128_CBC_SHA256_4	 0x0040
970 #define OP_PCL_TLS12_AES_128_CBC_SHA256_5	 0x0067
971 #define OP_PCL_TLS12_AES_128_CBC_SHA256_6	 0x006c
972 
973 /* #define OP_PCL_TLS12_AES_256_CBC_SHA256	0x003d */
974 #define OP_PCL_TLS12_AES_256_CBC_SHA256_2	 0x0068
975 #define OP_PCL_TLS12_AES_256_CBC_SHA256_3	 0x0069
976 #define OP_PCL_TLS12_AES_256_CBC_SHA256_4	 0x006a
977 #define OP_PCL_TLS12_AES_256_CBC_SHA256_5	 0x006b
978 #define OP_PCL_TLS12_AES_256_CBC_SHA256_6	 0x006d
979 
980 /* AEAD_AES_xxx_CCM/GCM remain to be defined... */
981 
982 #define OP_PCL_TLS12_3DES_EDE_CBC_MD5		 0xff23
983 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA160	 0xff30
984 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA224	 0xff34
985 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA256	 0xff36
986 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA384	 0xff33
987 #define OP_PCL_TLS12_3DES_EDE_CBC_SHA512	 0xff35
988 #define OP_PCL_TLS12_AES_128_CBC_SHA160		 0xff80
989 #define OP_PCL_TLS12_AES_128_CBC_SHA224		 0xff84
990 #define OP_PCL_TLS12_AES_128_CBC_SHA256		 0xff86
991 #define OP_PCL_TLS12_AES_128_CBC_SHA384		 0xff83
992 #define OP_PCL_TLS12_AES_128_CBC_SHA512		 0xff85
993 #define OP_PCL_TLS12_AES_192_CBC_SHA160		 0xff20
994 #define OP_PCL_TLS12_AES_192_CBC_SHA224		 0xff24
995 #define OP_PCL_TLS12_AES_192_CBC_SHA256		 0xff26
996 #define OP_PCL_TLS12_AES_192_CBC_SHA384		 0xff23
997 #define OP_PCL_TLS12_AES_192_CBC_SHA512		 0xff25
998 #define OP_PCL_TLS12_AES_256_CBC_SHA160		 0xff60
999 #define OP_PCL_TLS12_AES_256_CBC_SHA224		 0xff64
1000 #define OP_PCL_TLS12_AES_256_CBC_SHA256		 0xff66
1001 #define OP_PCL_TLS12_AES_256_CBC_SHA384		 0xff63
1002 #define OP_PCL_TLS12_AES_256_CBC_SHA512		 0xff65
1003 
1004 /* For DTLS - OP_PCLID_DTLS */
1005 
1006 #define OP_PCL_DTLS_AES_128_CBC_SHA		 0x002f
1007 #define OP_PCL_DTLS_AES_128_CBC_SHA_2		 0x0030
1008 #define OP_PCL_DTLS_AES_128_CBC_SHA_3		 0x0031
1009 #define OP_PCL_DTLS_AES_128_CBC_SHA_4		 0x0032
1010 #define OP_PCL_DTLS_AES_128_CBC_SHA_5		 0x0033
1011 #define OP_PCL_DTLS_AES_128_CBC_SHA_6		 0x0034
1012 #define OP_PCL_DTLS_AES_128_CBC_SHA_7		 0x008c
1013 #define OP_PCL_DTLS_AES_128_CBC_SHA_8		 0x0090
1014 #define OP_PCL_DTLS_AES_128_CBC_SHA_9		 0x0094
1015 #define OP_PCL_DTLS_AES_128_CBC_SHA_10		 0xc004
1016 #define OP_PCL_DTLS_AES_128_CBC_SHA_11		 0xc009
1017 #define OP_PCL_DTLS_AES_128_CBC_SHA_12		 0xc00e
1018 #define OP_PCL_DTLS_AES_128_CBC_SHA_13		 0xc013
1019 #define OP_PCL_DTLS_AES_128_CBC_SHA_14		 0xc018
1020 #define OP_PCL_DTLS_AES_128_CBC_SHA_15		 0xc01d
1021 #define OP_PCL_DTLS_AES_128_CBC_SHA_16		 0xc01e
1022 #define OP_PCL_DTLS_AES_128_CBC_SHA_17		 0xc01f
1023 
1024 #define OP_PCL_DTLS_AES_256_CBC_SHA		 0x0035
1025 #define OP_PCL_DTLS_AES_256_CBC_SHA_2		 0x0036
1026 #define OP_PCL_DTLS_AES_256_CBC_SHA_3		 0x0037
1027 #define OP_PCL_DTLS_AES_256_CBC_SHA_4		 0x0038
1028 #define OP_PCL_DTLS_AES_256_CBC_SHA_5		 0x0039
1029 #define OP_PCL_DTLS_AES_256_CBC_SHA_6		 0x003a
1030 #define OP_PCL_DTLS_AES_256_CBC_SHA_7		 0x008d
1031 #define OP_PCL_DTLS_AES_256_CBC_SHA_8		 0x0091
1032 #define OP_PCL_DTLS_AES_256_CBC_SHA_9		 0x0095
1033 #define OP_PCL_DTLS_AES_256_CBC_SHA_10		 0xc005
1034 #define OP_PCL_DTLS_AES_256_CBC_SHA_11		 0xc00a
1035 #define OP_PCL_DTLS_AES_256_CBC_SHA_12		 0xc00f
1036 #define OP_PCL_DTLS_AES_256_CBC_SHA_13		 0xc014
1037 #define OP_PCL_DTLS_AES_256_CBC_SHA_14		 0xc019
1038 #define OP_PCL_DTLS_AES_256_CBC_SHA_15		 0xc020
1039 #define OP_PCL_DTLS_AES_256_CBC_SHA_16		 0xc021
1040 #define OP_PCL_DTLS_AES_256_CBC_SHA_17		 0xc022
1041 
1042 /* #define OP_PCL_DTLS_3DES_EDE_CBC_MD5		0x0023 */
1043 
1044 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA		 0x001f
1045 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_2		 0x008b
1046 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_3		 0x008f
1047 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_4		 0x0093
1048 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_5		 0x000a
1049 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_6		 0x000d
1050 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_7		 0x0010
1051 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_8		 0x0013
1052 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_9		 0x0016
1053 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_10		 0x001b
1054 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_11		 0xc003
1055 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_12		 0xc008
1056 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_13		 0xc00d
1057 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_14		 0xc012
1058 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_15		 0xc017
1059 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_16		 0xc01a
1060 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_17		 0xc01b
1061 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA_18		 0xc01c
1062 
1063 #define OP_PCL_DTLS_DES40_CBC_MD5		 0x0029
1064 
1065 #define OP_PCL_DTLS_DES_CBC_MD5			 0x0022
1066 
1067 #define OP_PCL_DTLS_DES40_CBC_SHA		 0x0008
1068 #define OP_PCL_DTLS_DES40_CBC_SHA_2		 0x000b
1069 #define OP_PCL_DTLS_DES40_CBC_SHA_3		 0x000e
1070 #define OP_PCL_DTLS_DES40_CBC_SHA_4		 0x0011
1071 #define OP_PCL_DTLS_DES40_CBC_SHA_5		 0x0014
1072 #define OP_PCL_DTLS_DES40_CBC_SHA_6		 0x0019
1073 #define OP_PCL_DTLS_DES40_CBC_SHA_7		 0x0026
1074 
1075 
1076 #define OP_PCL_DTLS_DES_CBC_SHA			 0x001e
1077 #define OP_PCL_DTLS_DES_CBC_SHA_2		 0x0009
1078 #define OP_PCL_DTLS_DES_CBC_SHA_3		 0x000c
1079 #define OP_PCL_DTLS_DES_CBC_SHA_4		 0x000f
1080 #define OP_PCL_DTLS_DES_CBC_SHA_5		 0x0012
1081 #define OP_PCL_DTLS_DES_CBC_SHA_6		 0x0015
1082 #define OP_PCL_DTLS_DES_CBC_SHA_7		 0x001a
1083 
1084 
1085 #define OP_PCL_DTLS_3DES_EDE_CBC_MD5		 0xff23
1086 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA160		 0xff30
1087 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA224		 0xff34
1088 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA256		 0xff36
1089 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA384		 0xff33
1090 #define OP_PCL_DTLS_3DES_EDE_CBC_SHA512		 0xff35
1091 #define OP_PCL_DTLS_AES_128_CBC_SHA160		 0xff80
1092 #define OP_PCL_DTLS_AES_128_CBC_SHA224		 0xff84
1093 #define OP_PCL_DTLS_AES_128_CBC_SHA256		 0xff86
1094 #define OP_PCL_DTLS_AES_128_CBC_SHA384		 0xff83
1095 #define OP_PCL_DTLS_AES_128_CBC_SHA512		 0xff85
1096 #define OP_PCL_DTLS_AES_192_CBC_SHA160		 0xff20
1097 #define OP_PCL_DTLS_AES_192_CBC_SHA224		 0xff24
1098 #define OP_PCL_DTLS_AES_192_CBC_SHA256		 0xff26
1099 #define OP_PCL_DTLS_AES_192_CBC_SHA384		 0xff23
1100 #define OP_PCL_DTLS_AES_192_CBC_SHA512		 0xff25
1101 #define OP_PCL_DTLS_AES_256_CBC_SHA160		 0xff60
1102 #define OP_PCL_DTLS_AES_256_CBC_SHA224		 0xff64
1103 #define OP_PCL_DTLS_AES_256_CBC_SHA256		 0xff66
1104 #define OP_PCL_DTLS_AES_256_CBC_SHA384		 0xff63
1105 #define OP_PCL_DTLS_AES_256_CBC_SHA512		 0xff65
1106 
1107 /* 802.16 WiMAX protinfos */
1108 #define OP_PCL_WIMAX_OFDM			 0x0201
1109 #define OP_PCL_WIMAX_OFDMA			 0x0231
1110 
1111 /* 802.11 WiFi protinfos */
1112 #define OP_PCL_WIFI				 0xac04
1113 
1114 /* MacSec protinfos */
1115 #define OP_PCL_MACSEC				 0x0001
1116 
1117 /* Derived Key Protocol (DKP) Protinfo */
1118 #define OP_PCL_DKP_SRC_SHIFT	14
1119 #define OP_PCL_DKP_SRC_MASK	(3 << OP_PCL_DKP_SRC_SHIFT)
1120 #define OP_PCL_DKP_SRC_IMM	(0 << OP_PCL_DKP_SRC_SHIFT)
1121 #define OP_PCL_DKP_SRC_SEQ	(1 << OP_PCL_DKP_SRC_SHIFT)
1122 #define OP_PCL_DKP_SRC_PTR	(2 << OP_PCL_DKP_SRC_SHIFT)
1123 #define OP_PCL_DKP_SRC_SGF	(3 << OP_PCL_DKP_SRC_SHIFT)
1124 #define OP_PCL_DKP_DST_SHIFT	12
1125 #define OP_PCL_DKP_DST_MASK	(3 << OP_PCL_DKP_DST_SHIFT)
1126 #define OP_PCL_DKP_DST_IMM	(0 << OP_PCL_DKP_DST_SHIFT)
1127 #define OP_PCL_DKP_DST_SEQ	(1 << OP_PCL_DKP_DST_SHIFT)
1128 #define OP_PCL_DKP_DST_PTR	(2 << OP_PCL_DKP_DST_SHIFT)
1129 #define OP_PCL_DKP_DST_SGF	(3 << OP_PCL_DKP_DST_SHIFT)
1130 #define OP_PCL_DKP_KEY_SHIFT	0
1131 #define OP_PCL_DKP_KEY_MASK	(0xfff << OP_PCL_DKP_KEY_SHIFT)
1132 
1133 /* PKI unidirectional protocol protinfo bits */
1134 #define OP_PCL_PKPROT_TEST			 0x0008
1135 #define OP_PCL_PKPROT_DECRYPT			 0x0004
1136 #define OP_PCL_PKPROT_ECC			 0x0002
1137 #define OP_PCL_PKPROT_F2M			 0x0001
1138 
1139 /* For non-protocol/alg-only op commands */
1140 #define OP_ALG_TYPE_SHIFT	24
1141 #define OP_ALG_TYPE_MASK	(0x7 << OP_ALG_TYPE_SHIFT)
1142 #define OP_ALG_TYPE_CLASS1	(2 << OP_ALG_TYPE_SHIFT)
1143 #define OP_ALG_TYPE_CLASS2	(4 << OP_ALG_TYPE_SHIFT)
1144 
1145 /* version register fields */
1146 #define OP_VER_CCHA_NUM  0x000000ff /* Number CCHAs instantiated */
1147 #define OP_VER_CCHA_MISC 0x0000ff00 /* CCHA Miscellaneous Information */
1148 #define OP_VER_CCHA_REV  0x00ff0000 /* CCHA Revision Number */
1149 #define OP_VER_CCHA_VID  0xff000000 /* CCHA Version ID */
1150 
1151 #define OP_ALG_ALGSEL_SHIFT	16
1152 #define OP_ALG_ALGSEL_MASK	(0xff << OP_ALG_ALGSEL_SHIFT)
1153 #define OP_ALG_ALGSEL_SUBMASK	(0x0f << OP_ALG_ALGSEL_SHIFT)
1154 #define OP_ALG_ALGSEL_AES	(0x10 << OP_ALG_ALGSEL_SHIFT)
1155 #define OP_ALG_ALGSEL_DES	(0x20 << OP_ALG_ALGSEL_SHIFT)
1156 #define OP_ALG_ALGSEL_3DES	(0x21 << OP_ALG_ALGSEL_SHIFT)
1157 #define OP_ALG_ALGSEL_ARC4	(0x30 << OP_ALG_ALGSEL_SHIFT)
1158 #define OP_ALG_CHA_MDHA		(0x40 << OP_ALG_ALGSEL_SHIFT)
1159 #define OP_ALG_ALGSEL_MD5	(0x40 << OP_ALG_ALGSEL_SHIFT)
1160 #define OP_ALG_ALGSEL_SHA1	(0x41 << OP_ALG_ALGSEL_SHIFT)
1161 #define OP_ALG_ALGSEL_SHA224	(0x42 << OP_ALG_ALGSEL_SHIFT)
1162 #define OP_ALG_ALGSEL_SHA256	(0x43 << OP_ALG_ALGSEL_SHIFT)
1163 #define OP_ALG_ALGSEL_SHA384	(0x44 << OP_ALG_ALGSEL_SHIFT)
1164 #define OP_ALG_ALGSEL_SHA512	(0x45 << OP_ALG_ALGSEL_SHIFT)
1165 #define OP_ALG_ALGSEL_RNG	(0x50 << OP_ALG_ALGSEL_SHIFT)
1166 #define OP_ALG_ALGSEL_SNOW	(0x60 << OP_ALG_ALGSEL_SHIFT)
1167 #define OP_ALG_ALGSEL_SNOW_F8	(0x60 << OP_ALG_ALGSEL_SHIFT)
1168 #define OP_ALG_ALGSEL_KASUMI	(0x70 << OP_ALG_ALGSEL_SHIFT)
1169 #define OP_ALG_ALGSEL_CRC	(0x90 << OP_ALG_ALGSEL_SHIFT)
1170 #define OP_ALG_ALGSEL_SNOW_F9	(0xA0 << OP_ALG_ALGSEL_SHIFT)
1171 #define OP_ALG_ALGSEL_CHACHA20	(0xD0 << OP_ALG_ALGSEL_SHIFT)
1172 #define OP_ALG_ALGSEL_POLY1305	(0xE0 << OP_ALG_ALGSEL_SHIFT)
1173 
1174 #define OP_ALG_AAI_SHIFT	4
1175 #define OP_ALG_AAI_MASK		(0x1ff << OP_ALG_AAI_SHIFT)
1176 
1177 /* blockcipher AAI set */
1178 #define OP_ALG_AAI_CTR_MOD128	(0x00 << OP_ALG_AAI_SHIFT)
1179 #define OP_ALG_AAI_CTR_MOD8	(0x01 << OP_ALG_AAI_SHIFT)
1180 #define OP_ALG_AAI_CTR_MOD16	(0x02 << OP_ALG_AAI_SHIFT)
1181 #define OP_ALG_AAI_CTR_MOD24	(0x03 << OP_ALG_AAI_SHIFT)
1182 #define OP_ALG_AAI_CTR_MOD32	(0x04 << OP_ALG_AAI_SHIFT)
1183 #define OP_ALG_AAI_CTR_MOD40	(0x05 << OP_ALG_AAI_SHIFT)
1184 #define OP_ALG_AAI_CTR_MOD48	(0x06 << OP_ALG_AAI_SHIFT)
1185 #define OP_ALG_AAI_CTR_MOD56	(0x07 << OP_ALG_AAI_SHIFT)
1186 #define OP_ALG_AAI_CTR_MOD64	(0x08 << OP_ALG_AAI_SHIFT)
1187 #define OP_ALG_AAI_CTR_MOD72	(0x09 << OP_ALG_AAI_SHIFT)
1188 #define OP_ALG_AAI_CTR_MOD80	(0x0a << OP_ALG_AAI_SHIFT)
1189 #define OP_ALG_AAI_CTR_MOD88	(0x0b << OP_ALG_AAI_SHIFT)
1190 #define OP_ALG_AAI_CTR_MOD96	(0x0c << OP_ALG_AAI_SHIFT)
1191 #define OP_ALG_AAI_CTR_MOD104	(0x0d << OP_ALG_AAI_SHIFT)
1192 #define OP_ALG_AAI_CTR_MOD112	(0x0e << OP_ALG_AAI_SHIFT)
1193 #define OP_ALG_AAI_CTR_MOD120	(0x0f << OP_ALG_AAI_SHIFT)
1194 #define OP_ALG_AAI_CBC		(0x10 << OP_ALG_AAI_SHIFT)
1195 #define OP_ALG_AAI_ECB		(0x20 << OP_ALG_AAI_SHIFT)
1196 #define OP_ALG_AAI_CFB		(0x30 << OP_ALG_AAI_SHIFT)
1197 #define OP_ALG_AAI_OFB		(0x40 << OP_ALG_AAI_SHIFT)
1198 #define OP_ALG_AAI_XTS		(0x50 << OP_ALG_AAI_SHIFT)
1199 #define OP_ALG_AAI_CMAC		(0x60 << OP_ALG_AAI_SHIFT)
1200 #define OP_ALG_AAI_XCBC_MAC	(0x70 << OP_ALG_AAI_SHIFT)
1201 #define OP_ALG_AAI_CCM		(0x80 << OP_ALG_AAI_SHIFT)
1202 #define OP_ALG_AAI_GCM		(0x90 << OP_ALG_AAI_SHIFT)
1203 #define OP_ALG_AAI_CBC_XCBCMAC	(0xa0 << OP_ALG_AAI_SHIFT)
1204 #define OP_ALG_AAI_CTR_XCBCMAC	(0xb0 << OP_ALG_AAI_SHIFT)
1205 #define OP_ALG_AAI_CHECKODD	(0x80 << OP_ALG_AAI_SHIFT)
1206 #define OP_ALG_AAI_DK		(0x100 << OP_ALG_AAI_SHIFT)
1207 
1208 /* randomizer AAI set */
1209 #define OP_ALG_AAI_RNG		(0x00 << OP_ALG_AAI_SHIFT)
1210 #define OP_ALG_AAI_RNG_NZB	(0x10 << OP_ALG_AAI_SHIFT)
1211 #define OP_ALG_AAI_RNG_OBP	(0x20 << OP_ALG_AAI_SHIFT)
1212 
1213 /* RNG4 AAI set */
1214 #define OP_ALG_AAI_RNG4_SH_0	(0x00 << OP_ALG_AAI_SHIFT)
1215 #define OP_ALG_AAI_RNG4_SH_1	(0x01 << OP_ALG_AAI_SHIFT)
1216 #define OP_ALG_AAI_RNG4_PS	(0x40 << OP_ALG_AAI_SHIFT)
1217 #define OP_ALG_AAI_RNG4_AI	(0x80 << OP_ALG_AAI_SHIFT)
1218 #define OP_ALG_AAI_RNG4_SK	(0x100 << OP_ALG_AAI_SHIFT)
1219 
1220 /* Chacha20 AAI set */
1221 #define OP_ALG_AAI_AEAD	(0x002 << OP_ALG_AAI_SHIFT)
1222 #define OP_ALG_AAI_KEYSTREAM	(0x001 << OP_ALG_AAI_SHIFT)
1223 #define OP_ALG_AAI_BC8		(0x008 << OP_ALG_AAI_SHIFT)
1224 
1225 /* hmac/smac AAI set */
1226 #define OP_ALG_AAI_HASH		(0x00 << OP_ALG_AAI_SHIFT)
1227 #define OP_ALG_AAI_HMAC		(0x01 << OP_ALG_AAI_SHIFT)
1228 #define OP_ALG_AAI_SMAC		(0x02 << OP_ALG_AAI_SHIFT)
1229 #define OP_ALG_AAI_HMAC_PRECOMP	(0x04 << OP_ALG_AAI_SHIFT)
1230 
1231 /* CRC AAI set*/
1232 #define OP_ALG_AAI_802		(0x01 << OP_ALG_AAI_SHIFT)
1233 #define OP_ALG_AAI_3385		(0x02 << OP_ALG_AAI_SHIFT)
1234 #define OP_ALG_AAI_CUST_POLY	(0x04 << OP_ALG_AAI_SHIFT)
1235 #define OP_ALG_AAI_DIS		(0x10 << OP_ALG_AAI_SHIFT)
1236 #define OP_ALG_AAI_DOS		(0x20 << OP_ALG_AAI_SHIFT)
1237 #define OP_ALG_AAI_DOC		(0x40 << OP_ALG_AAI_SHIFT)
1238 
1239 /* Kasumi/SNOW AAI set */
1240 #define OP_ALG_AAI_F8		(0xc0 << OP_ALG_AAI_SHIFT)
1241 #define OP_ALG_AAI_F9		(0xc8 << OP_ALG_AAI_SHIFT)
1242 #define OP_ALG_AAI_GSM		(0x10 << OP_ALG_AAI_SHIFT)
1243 #define OP_ALG_AAI_EDGE		(0x20 << OP_ALG_AAI_SHIFT)
1244 
1245 #define OP_ALG_AS_SHIFT		2
1246 #define OP_ALG_AS_MASK		(0x3 << OP_ALG_AS_SHIFT)
1247 #define OP_ALG_AS_UPDATE	(0 << OP_ALG_AS_SHIFT)
1248 #define OP_ALG_AS_INIT		(1 << OP_ALG_AS_SHIFT)
1249 #define OP_ALG_AS_FINALIZE	(2 << OP_ALG_AS_SHIFT)
1250 #define OP_ALG_AS_INITFINAL	(3 << OP_ALG_AS_SHIFT)
1251 
1252 #define OP_ALG_ICV_SHIFT	1
1253 #define OP_ALG_ICV_MASK		(1 << OP_ALG_ICV_SHIFT)
1254 #define OP_ALG_ICV_OFF		(0 << OP_ALG_ICV_SHIFT)
1255 #define OP_ALG_ICV_ON		(1 << OP_ALG_ICV_SHIFT)
1256 
1257 #define OP_ALG_PR_ON		BIT(1)
1258 
1259 #define OP_ALG_DIR_SHIFT	0
1260 #define OP_ALG_DIR_MASK		1
1261 #define OP_ALG_DECRYPT		0
1262 #define OP_ALG_ENCRYPT		1
1263 
1264 /* PKHA algorithm type set */
1265 #define OP_ALG_PK		0x00800000
1266 #define OP_ALG_PK_FUN_MASK	0x3f /* clrmem, modmath, or cpymem */
1267 
1268 /* PKHA mode clear memory functions */
1269 #define OP_ALG_PKMODE_A_RAM	0x80000
1270 #define OP_ALG_PKMODE_B_RAM	0x40000
1271 #define OP_ALG_PKMODE_E_RAM	0x20000
1272 #define OP_ALG_PKMODE_N_RAM	0x10000
1273 #define OP_ALG_PKMODE_CLEARMEM	0x00001
1274 
1275 /* PKHA mode modular-arithmetic functions */
1276 #define OP_ALG_PKMODE_MOD_IN_MONTY	0x80000
1277 #define OP_ALG_PKMODE_MOD_OUT_MONTY	0x40000
1278 #define OP_ALG_PKMODE_MOD_F2M		0x20000
1279 #define OP_ALG_PKMODE_MOD_R2_IN		0x10000
1280 #define OP_ALG_PKMODE_PRJECTV		0x00800
1281 #define OP_ALG_PKMODE_TIME_EQ		0x400
1282 #define OP_ALG_PKMODE_OUT_B		0x000
1283 #define OP_ALG_PKMODE_OUT_A		0x100
1284 #define OP_ALG_PKMODE_MOD_ADD		0x002
1285 #define OP_ALG_PKMODE_MOD_SUB_AB	0x003
1286 #define OP_ALG_PKMODE_MOD_SUB_BA	0x004
1287 #define OP_ALG_PKMODE_MOD_MULT		0x005
1288 #define OP_ALG_PKMODE_MOD_EXPO		0x006
1289 #define OP_ALG_PKMODE_MOD_REDUCT	0x007
1290 #define OP_ALG_PKMODE_MOD_INV		0x008
1291 #define OP_ALG_PKMODE_MOD_ECC_ADD	0x009
1292 #define OP_ALG_PKMODE_MOD_ECC_DBL	0x00a
1293 #define OP_ALG_PKMODE_MOD_ECC_MULT	0x00b
1294 #define OP_ALG_PKMODE_MOD_MONT_CNST	0x00c
1295 #define OP_ALG_PKMODE_MOD_CRT_CNST	0x00d
1296 #define OP_ALG_PKMODE_MOD_GCD		0x00e
1297 #define OP_ALG_PKMODE_MOD_PRIMALITY	0x00f
1298 
1299 /* PKHA mode copy-memory functions */
1300 #define OP_ALG_PKMODE_SRC_REG_SHIFT	17
1301 #define OP_ALG_PKMODE_SRC_REG_MASK	(7 << OP_ALG_PKMODE_SRC_REG_SHIFT)
1302 #define OP_ALG_PKMODE_DST_REG_SHIFT	10
1303 #define OP_ALG_PKMODE_DST_REG_MASK	(7 << OP_ALG_PKMODE_DST_REG_SHIFT)
1304 #define OP_ALG_PKMODE_SRC_SEG_SHIFT	8
1305 #define OP_ALG_PKMODE_SRC_SEG_MASK	(3 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
1306 #define OP_ALG_PKMODE_DST_SEG_SHIFT	6
1307 #define OP_ALG_PKMODE_DST_SEG_MASK	(3 << OP_ALG_PKMODE_DST_SEG_SHIFT)
1308 
1309 #define OP_ALG_PKMODE_SRC_REG_A		(0 << OP_ALG_PKMODE_SRC_REG_SHIFT)
1310 #define OP_ALG_PKMODE_SRC_REG_B		(1 << OP_ALG_PKMODE_SRC_REG_SHIFT)
1311 #define OP_ALG_PKMODE_SRC_REG_N		(3 << OP_ALG_PKMODE_SRC_REG_SHIFT)
1312 #define OP_ALG_PKMODE_DST_REG_A		(0 << OP_ALG_PKMODE_DST_REG_SHIFT)
1313 #define OP_ALG_PKMODE_DST_REG_B		(1 << OP_ALG_PKMODE_DST_REG_SHIFT)
1314 #define OP_ALG_PKMODE_DST_REG_E		(2 << OP_ALG_PKMODE_DST_REG_SHIFT)
1315 #define OP_ALG_PKMODE_DST_REG_N		(3 << OP_ALG_PKMODE_DST_REG_SHIFT)
1316 #define OP_ALG_PKMODE_SRC_SEG_0		(0 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
1317 #define OP_ALG_PKMODE_SRC_SEG_1		(1 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
1318 #define OP_ALG_PKMODE_SRC_SEG_2		(2 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
1319 #define OP_ALG_PKMODE_SRC_SEG_3		(3 << OP_ALG_PKMODE_SRC_SEG_SHIFT)
1320 #define OP_ALG_PKMODE_DST_SEG_0		(0 << OP_ALG_PKMODE_DST_SEG_SHIFT)
1321 #define OP_ALG_PKMODE_DST_SEG_1		(1 << OP_ALG_PKMODE_DST_SEG_SHIFT)
1322 #define OP_ALG_PKMODE_DST_SEG_2		(2 << OP_ALG_PKMODE_DST_SEG_SHIFT)
1323 #define OP_ALG_PKMODE_DST_SEG_3		(3 << OP_ALG_PKMODE_DST_SEG_SHIFT)
1324 #define OP_ALG_PKMODE_CPYMEM_N_SZ	0x80
1325 #define OP_ALG_PKMODE_CPYMEM_SRC_SZ	0x81
1326 
1327 /*
1328  * SEQ_IN_PTR Command Constructs
1329  */
1330 
1331 /* Release Buffers */
1332 #define SQIN_RBS	0x04000000
1333 
1334 /* Sequence pointer is really a descriptor */
1335 #define SQIN_INL	0x02000000
1336 
1337 /* Sequence pointer is a scatter-gather table */
1338 #define SQIN_SGF	0x01000000
1339 
1340 /* Appends to a previous pointer */
1341 #define SQIN_PRE	0x00800000
1342 
1343 /* Use extended length following pointer */
1344 #define SQIN_EXT	0x00400000
1345 
1346 /* Restore sequence with pointer/length */
1347 #define SQIN_RTO	0x00200000
1348 
1349 /* Replace job descriptor */
1350 #define SQIN_RJD	0x00100000
1351 
1352 #define SQIN_LEN_SHIFT		 0
1353 #define SQIN_LEN_MASK		(0xffff << SQIN_LEN_SHIFT)
1354 
1355 /*
1356  * SEQ_OUT_PTR Command Constructs
1357  */
1358 
1359 /* Sequence pointer is a scatter-gather table */
1360 #define SQOUT_SGF	0x01000000
1361 
1362 /* Appends to a previous pointer */
1363 #define SQOUT_PRE	SQIN_PRE
1364 
1365 /* Restore sequence with pointer/length */
1366 #define SQOUT_RTO	 SQIN_RTO
1367 
1368 /* Use extended length following pointer */
1369 #define SQOUT_EXT	0x00400000
1370 
1371 #define SQOUT_LEN_SHIFT		0
1372 #define SQOUT_LEN_MASK		(0xffff << SQOUT_LEN_SHIFT)
1373 
1374 
1375 /*
1376  * SIGNATURE Command Constructs
1377  */
1378 
1379 /* TYPE field is all that's relevant */
1380 #define SIGN_TYPE_SHIFT		16
1381 #define SIGN_TYPE_MASK		(0x0f << SIGN_TYPE_SHIFT)
1382 
1383 #define SIGN_TYPE_FINAL		(0x00 << SIGN_TYPE_SHIFT)
1384 #define SIGN_TYPE_FINAL_RESTORE (0x01 << SIGN_TYPE_SHIFT)
1385 #define SIGN_TYPE_FINAL_NONZERO (0x02 << SIGN_TYPE_SHIFT)
1386 #define SIGN_TYPE_IMM_2		(0x0a << SIGN_TYPE_SHIFT)
1387 #define SIGN_TYPE_IMM_3		(0x0b << SIGN_TYPE_SHIFT)
1388 #define SIGN_TYPE_IMM_4		(0x0c << SIGN_TYPE_SHIFT)
1389 
1390 /*
1391  * MOVE Command Constructs
1392  */
1393 
1394 #define MOVE_AUX_SHIFT		25
1395 #define MOVE_AUX_MASK		(3 << MOVE_AUX_SHIFT)
1396 #define MOVE_AUX_MS		(2 << MOVE_AUX_SHIFT)
1397 #define MOVE_AUX_LS		(1 << MOVE_AUX_SHIFT)
1398 
1399 #define MOVE_WAITCOMP_SHIFT	24
1400 #define MOVE_WAITCOMP_MASK	(1 << MOVE_WAITCOMP_SHIFT)
1401 #define MOVE_WAITCOMP		(1 << MOVE_WAITCOMP_SHIFT)
1402 
1403 #define MOVE_SRC_SHIFT		20
1404 #define MOVE_SRC_MASK		(0x0f << MOVE_SRC_SHIFT)
1405 #define MOVE_SRC_CLASS1CTX	(0x00 << MOVE_SRC_SHIFT)
1406 #define MOVE_SRC_CLASS2CTX	(0x01 << MOVE_SRC_SHIFT)
1407 #define MOVE_SRC_OUTFIFO	(0x02 << MOVE_SRC_SHIFT)
1408 #define MOVE_SRC_DESCBUF	(0x03 << MOVE_SRC_SHIFT)
1409 #define MOVE_SRC_MATH0		(0x04 << MOVE_SRC_SHIFT)
1410 #define MOVE_SRC_MATH1		(0x05 << MOVE_SRC_SHIFT)
1411 #define MOVE_SRC_MATH2		(0x06 << MOVE_SRC_SHIFT)
1412 #define MOVE_SRC_MATH3		(0x07 << MOVE_SRC_SHIFT)
1413 #define MOVE_SRC_INFIFO		(0x08 << MOVE_SRC_SHIFT)
1414 #define MOVE_SRC_INFIFO_CL	(0x09 << MOVE_SRC_SHIFT)
1415 #define MOVE_SRC_AUX_ABLK	(0x0a << MOVE_SRC_SHIFT)
1416 
1417 #define MOVE_DEST_SHIFT		16
1418 #define MOVE_DEST_MASK		(0x0f << MOVE_DEST_SHIFT)
1419 #define MOVE_DEST_CLASS1CTX	(0x00 << MOVE_DEST_SHIFT)
1420 #define MOVE_DEST_CLASS2CTX	(0x01 << MOVE_DEST_SHIFT)
1421 #define MOVE_DEST_OUTFIFO	(0x02 << MOVE_DEST_SHIFT)
1422 #define MOVE_DEST_DESCBUF	(0x03 << MOVE_DEST_SHIFT)
1423 #define MOVE_DEST_MATH0		(0x04 << MOVE_DEST_SHIFT)
1424 #define MOVE_DEST_MATH1		(0x05 << MOVE_DEST_SHIFT)
1425 #define MOVE_DEST_MATH2		(0x06 << MOVE_DEST_SHIFT)
1426 #define MOVE_DEST_MATH3		(0x07 << MOVE_DEST_SHIFT)
1427 #define MOVE_DEST_CLASS1INFIFO	(0x08 << MOVE_DEST_SHIFT)
1428 #define MOVE_DEST_CLASS2INFIFO	(0x09 << MOVE_DEST_SHIFT)
1429 #define MOVE_DEST_INFIFO_NOINFO (0x0a << MOVE_DEST_SHIFT)
1430 #define MOVE_DEST_PK_A		(0x0c << MOVE_DEST_SHIFT)
1431 #define MOVE_DEST_CLASS1KEY	(0x0d << MOVE_DEST_SHIFT)
1432 #define MOVE_DEST_CLASS2KEY	(0x0e << MOVE_DEST_SHIFT)
1433 
1434 #define MOVE_OFFSET_SHIFT	8
1435 #define MOVE_OFFSET_MASK	(0xff << MOVE_OFFSET_SHIFT)
1436 
1437 #define MOVE_LEN_SHIFT		0
1438 #define MOVE_LEN_MASK		(0xff << MOVE_LEN_SHIFT)
1439 
1440 #define MOVELEN_MRSEL_SHIFT	0
1441 #define MOVELEN_MRSEL_MASK	(0x3 << MOVE_LEN_SHIFT)
1442 #define MOVELEN_MRSEL_MATH0	(0 << MOVELEN_MRSEL_SHIFT)
1443 #define MOVELEN_MRSEL_MATH1	(1 << MOVELEN_MRSEL_SHIFT)
1444 #define MOVELEN_MRSEL_MATH2	(2 << MOVELEN_MRSEL_SHIFT)
1445 #define MOVELEN_MRSEL_MATH3	(3 << MOVELEN_MRSEL_SHIFT)
1446 
1447 /*
1448  * MATH Command Constructs
1449  */
1450 
1451 #define MATH_IFB_SHIFT		26
1452 #define MATH_IFB_MASK		(1 << MATH_IFB_SHIFT)
1453 #define MATH_IFB		(1 << MATH_IFB_SHIFT)
1454 
1455 #define MATH_NFU_SHIFT		25
1456 #define MATH_NFU_MASK		(1 << MATH_NFU_SHIFT)
1457 #define MATH_NFU		(1 << MATH_NFU_SHIFT)
1458 
1459 #define MATH_STL_SHIFT		24
1460 #define MATH_STL_MASK		(1 << MATH_STL_SHIFT)
1461 #define MATH_STL		(1 << MATH_STL_SHIFT)
1462 
1463 /* Function selectors */
1464 #define MATH_FUN_SHIFT		20
1465 #define MATH_FUN_MASK		(0x0f << MATH_FUN_SHIFT)
1466 #define MATH_FUN_ADD		(0x00 << MATH_FUN_SHIFT)
1467 #define MATH_FUN_ADDC		(0x01 << MATH_FUN_SHIFT)
1468 #define MATH_FUN_SUB		(0x02 << MATH_FUN_SHIFT)
1469 #define MATH_FUN_SUBB		(0x03 << MATH_FUN_SHIFT)
1470 #define MATH_FUN_OR		(0x04 << MATH_FUN_SHIFT)
1471 #define MATH_FUN_AND		(0x05 << MATH_FUN_SHIFT)
1472 #define MATH_FUN_XOR		(0x06 << MATH_FUN_SHIFT)
1473 #define MATH_FUN_LSHIFT		(0x07 << MATH_FUN_SHIFT)
1474 #define MATH_FUN_RSHIFT		(0x08 << MATH_FUN_SHIFT)
1475 #define MATH_FUN_SHLD		(0x09 << MATH_FUN_SHIFT)
1476 #define MATH_FUN_ZBYT		(0x0a << MATH_FUN_SHIFT)
1477 
1478 /* Source 0 selectors */
1479 #define MATH_SRC0_SHIFT		16
1480 #define MATH_SRC0_MASK		(0x0f << MATH_SRC0_SHIFT)
1481 #define MATH_SRC0_REG0		(0x00 << MATH_SRC0_SHIFT)
1482 #define MATH_SRC0_REG1		(0x01 << MATH_SRC0_SHIFT)
1483 #define MATH_SRC0_REG2		(0x02 << MATH_SRC0_SHIFT)
1484 #define MATH_SRC0_REG3		(0x03 << MATH_SRC0_SHIFT)
1485 #define MATH_SRC0_IMM		(0x04 << MATH_SRC0_SHIFT)
1486 #define MATH_SRC0_DPOVRD	(0x07 << MATH_SRC0_SHIFT)
1487 #define MATH_SRC0_SEQINLEN	(0x08 << MATH_SRC0_SHIFT)
1488 #define MATH_SRC0_SEQOUTLEN	(0x09 << MATH_SRC0_SHIFT)
1489 #define MATH_SRC0_VARSEQINLEN	(0x0a << MATH_SRC0_SHIFT)
1490 #define MATH_SRC0_VARSEQOUTLEN	(0x0b << MATH_SRC0_SHIFT)
1491 #define MATH_SRC0_ZERO		(0x0c << MATH_SRC0_SHIFT)
1492 
1493 /* Source 1 selectors */
1494 #define MATH_SRC1_SHIFT		12
1495 #define MATH_SRC1_MASK		(0x0f << MATH_SRC1_SHIFT)
1496 #define MATH_SRC1_REG0		(0x00 << MATH_SRC1_SHIFT)
1497 #define MATH_SRC1_REG1		(0x01 << MATH_SRC1_SHIFT)
1498 #define MATH_SRC1_REG2		(0x02 << MATH_SRC1_SHIFT)
1499 #define MATH_SRC1_REG3		(0x03 << MATH_SRC1_SHIFT)
1500 #define MATH_SRC1_IMM		(0x04 << MATH_SRC1_SHIFT)
1501 #define MATH_SRC1_DPOVRD	(0x07 << MATH_SRC1_SHIFT)
1502 #define MATH_SRC1_INFIFO	(0x0a << MATH_SRC1_SHIFT)
1503 #define MATH_SRC1_OUTFIFO	(0x0b << MATH_SRC1_SHIFT)
1504 #define MATH_SRC1_ONE		(0x0c << MATH_SRC1_SHIFT)
1505 
1506 /* Destination selectors */
1507 #define MATH_DEST_SHIFT		8
1508 #define MATH_DEST_MASK		(0x0f << MATH_DEST_SHIFT)
1509 #define MATH_DEST_REG0		(0x00 << MATH_DEST_SHIFT)
1510 #define MATH_DEST_REG1		(0x01 << MATH_DEST_SHIFT)
1511 #define MATH_DEST_REG2		(0x02 << MATH_DEST_SHIFT)
1512 #define MATH_DEST_REG3		(0x03 << MATH_DEST_SHIFT)
1513 #define MATH_DEST_DPOVRD	(0x07 << MATH_DEST_SHIFT)
1514 #define MATH_DEST_SEQINLEN	(0x08 << MATH_DEST_SHIFT)
1515 #define MATH_DEST_SEQOUTLEN	(0x09 << MATH_DEST_SHIFT)
1516 #define MATH_DEST_VARSEQINLEN	(0x0a << MATH_DEST_SHIFT)
1517 #define MATH_DEST_VARSEQOUTLEN	(0x0b << MATH_DEST_SHIFT)
1518 #define MATH_DEST_NONE		(0x0f << MATH_DEST_SHIFT)
1519 
1520 /* Length selectors */
1521 #define MATH_LEN_SHIFT		0
1522 #define MATH_LEN_MASK		(0x0f << MATH_LEN_SHIFT)
1523 #define MATH_LEN_1BYTE		0x01
1524 #define MATH_LEN_2BYTE		0x02
1525 #define MATH_LEN_4BYTE		0x04
1526 #define MATH_LEN_8BYTE		0x08
1527 
1528 /*
1529  * JUMP Command Constructs
1530  */
1531 
1532 #define JUMP_CLASS_SHIFT	25
1533 #define JUMP_CLASS_MASK		(3 << JUMP_CLASS_SHIFT)
1534 #define JUMP_CLASS_NONE		0
1535 #define JUMP_CLASS_CLASS1	(1 << JUMP_CLASS_SHIFT)
1536 #define JUMP_CLASS_CLASS2	(2 << JUMP_CLASS_SHIFT)
1537 #define JUMP_CLASS_BOTH		(3 << JUMP_CLASS_SHIFT)
1538 
1539 #define JUMP_JSL_SHIFT		24
1540 #define JUMP_JSL_MASK		(1 << JUMP_JSL_SHIFT)
1541 #define JUMP_JSL		(1 << JUMP_JSL_SHIFT)
1542 
1543 #define JUMP_TYPE_SHIFT		22
1544 #define JUMP_TYPE_LOCAL		(0x00 << JUMP_TYPE_SHIFT)
1545 #define JUMP_TYPE_NONLOCAL	(0x01 << JUMP_TYPE_SHIFT)
1546 #define JUMP_TYPE_HALT		(0x02 << JUMP_TYPE_SHIFT)
1547 #define JUMP_TYPE_HALT_USER	(0x03 << JUMP_TYPE_SHIFT)
1548 
1549 #define JUMP_TEST_SHIFT		16
1550 #define JUMP_TEST_MASK		(0x03 << JUMP_TEST_SHIFT)
1551 #define JUMP_TEST_ALL		(0x00 << JUMP_TEST_SHIFT)
1552 #define JUMP_TEST_INVALL	(0x01 << JUMP_TEST_SHIFT)
1553 #define JUMP_TEST_ANY		(0x02 << JUMP_TEST_SHIFT)
1554 #define JUMP_TEST_INVANY	(0x03 << JUMP_TEST_SHIFT)
1555 
1556 /* Condition codes. JSL bit is factored in */
1557 #define JUMP_COND_SHIFT		8
1558 #define JUMP_COND_MASK		(0x100ff << JUMP_COND_SHIFT)
1559 #define JUMP_COND_PK_0		(0x80 << JUMP_COND_SHIFT)
1560 #define JUMP_COND_PK_GCD_1	(0x40 << JUMP_COND_SHIFT)
1561 #define JUMP_COND_PK_PRIME	(0x20 << JUMP_COND_SHIFT)
1562 #define JUMP_COND_MATH_N	(0x08 << JUMP_COND_SHIFT)
1563 #define JUMP_COND_MATH_Z	(0x04 << JUMP_COND_SHIFT)
1564 #define JUMP_COND_MATH_C	(0x02 << JUMP_COND_SHIFT)
1565 #define JUMP_COND_MATH_NV	(0x01 << JUMP_COND_SHIFT)
1566 
1567 #define JUMP_COND_JRP		((0x80 << JUMP_COND_SHIFT) | JUMP_JSL)
1568 #define JUMP_COND_SHRD		((0x40 << JUMP_COND_SHIFT) | JUMP_JSL)
1569 #define JUMP_COND_SELF		((0x20 << JUMP_COND_SHIFT) | JUMP_JSL)
1570 #define JUMP_COND_CALM		((0x10 << JUMP_COND_SHIFT) | JUMP_JSL)
1571 #define JUMP_COND_NIP		((0x08 << JUMP_COND_SHIFT) | JUMP_JSL)
1572 #define JUMP_COND_NIFP		((0x04 << JUMP_COND_SHIFT) | JUMP_JSL)
1573 #define JUMP_COND_NOP		((0x02 << JUMP_COND_SHIFT) | JUMP_JSL)
1574 #define JUMP_COND_NCP		((0x01 << JUMP_COND_SHIFT) | JUMP_JSL)
1575 
1576 #define JUMP_OFFSET_SHIFT	0
1577 #define JUMP_OFFSET_MASK	(0xff << JUMP_OFFSET_SHIFT)
1578 
1579 /*
1580  * NFIFO ENTRY
1581  * Data Constructs
1582  *
1583  */
1584 #define NFIFOENTRY_DEST_SHIFT	30
1585 #define NFIFOENTRY_DEST_MASK	(3 << NFIFOENTRY_DEST_SHIFT)
1586 #define NFIFOENTRY_DEST_DECO	(0 << NFIFOENTRY_DEST_SHIFT)
1587 #define NFIFOENTRY_DEST_CLASS1	(1 << NFIFOENTRY_DEST_SHIFT)
1588 #define NFIFOENTRY_DEST_CLASS2	(2 << NFIFOENTRY_DEST_SHIFT)
1589 #define NFIFOENTRY_DEST_BOTH	(3 << NFIFOENTRY_DEST_SHIFT)
1590 
1591 #define NFIFOENTRY_LC2_SHIFT	29
1592 #define NFIFOENTRY_LC2_MASK	(1 << NFIFOENTRY_LC2_SHIFT)
1593 #define NFIFOENTRY_LC2		(1 << NFIFOENTRY_LC2_SHIFT)
1594 
1595 #define NFIFOENTRY_LC1_SHIFT	28
1596 #define NFIFOENTRY_LC1_MASK	(1 << NFIFOENTRY_LC1_SHIFT)
1597 #define NFIFOENTRY_LC1		(1 << NFIFOENTRY_LC1_SHIFT)
1598 
1599 #define NFIFOENTRY_FC2_SHIFT	27
1600 #define NFIFOENTRY_FC2_MASK	(1 << NFIFOENTRY_FC2_SHIFT)
1601 #define NFIFOENTRY_FC2		(1 << NFIFOENTRY_FC2_SHIFT)
1602 
1603 #define NFIFOENTRY_FC1_SHIFT	26
1604 #define NFIFOENTRY_FC1_MASK	(1 << NFIFOENTRY_FC1_SHIFT)
1605 #define NFIFOENTRY_FC1		(1 << NFIFOENTRY_FC1_SHIFT)
1606 
1607 #define NFIFOENTRY_STYPE_SHIFT	24
1608 #define NFIFOENTRY_STYPE_MASK	(3 << NFIFOENTRY_STYPE_SHIFT)
1609 #define NFIFOENTRY_STYPE_DFIFO	(0 << NFIFOENTRY_STYPE_SHIFT)
1610 #define NFIFOENTRY_STYPE_OFIFO	(1 << NFIFOENTRY_STYPE_SHIFT)
1611 #define NFIFOENTRY_STYPE_PAD	(2 << NFIFOENTRY_STYPE_SHIFT)
1612 #define NFIFOENTRY_STYPE_SNOOP	(3 << NFIFOENTRY_STYPE_SHIFT)
1613 
1614 #define NFIFOENTRY_DTYPE_SHIFT	20
1615 #define NFIFOENTRY_DTYPE_MASK	(0xF << NFIFOENTRY_DTYPE_SHIFT)
1616 
1617 #define NFIFOENTRY_DTYPE_SBOX	(0x0 << NFIFOENTRY_DTYPE_SHIFT)
1618 #define NFIFOENTRY_DTYPE_AAD	(0x1 << NFIFOENTRY_DTYPE_SHIFT)
1619 #define NFIFOENTRY_DTYPE_IV	(0x2 << NFIFOENTRY_DTYPE_SHIFT)
1620 #define NFIFOENTRY_DTYPE_SAD	(0x3 << NFIFOENTRY_DTYPE_SHIFT)
1621 #define NFIFOENTRY_DTYPE_ICV	(0xA << NFIFOENTRY_DTYPE_SHIFT)
1622 #define NFIFOENTRY_DTYPE_POLY	(0xB << NFIFOENTRY_DTYPE_SHIFT)
1623 #define NFIFOENTRY_DTYPE_SKIP	(0xE << NFIFOENTRY_DTYPE_SHIFT)
1624 #define NFIFOENTRY_DTYPE_MSG	(0xF << NFIFOENTRY_DTYPE_SHIFT)
1625 
1626 #define NFIFOENTRY_DTYPE_PK_A0	(0x0 << NFIFOENTRY_DTYPE_SHIFT)
1627 #define NFIFOENTRY_DTYPE_PK_A1	(0x1 << NFIFOENTRY_DTYPE_SHIFT)
1628 #define NFIFOENTRY_DTYPE_PK_A2	(0x2 << NFIFOENTRY_DTYPE_SHIFT)
1629 #define NFIFOENTRY_DTYPE_PK_A3	(0x3 << NFIFOENTRY_DTYPE_SHIFT)
1630 #define NFIFOENTRY_DTYPE_PK_B0	(0x4 << NFIFOENTRY_DTYPE_SHIFT)
1631 #define NFIFOENTRY_DTYPE_PK_B1	(0x5 << NFIFOENTRY_DTYPE_SHIFT)
1632 #define NFIFOENTRY_DTYPE_PK_B2	(0x6 << NFIFOENTRY_DTYPE_SHIFT)
1633 #define NFIFOENTRY_DTYPE_PK_B3	(0x7 << NFIFOENTRY_DTYPE_SHIFT)
1634 #define NFIFOENTRY_DTYPE_PK_N	(0x8 << NFIFOENTRY_DTYPE_SHIFT)
1635 #define NFIFOENTRY_DTYPE_PK_E	(0x9 << NFIFOENTRY_DTYPE_SHIFT)
1636 #define NFIFOENTRY_DTYPE_PK_A	(0xC << NFIFOENTRY_DTYPE_SHIFT)
1637 #define NFIFOENTRY_DTYPE_PK_B	(0xD << NFIFOENTRY_DTYPE_SHIFT)
1638 
1639 
1640 #define NFIFOENTRY_BND_SHIFT	19
1641 #define NFIFOENTRY_BND_MASK	(1 << NFIFOENTRY_BND_SHIFT)
1642 #define NFIFOENTRY_BND		(1 << NFIFOENTRY_BND_SHIFT)
1643 
1644 #define NFIFOENTRY_PTYPE_SHIFT	16
1645 #define NFIFOENTRY_PTYPE_MASK	(0x7 << NFIFOENTRY_PTYPE_SHIFT)
1646 
1647 #define NFIFOENTRY_PTYPE_ZEROS		(0x0 << NFIFOENTRY_PTYPE_SHIFT)
1648 #define NFIFOENTRY_PTYPE_RND_NOZEROS	(0x1 << NFIFOENTRY_PTYPE_SHIFT)
1649 #define NFIFOENTRY_PTYPE_INCREMENT	(0x2 << NFIFOENTRY_PTYPE_SHIFT)
1650 #define NFIFOENTRY_PTYPE_RND		(0x3 << NFIFOENTRY_PTYPE_SHIFT)
1651 #define NFIFOENTRY_PTYPE_ZEROS_NZ	(0x4 << NFIFOENTRY_PTYPE_SHIFT)
1652 #define NFIFOENTRY_PTYPE_RND_NZ_LZ	(0x5 << NFIFOENTRY_PTYPE_SHIFT)
1653 #define NFIFOENTRY_PTYPE_N		(0x6 << NFIFOENTRY_PTYPE_SHIFT)
1654 #define NFIFOENTRY_PTYPE_RND_NZ_N	(0x7 << NFIFOENTRY_PTYPE_SHIFT)
1655 
1656 #define NFIFOENTRY_OC_SHIFT	15
1657 #define NFIFOENTRY_OC_MASK	(1 << NFIFOENTRY_OC_SHIFT)
1658 #define NFIFOENTRY_OC		(1 << NFIFOENTRY_OC_SHIFT)
1659 
1660 #define NFIFOENTRY_AST_SHIFT	14
1661 #define NFIFOENTRY_AST_MASK	(1 << NFIFOENTRY_OC_SHIFT)
1662 #define NFIFOENTRY_AST		(1 << NFIFOENTRY_OC_SHIFT)
1663 
1664 #define NFIFOENTRY_BM_SHIFT	11
1665 #define NFIFOENTRY_BM_MASK	(1 << NFIFOENTRY_BM_SHIFT)
1666 #define NFIFOENTRY_BM		(1 << NFIFOENTRY_BM_SHIFT)
1667 
1668 #define NFIFOENTRY_PS_SHIFT	10
1669 #define NFIFOENTRY_PS_MASK	(1 << NFIFOENTRY_PS_SHIFT)
1670 #define NFIFOENTRY_PS		(1 << NFIFOENTRY_PS_SHIFT)
1671 
1672 #define NFIFOENTRY_DLEN_SHIFT	0
1673 #define NFIFOENTRY_DLEN_MASK	(0xFFF << NFIFOENTRY_DLEN_SHIFT)
1674 
1675 #define NFIFOENTRY_PLEN_SHIFT	0
1676 #define NFIFOENTRY_PLEN_MASK	(0xFF << NFIFOENTRY_PLEN_SHIFT)
1677 
1678 /* Append Load Immediate Command */
1679 #define FD_CMD_APPEND_LOAD_IMMEDIATE			0x80000000
1680 
1681 /* Set SEQ LIODN equal to the Non-SEQ LIODN for the job */
1682 #define FD_CMD_SET_SEQ_LIODN_EQUAL_NONSEQ_LIODN		0x40000000
1683 
1684 /* Frame Descriptor Command for Replacement Job Descriptor */
1685 #define FD_CMD_REPLACE_JOB_DESC				0x20000000
1686 
1687 #endif /* DESC_H */
1688