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