xref: /dpdk/drivers/compress/octeontx/include/zip_regs.h (revision 938f3f5f9048a6f7e48ad4d120ec60d7d37ac4d2)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Cavium, Inc
3  */
4 
5 #ifndef _RTE_OCTEONTX_ZIP_REGS_H_
6 #define _RTE_OCTEONTX_ZIP_REGS_H_
7 
8 
9 /**
10  * Enumeration zip_cc
11  *
12  * ZIP compression coding Enumeration
13  * Enumerates ZIP_INST_S[CC].
14  */
15 enum zip_cc {
16 	ZIP_CC_DEFAULT = 0,
17 	ZIP_CC_DYN_HUFF,
18 	ZIP_CC_FIXED_HUFF,
19 	ZIP_CC_LZS
20 };
21 
22 /**
23  * Register (NCB) zip_vq#_ena
24  *
25  * ZIP VF Queue Enable Register
26  * If a queue is disabled, ZIP CTL stops fetching instructions from the queue.
27  */
28 typedef union {
29 	uint64_t u;
30 	struct zip_vqx_ena_s {
31 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
32 		uint64_t reserved_1_63         : 63;
33 		uint64_t ena                   : 1;
34 #else /* Word 0 - Little Endian */
35 		uint64_t ena                   : 1;
36 		uint64_t reserved_1_63         : 63;
37 #endif /* Word 0 - End */
38 	} s;
39 } zip_vqx_ena_t;
40 
41 /**
42  * Register (NCB) zip_vq#_sbuf_addr
43  *
44  * ZIP VF Queue Starting Buffer Address Registers
45  * These registers set the buffer parameters for the instruction queues.
46  * When quiescent (i.e.
47  * outstanding doorbell count is 0), it is safe to rewrite this register
48  * to effectively reset the
49  * command buffer state machine.
50  * These registers must be programmed after software programs the
51  * corresponding ZIP_QUE()_SBUF_CTL.
52  */
53 typedef union {
54 	uint64_t u;
55 	struct zip_vqx_sbuf_addr_s {
56 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
57 		uint64_t reserved_49_63        : 15;
58 		uint64_t ptr                   : 42;
59 		uint64_t off                   : 7;
60 #else /* Word 0 - Little Endian */
61 		uint64_t off                   : 7;
62 		uint64_t ptr                   : 42;
63 		uint64_t reserved_49_63        : 15;
64 #endif /* Word 0 - End */
65 	} s;
66 
67 	struct zip_vqx_sbuf_addr_s9x {
68 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
69 		uint64_t reserved_53_63        : 11;
70 		uint64_t ptr                   : 46;
71 		uint64_t off                   : 7;
72 #else /* Word 0 - Little Endian */
73 		uint64_t off                   : 7;
74 		uint64_t ptr                   : 46;
75 		uint64_t reserved_53_63        : 11;
76 #endif /* Word 0 - End */
77 	} s9x;
78 } zip_vqx_sbuf_addr_t;
79 
80 /**
81  * Register (NCB) zip_que#_doorbell
82  *
83  * ZIP Queue Doorbell Registers
84  * Doorbells for the ZIP instruction queues.
85  */
86 typedef union {
87 	uint64_t u;
88 	struct zip_quex_doorbell_s {
89 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
90 		uint64_t reserved_20_63        : 44;
91 		uint64_t dbell_cnt             : 20;
92 #else /* Word 0 - Little Endian */
93 		uint64_t dbell_cnt             : 20;
94 		uint64_t reserved_20_63        : 44;
95 #endif /* Word 0 - End */
96 	} s;
97 } zip_quex_doorbell_t;
98 
99 /**
100  * Structure zip_nptr_s
101  *
102  * ZIP Instruction Next-Chunk-Buffer Pointer (NPTR) Structure
103  * This structure is used to chain all the ZIP instruction buffers
104  * together. ZIP instruction buffers are managed
105  * (allocated and released) by software.
106  */
107 union zip_nptr_s {
108 	uint64_t u;
109 	struct zip_nptr_s_s {
110 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
111 		uint64_t addr                  : 64;
112 #else /* Word 0 - Little Endian */
113 		uint64_t addr                  : 64;
114 #endif /* Word 0 - End */
115 	} s;
116 };
117 
118 /**
119  * generic ptr address
120  */
121 union zip_zptr_addr_s {
122 	/** This field can be used to set/clear all bits, or do bitwise
123 	 * operations over the entire structure.
124 	 */
125 	uint64_t u;
126 	/** generic ptr address */
127 	struct {
128 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
129 		uint64_t addr : 64;
130 #else /* Word 0 - Little Endian */
131 		uint64_t addr : 64;
132 #endif /* Word 0 - End */
133 	} s;
134 };
135 
136 /**
137  * generic ptr ctl
138  */
139 union zip_zptr_ctl_s {
140 	/** This field can be used to set/clear all bits, or do bitwise
141 	 * operations over the entire structure.
142 	 */
143 	uint64_t u;
144 	/** generic ptr ctl */
145 	struct {
146 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
147 		uint64_t reserved_112_127      : 16;
148 		uint64_t length                : 16;
149 		uint64_t reserved_67_95        : 29;
150 		uint64_t fw                    : 1;
151 		uint64_t nc                    : 1;
152 		uint64_t data_be               : 1;
153 #else /* Word 1 - Little Endian */
154 		uint64_t data_be               : 1;
155 		uint64_t nc                    : 1;
156 		uint64_t fw                    : 1;
157 		uint64_t reserved_67_95        : 29;
158 		uint64_t length                : 16;
159 		uint64_t reserved_112_127      : 16;
160 #endif /* Word 1 - End */
161 	} s;
162 
163 };
164 
165 /**
166  * Structure zip_inst_s
167  *
168  * ZIP Instruction Structure
169  * Each ZIP instruction has 16 words (they are called IWORD0 to IWORD15
170  * within the structure).
171  */
172 union zip_inst_s {
173 	/** This field can be used to set/clear all bits, or do bitwise
174 	 * operations over the entire structure.
175 	 */
176 	uint64_t u[16];
177 	/** ZIP Instruction Structure */
178 	struct zip_inst_s_s {
179 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
180 		/** Done interrupt */
181 		uint64_t doneint               : 1;
182 		/** reserved */
183 		uint64_t reserved_56_62        : 7;
184 		/**  Total output length */
185 		uint64_t totaloutputlength     : 24;
186 		/** reserved */
187 		uint64_t reserved_27_31        : 5;
188 		/** EXNUM */
189 		uint64_t exn                   : 3;
190 		/**  HASH IV */
191 		uint64_t iv                    : 1;
192 		/** EXBITS */
193 		uint64_t exbits                : 7;
194 		/** Hash more-in-file */
195 		uint64_t hmif                  : 1;
196 		/** Hash Algorithm and enable */
197 		uint64_t halg                  : 3;
198 		/** Sync flush*/
199 		uint64_t sf                    : 1;
200 		/** Compression speed/storage */
201 		uint64_t ss                    : 2;
202 		/** Compression coding */
203 		uint64_t cc                    : 2;
204 		/** End of input data */
205 		uint64_t ef                    : 1;
206 		/** Beginning of file */
207 		uint64_t bf                    : 1;
208 		/** Comp/decomp operation */
209 		uint64_t op                    : 2;
210 		/** Data scatter */
211 		uint64_t ds                    : 1;
212 		/** Data gather */
213 		uint64_t dg                    : 1;
214 		/** History gather */
215 		uint64_t hg                    : 1;
216 #else /* Word 0 - Little Endian */
217 		uint64_t hg                    : 1;
218 		uint64_t dg                    : 1;
219 		uint64_t ds                    : 1;
220 		uint64_t op                    : 2;
221 		uint64_t bf                    : 1;
222 		uint64_t ef                    : 1;
223 		uint64_t cc                    : 2;
224 		uint64_t ss                    : 2;
225 		uint64_t sf                    : 1;
226 		uint64_t halg                  : 3;
227 		uint64_t hmif                  : 1;
228 		uint64_t exbits                : 7;
229 		uint64_t iv                    : 1;
230 		uint64_t exn                   : 3;
231 		uint64_t reserved_27_31        : 5;
232 		uint64_t totaloutputlength     : 24;
233 		uint64_t reserved_56_62        : 7;
234 		uint64_t doneint               : 1;
235 
236 #endif /* Word 0 - End */
237 
238 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
239 		/** History length */
240 		uint64_t historylength         : 16;
241 		/** reserved */
242 		uint64_t reserved_96_111       : 16;
243 		/** adler/crc32 checksum*/
244 		uint64_t adlercrc32            : 32;
245 #else /* Word 1 - Little Endian */
246 		uint64_t adlercrc32            : 32;
247 		uint64_t reserved_96_111       : 16;
248 		uint64_t historylength         : 16;
249 #endif /* Word 1 - End */
250 
251 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
252 		/** Decompression Context Pointer Address */
253 		union zip_zptr_addr_s  ctx_ptr_addr;
254 #else /* Word 2 - Little Endian */
255 		union zip_zptr_addr_s  ctx_ptr_addr;
256 #endif /* Word 2 - End */
257 
258 #if defined(__BIG_ENDIAN_BITFIELD)
259 		/** Decompression Context Pointer Control */
260 		union zip_zptr_ctl_s   ctx_ptr_ctl;
261 #else /* Word 3 - Little Endian */
262 		union zip_zptr_ctl_s   ctx_ptr_ctl;
263 #endif /* Word 3 - End */
264 
265 #if defined(__BIG_ENDIAN_BITFIELD)
266 		/** Decompression history pointer address */
267 		union zip_zptr_addr_s  his_ptr_addr;
268 #else /* Word 4 - Little Endian */
269 		union zip_zptr_addr_s  his_ptr_addr;
270 #endif /* Word 4 - End */
271 
272 #if defined(__BIG_ENDIAN_BITFIELD)
273 		/** Decompression history pointer control */
274 		union zip_zptr_ctl_s   his_ptr_ctl;
275 #else /* Word 5 - Little Endian */
276 		union zip_zptr_ctl_s   his_ptr_ctl;
277 #endif /* Word 5 - End */
278 
279 #if defined(__BIG_ENDIAN_BITFIELD)
280 		/** Input and compression history pointer address */
281 		union zip_zptr_addr_s  inp_ptr_addr;
282 #else /* Word 6 - Little Endian */
283 		union zip_zptr_addr_s  inp_ptr_addr;
284 #endif /* Word 6 - End */
285 
286 #if defined(__BIG_ENDIAN_BITFIELD)
287 		/** Input and compression history pointer control */
288 		union zip_zptr_ctl_s   inp_ptr_ctl;
289 #else /* Word 7 - Little Endian */
290 		union zip_zptr_ctl_s   inp_ptr_ctl;
291 #endif /* Word 7 - End */
292 
293 #if defined(__BIG_ENDIAN_BITFIELD)
294 		/** Output pointer address */
295 		union zip_zptr_addr_s  out_ptr_addr;
296 #else /* Word 8 - Little Endian */
297 		union zip_zptr_addr_s  out_ptr_addr;
298 #endif /* Word 8 - End */
299 
300 #if defined(__BIG_ENDIAN_BITFIELD)
301 		/** Output pointer control */
302 		union zip_zptr_ctl_s   out_ptr_ctl;
303 #else /* Word 9 - Little Endian */
304 		union zip_zptr_ctl_s   out_ptr_ctl;
305 #endif /* Word 9 - End */
306 
307 #if defined(__BIG_ENDIAN_BITFIELD)
308 		/** Result pointer address */
309 		union zip_zptr_addr_s  res_ptr_addr;
310 #else /* Word 10 - Little Endian */
311 		union zip_zptr_addr_s  res_ptr_addr;
312 #endif /* Word 10 - End */
313 
314 #if defined(__BIG_ENDIAN_BITFIELD)
315 		/** Result pointer control */
316 		union zip_zptr_ctl_s   res_ptr_ctl;
317 #else /* Word 11 - Little Endian */
318 		union zip_zptr_ctl_s   res_ptr_ctl;
319 #endif /* Word 11 - End */
320 
321 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */
322 		/** reserved */
323 		uint64_t reserved_812_831      : 20;
324 		/** SSO guest group */
325 		uint64_t ggrp                  : 10;
326 		/** SSO tag type */
327 		uint64_t tt                    : 2;
328 		/** SSO tag */
329 		uint64_t tag                   : 32;
330 #else /* Word 12 - Little Endian */
331 		uint64_t tag                   : 32;
332 		uint64_t tt                    : 2;
333 		uint64_t ggrp                  : 10;
334 		uint64_t reserved_812_831      : 20;
335 #endif /* Word 12 - End */
336 
337 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */
338 		/** Work queue entry pointer */
339 		uint64_t wq_ptr                : 64;
340 #else /* Word 13 - Little Endian */
341 		uint64_t wq_ptr                : 64;
342 #endif /* Word 13 - End */
343 
344 #if defined(__BIG_ENDIAN_BITFIELD)
345 		/** reserved */
346 		uint64_t reserved_896_959      : 64;
347 #else /* Word 14 - Little Endian */
348 		uint64_t reserved_896_959      : 64;
349 #endif /* Word 14 - End */
350 #if defined(__BIG_ENDIAN_BITFIELD)
351 		/** Hash structure pointer */
352 		uint64_t hash_ptr              : 64;
353 #else /* Word 15 - Little Endian */
354 		uint64_t hash_ptr              : 64;
355 #endif /* Word 15 - End */
356 	} /** ZIP 88xx Instruction Structure */zip88xx;
357 
358 	/** ZIP Instruction Structure */
359 	struct zip_inst_s_cn83xx {
360 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
361 		/** Done interrupt */
362 		uint64_t doneint               : 1;
363 		/** reserved */
364 		uint64_t reserved_56_62        : 7;
365 		/**  Total output length */
366 		uint64_t totaloutputlength     : 24;
367 		/** reserved */
368 		uint64_t reserved_27_31        : 5;
369 		/** EXNUM */
370 		uint64_t exn                   : 3;
371 		/**  HASH IV */
372 		uint64_t iv                    : 1;
373 		/** EXBITS */
374 		uint64_t exbits                : 7;
375 		/** Hash more-in-file */
376 		uint64_t hmif                  : 1;
377 		/** Hash Algorithm and enable */
378 		uint64_t halg                  : 3;
379 		/** Sync flush*/
380 		uint64_t sf                    : 1;
381 		/** Compression speed/storage */
382 		uint64_t ss                    : 2;
383 		/** Compression coding */
384 		uint64_t cc                    : 2;
385 		/** End of input data */
386 		uint64_t ef                    : 1;
387 		/** Beginning of file */
388 		uint64_t bf                    : 1;
389 		/** Comp/decomp operation */
390 		uint64_t op                    : 2;
391 		/** Data scatter */
392 		uint64_t ds                    : 1;
393 		/** Data gather */
394 		uint64_t dg                    : 1;
395 		/** History gather */
396 		uint64_t hg                    : 1;
397 #else /* Word 0 - Little Endian */
398 		uint64_t hg                    : 1;
399 		uint64_t dg                    : 1;
400 		uint64_t ds                    : 1;
401 		uint64_t op                    : 2;
402 		uint64_t bf                    : 1;
403 		uint64_t ef                    : 1;
404 		uint64_t cc                    : 2;
405 		uint64_t ss                    : 2;
406 		uint64_t sf                    : 1;
407 		uint64_t halg                  : 3;
408 		uint64_t hmif                  : 1;
409 		uint64_t exbits                : 7;
410 		uint64_t iv                    : 1;
411 		uint64_t exn                   : 3;
412 		uint64_t reserved_27_31        : 5;
413 		uint64_t totaloutputlength     : 24;
414 		uint64_t reserved_56_62        : 7;
415 		uint64_t doneint               : 1;
416 #endif /* Word 0 - End */
417 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
418 		/** History length */
419 		uint64_t historylength         : 16;
420 		/** reserved */
421 		uint64_t reserved_96_111       : 16;
422 		/** adler/crc32 checksum*/
423 		uint64_t adlercrc32            : 32;
424 #else /* Word 1 - Little Endian */
425 		uint64_t adlercrc32            : 32;
426 		uint64_t reserved_96_111       : 16;
427 		uint64_t historylength         : 16;
428 #endif /* Word 1 - End */
429 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
430 		/** Decompression Context Pointer Address */
431 		union zip_zptr_addr_s  ctx_ptr_addr;
432 #else /* Word 2 - Little Endian */
433 		union zip_zptr_addr_s  ctx_ptr_addr;
434 #endif /* Word 2 - End */
435 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */
436 		/** Decompression Context Pointer Control */
437 		union zip_zptr_ctl_s   ctx_ptr_ctl;
438 #else /* Word 3 - Little Endian */
439 		union zip_zptr_ctl_s   ctx_ptr_ctl;
440 #endif /* Word 3 - End */
441 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */
442 		/** Decompression history pointer address */
443 		union zip_zptr_addr_s  his_ptr_addr;
444 #else /* Word 4 - Little Endian */
445 		union zip_zptr_addr_s  his_ptr_addr;
446 #endif /* Word 4 - End */
447 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */
448 		/** Decompression history pointer control */
449 		union zip_zptr_ctl_s   his_ptr_ctl;
450 #else /* Word 5 - Little Endian */
451 		union zip_zptr_ctl_s   his_ptr_ctl;
452 #endif /* Word 5 - End */
453 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */
454 		/** Input and compression history pointer address */
455 		union zip_zptr_addr_s  inp_ptr_addr;
456 #else /* Word 6 - Little Endian */
457 		union zip_zptr_addr_s  inp_ptr_addr;
458 #endif /* Word 6 - End */
459 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */
460 		/** Input and compression history pointer control */
461 		union zip_zptr_ctl_s   inp_ptr_ctl;
462 #else /* Word 7 - Little Endian */
463 		union zip_zptr_ctl_s   inp_ptr_ctl;
464 #endif /* Word 7 - End */
465 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 8 - Big Endian */
466 		/** Output pointer address */
467 		union zip_zptr_addr_s  out_ptr_addr;
468 #else /* Word 8 - Little Endian */
469 		union zip_zptr_addr_s  out_ptr_addr;
470 #endif /* Word 8 - End */
471 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 9 - Big Endian */
472 		/** Output pointer control */
473 		union zip_zptr_ctl_s   out_ptr_ctl;
474 #else /* Word 9 - Little Endian */
475 		union zip_zptr_ctl_s   out_ptr_ctl;
476 #endif /* Word 9 - End */
477 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 10 - Big Endian */
478 		/** Result pointer address */
479 		union zip_zptr_addr_s  res_ptr_addr;
480 #else /* Word 10 - Little Endian */
481 		union zip_zptr_addr_s  res_ptr_addr;
482 #endif /* Word 10 - End */
483 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 11 - Big Endian */
484 		/** Result pointer control */
485 		union zip_zptr_ctl_s   res_ptr_ctl;
486 #else /* Word 11 - Little Endian */
487 		union zip_zptr_ctl_s   res_ptr_ctl;
488 #endif /* Word 11 - End */
489 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */
490 		/** reserved */
491 		uint64_t reserved_812_831      : 20;
492 		/** SSO guest group */
493 		uint64_t ggrp                  : 10;
494 		/** SSO tag type */
495 		uint64_t tt                    : 2;
496 		/** SSO tag */
497 		uint64_t tag                   : 32;
498 #else /* Word 12 - Little Endian */
499 		uint64_t tag                   : 32;
500 		uint64_t tt                    : 2;
501 		uint64_t ggrp                  : 10;
502 		uint64_t reserved_812_831      : 20;
503 #endif /* Word 12 - End */
504 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */
505 		/** Work queue entry pointer */
506 		uint64_t wq_ptr                : 64;
507 #else /* Word 13 - Little Endian */
508 		uint64_t wq_ptr                : 64;
509 #endif /* Word 13 - End */
510 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 14 - Big Endian */
511 		/** reserved */
512 		uint64_t reserved_896_959      : 64;
513 #else /* Word 14 - Little Endian */
514 		uint64_t reserved_896_959      : 64;
515 #endif /* Word 14 - End */
516 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 15 - Big Endian */
517 		/** Hash structure pointer */
518 		uint64_t hash_ptr              : 64;
519 #else /* Word 15 - Little Endian */
520 		uint64_t hash_ptr              : 64;
521 #endif /* Word 15 - End */
522 	} /** ZIP 83xx Instruction Structure */s;
523 };
524 
525 /**
526  * Structure zip_zres_s
527  *
528  * ZIP Result Structure
529  * The ZIP coprocessor writes the result structure after it completes the
530  * invocation. The result structure is exactly 24 bytes, and each invocation
531  * of the ZIP coprocessor produces exactly one result structure.
532  */
533 union zip_zres_s {
534 	/** This field can be used to set/clear all bits, or do bitwise
535 	 * operations over the entire structure.
536 	 */
537 	uint64_t u[8];
538 	/** ZIP Result Structure */
539 	struct zip_zres_s_s {
540 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
541 		/** crc32 checksum of uncompressed stream */
542 		uint64_t crc32                 : 32;
543 		/** adler32 checksum of uncompressed stream*/
544 		uint64_t adler32               : 32;
545 #else /* Word 0 - Little Endian */
546 		uint64_t adler32               : 32;
547 		uint64_t crc32                 : 32;
548 #endif /* Word 0 - End */
549 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
550 		/** Total numer of Bytes produced in output stream */
551 		uint64_t totalbyteswritten     : 32;
552 		/** Total number of bytes processed from the input stream */
553 		uint64_t totalbytesread        : 32;
554 #else /* Word 1 - Little Endian */
555 		uint64_t totalbytesread        : 32;
556 		uint64_t totalbyteswritten     : 32;
557 #endif /* Word 1 - End */
558 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
559 		/** Total number of compressed input bits
560 		 * consumed to decompress all blocks in the file
561 		 */
562 		uint64_t totalbitsprocessed    : 32;
563 		/** Done interrupt*/
564 		uint64_t doneint               : 1;
565 		/** reserved */
566 		uint64_t reserved_155_158      : 4;
567 		/** EXNUM */
568 		uint64_t exn                   : 3;
569 		/** reserved */
570 		uint64_t reserved_151          : 1;
571 		/** EXBITS */
572 		uint64_t exbits                : 7;
573 		/** reserved */
574 		uint64_t reserved_137_143      : 7;
575 		/** End of file */
576 		uint64_t ef                    : 1;
577 		/** Completion/error code */
578 		uint64_t compcode              : 8;
579 #else /* Word 2 - Little Endian */
580 		uint64_t compcode              : 8;
581 		uint64_t ef                    : 1;
582 		uint64_t reserved_137_143      : 7;
583 		uint64_t exbits                : 7;
584 		uint64_t reserved_151          : 1;
585 		uint64_t exn                   : 3;
586 		uint64_t reserved_155_158      : 4;
587 		uint64_t doneint               : 1;
588 		uint64_t totalbitsprocessed    : 32;
589 #endif /* Word 2 - End */
590 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */
591 		/** reserved */
592 		uint64_t reserved_253_255      : 3;
593 		/** Hash length in bytes */
594 		uint64_t hshlen                : 61;
595 #else /* Word 3 - Little Endian */
596 		uint64_t hshlen                : 61;
597 		uint64_t reserved_253_255      : 3;
598 #endif /* Word 3 - End */
599 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */
600 		/** Double-word 0 of computed hash */
601 		uint64_t hash0                 : 64;
602 #else /* Word 4 - Little Endian */
603 		uint64_t hash0                 : 64;
604 #endif /* Word 4 - End */
605 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */
606 		/** Double-word 1 of computed hash */
607 		uint64_t hash1                 : 64;
608 #else /* Word 5 - Little Endian */
609 		uint64_t hash1                 : 64;
610 #endif /* Word 5 - End */
611 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */
612 		/** Double-word 2 of computed hash */
613 		uint64_t hash2                 : 64;
614 #else /* Word 6 - Little Endian */
615 		uint64_t hash2                 : 64;
616 #endif /* Word 6 - End */
617 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */
618 		/** Double-word 3 of computed hash */
619 		uint64_t hash3                 : 64;
620 #else /* Word 7 - Little Endian */
621 		uint64_t hash3                 : 64;
622 #endif /* Word 7 - End */
623 	} /** ZIP Result Structure */s;
624 };
625 
626 /**
627  * Structure zip_zptr_s
628  *
629  * ZIP Generic Pointer Structure
630  * This structure is the generic format of pointers in ZIP_INST_S.
631  */
632 union zip_zptr_s {
633 	/** This field can be used to set/clear all bits, or do bitwise
634 	 * operations over the entire structure.
635 	 */
636 	uint64_t u[2];
637 	/** ZIP Generic Pointer Structure */
638 	struct zip_zptr_s_s {
639 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
640 		/** Pointer to Data or scatter-gather list */
641 		uint64_t addr                  : 64;
642 #else /* Word 0 - Little Endian */
643 		uint64_t addr                  : 64;
644 #endif /* Word 0 - End */
645 #if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
646 		/** reserved */
647 		uint64_t reserved_112_127      : 16;
648 		/** Length of Data or scatter-gather list*/
649 		uint64_t length                : 16;
650 		/** reserved */
651 		uint64_t reserved_67_95        : 29;
652 		/** Full-block write */
653 		uint64_t fw                    : 1;
654 		/** No cache allocation */
655 		uint64_t nc                    : 1;
656 		/** reserved */
657 		uint64_t data_be               : 1;
658 #else /* Word 1 - Little Endian */
659 		uint64_t data_be               : 1;
660 		uint64_t nc                    : 1;
661 		uint64_t fw                    : 1;
662 		uint64_t reserved_67_95        : 29;
663 		uint64_t length                : 16;
664 		uint64_t reserved_112_127      : 16;
665 #endif /* Word 1 - End */
666 	} /** ZIP Generic Pointer Structure */s;
667 };
668 
669 /**
670  * Enumeration zip_comp_e
671  *
672  * ZIP Completion Enumeration
673  * Enumerates the values of ZIP_ZRES_S[COMPCODE].
674  */
675 #define ZIP_COMP_E_NOTDONE       (0)
676 #define ZIP_COMP_E_SUCCESS       (1)
677 #define ZIP_COMP_E_DTRUNC        (2)
678 #define ZIP_COMP_E_DSTOP         (3)
679 #define ZIP_COMP_E_ITRUNC        (4)
680 #define ZIP_COMP_E_RBLOCK        (5)
681 #define ZIP_COMP_E_NLEN          (6)
682 #define ZIP_COMP_E_BADCODE       (7)
683 #define ZIP_COMP_E_BADCODE2      (8)
684 #define ZIP_COMP_E_ZERO_LEN      (9)
685 #define ZIP_COMP_E_PARITY        (0xa)
686 #define ZIP_COMP_E_FATAL         (0xb)
687 #define ZIP_COMP_E_TIMEOUT       (0xc)
688 #define ZIP_COMP_E_INSTR_ERR     (0xd)
689 #define ZIP_COMP_E_HCTX_ERR      (0xe)
690 #define ZIP_COMP_E_PTR_ERR       (0xf)
691 #define ZIP_COMP_E_STOP          (3)
692 
693 /**
694  * Enumeration zip_op_e
695  *
696  * ZIP Operation Enumeration
697  * Enumerates ZIP_INST_S[OP].
698  * Internal:
699  */
700 #define ZIP_OP_E_DECOMP   (0)
701 #define ZIP_OP_E_NOCOMP   (1)
702 #define ZIP_OP_E_COMP     (2)
703 
704 /**
705  * Enumeration zip compression levels
706  *
707  * ZIP Compression Level Enumeration
708  * Enumerates ZIP_INST_S[SS].
709  * Internal:
710  */
711 #define ZIP_COMP_E_LEVEL_MAX  (0)
712 #define ZIP_COMP_E_LEVEL_MED  (1)
713 #define ZIP_COMP_E_LEVEL_LOW  (2)
714 #define ZIP_COMP_E_LEVEL_MIN  (3)
715 
716 #endif	/* _RTE_ZIP_REGS_H_ */
717