1 /***********************license start************************************
2 * Copyright (c) 2003-2017 Cavium, Inc.
5 * License: one of 'Cavium License' or 'GNU General Public License Version 2'
7 * This file is provided under the terms of the Cavium License (see below)
8 * or under the terms of GNU General Public License, Version 2, as
9 * published by the Free Software Foundation. When using or redistributing
10 * this file, you may do so under either license.
12 * Cavium License: Redistribution and use in source and binary forms, with
13 * or without modification, are permitted provided that the following
16 * * Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
19 * * Redistributions in binary form must reproduce the above
20 * copyright notice, this list of conditions and the following
21 * disclaimer in the documentation and/or other materials provided
22 * with the distribution.
24 * * Neither the name of Cavium Inc. nor the names of its contributors may be
25 * used to endorse or promote products derived from this software without
26 * specific prior written permission.
28 * This Software, including technical data, may be subject to U.S. export
29 * control laws, including the U.S. Export Administration Act and its
30 * associated regulations, and may be subject to export or import
31 * regulations in other countries.
33 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
34 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS
35 * OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
36 * RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
37 * REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
38 * DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY)
39 * WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A
40 * PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET
41 * ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. THE
42 * ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE LIES
44 ***********************license end**************************************/
46 #ifndef __ZIP_REGS_H__
47 #define __ZIP_REGS_H__
50 * Configuration and status register (CSR) address and type definitions for
54 #include <linux/kern_levels.h>
56 /* ZIP invocation result completion status codes */
57 #define ZIP_CMD_NOTDONE 0x0
59 /* Successful completion. */
60 #define ZIP_CMD_SUCCESS 0x1
62 /* Output truncated */
63 #define ZIP_CMD_DTRUNC 0x2
66 #define ZIP_CMD_DYNAMIC_STOP 0x3
68 /* Uncompress ran out of input data when IWORD0[EF] was set */
69 #define ZIP_CMD_ITRUNC 0x4
71 /* Uncompress found the reserved block type 3 */
72 #define ZIP_CMD_RBLOCK 0x5
75 * Uncompress found LEN != ZIP_CMD_NLEN in an uncompressed block in the input.
77 #define ZIP_CMD_NLEN 0x6
79 /* Uncompress found a bad code in the main Huffman codes. */
80 #define ZIP_CMD_BADCODE 0x7
82 /* Uncompress found a bad code in the 19 Huffman codes encoding lengths. */
83 #define ZIP_CMD_BADCODE2 0x8
85 /* Compress found a zero-length input. */
86 #define ZIP_CMD_ZERO_LEN 0x9
88 /* The compress or decompress encountered an internal parity error. */
89 #define ZIP_CMD_PARITY 0xA
92 * Uncompress found a string identifier that precedes the uncompressed data and
93 * decompression history.
95 #define ZIP_CMD_FATAL 0xB
98 * enum zip_int_vec_e - ZIP MSI-X Vector Enumeration, enumerates the MSI-X
102 ZIP_INT_VEC_E_ECCE
= 0x10,
103 ZIP_INT_VEC_E_FIFE
= 0x11,
104 ZIP_INT_VEC_E_QUE0_DONE
= 0x0,
105 ZIP_INT_VEC_E_QUE0_ERR
= 0x8,
106 ZIP_INT_VEC_E_QUE1_DONE
= 0x1,
107 ZIP_INT_VEC_E_QUE1_ERR
= 0x9,
108 ZIP_INT_VEC_E_QUE2_DONE
= 0x2,
109 ZIP_INT_VEC_E_QUE2_ERR
= 0xa,
110 ZIP_INT_VEC_E_QUE3_DONE
= 0x3,
111 ZIP_INT_VEC_E_QUE3_ERR
= 0xb,
112 ZIP_INT_VEC_E_QUE4_DONE
= 0x4,
113 ZIP_INT_VEC_E_QUE4_ERR
= 0xc,
114 ZIP_INT_VEC_E_QUE5_DONE
= 0x5,
115 ZIP_INT_VEC_E_QUE5_ERR
= 0xd,
116 ZIP_INT_VEC_E_QUE6_DONE
= 0x6,
117 ZIP_INT_VEC_E_QUE6_ERR
= 0xe,
118 ZIP_INT_VEC_E_QUE7_DONE
= 0x7,
119 ZIP_INT_VEC_E_QUE7_ERR
= 0xf,
120 ZIP_INT_VEC_E_ENUM_LAST
= 0x12,
124 * union zip_zptr_addr_s - ZIP Generic Pointer Structure for ADDR.
126 * It is the generic format of pointers in ZIP_INST_S.
128 union zip_zptr_addr_s
{
131 #if defined(__BIG_ENDIAN_BITFIELD)
132 u64 reserved_49_63
: 15;
134 #elif defined(__LITTLE_ENDIAN_BITFIELD)
136 u64 reserved_49_63
: 15;
143 * union zip_zptr_ctl_s - ZIP Generic Pointer Structure for CTL.
145 * It is the generic format of pointers in ZIP_INST_S.
147 union zip_zptr_ctl_s
{
150 #if defined(__BIG_ENDIAN_BITFIELD)
151 u64 reserved_112_127
: 16;
153 u64 reserved_67_95
: 29;
157 #elif defined(__LITTLE_ENDIAN_BITFIELD)
161 u64 reserved_67_95
: 29;
163 u64 reserved_112_127
: 16;
169 * union zip_inst_s - ZIP Instruction Structure.
170 * Each ZIP instruction has 16 words (they are called IWORD0 to IWORD15 within
176 #if defined(__BIG_ENDIAN_BITFIELD)
178 u64 reserved_56_62
: 7;
179 u64 totaloutputlength
: 24;
180 u64 reserved_27_31
: 5;
182 u64 reserved_23_23
: 1;
184 u64 reserved_12_15
: 4;
191 u64 reserved_3_3
: 1;
195 #elif defined(__LITTLE_ENDIAN_BITFIELD)
199 u64 reserved_3_3
: 1;
206 u64 reserved_12_15
: 4;
208 u64 reserved_23_23
: 1;
210 u64 reserved_27_31
: 5;
211 u64 totaloutputlength
: 24;
212 u64 reserved_56_62
: 7;
215 #if defined(__BIG_ENDIAN_BITFIELD)
216 u64 historylength
: 16;
217 u64 reserved_96_111
: 16;
219 #elif defined(__LITTLE_ENDIAN_BITFIELD)
221 u64 reserved_96_111
: 16;
222 u64 historylength
: 16;
224 union zip_zptr_addr_s ctx_ptr_addr
;
225 union zip_zptr_ctl_s ctx_ptr_ctl
;
226 union zip_zptr_addr_s his_ptr_addr
;
227 union zip_zptr_ctl_s his_ptr_ctl
;
228 union zip_zptr_addr_s inp_ptr_addr
;
229 union zip_zptr_ctl_s inp_ptr_ctl
;
230 union zip_zptr_addr_s out_ptr_addr
;
231 union zip_zptr_ctl_s out_ptr_ctl
;
232 union zip_zptr_addr_s res_ptr_addr
;
233 union zip_zptr_ctl_s res_ptr_ctl
;
234 #if defined(__BIG_ENDIAN_BITFIELD)
235 u64 reserved_817_831
: 15;
237 #elif defined(__LITTLE_ENDIAN_BITFIELD)
239 u64 reserved_817_831
: 15;
241 #if defined(__BIG_ENDIAN_BITFIELD)
242 u64 reserved_882_895
: 14;
244 u64 reserved_874_879
: 6;
247 #elif defined(__LITTLE_ENDIAN_BITFIELD)
250 u64 reserved_874_879
: 6;
252 u64 reserved_882_895
: 14;
254 #if defined(__BIG_ENDIAN_BITFIELD)
255 u64 reserved_896_959
: 64;
256 #elif defined(__LITTLE_ENDIAN_BITFIELD)
257 u64 reserved_896_959
: 64;
259 #if defined(__BIG_ENDIAN_BITFIELD)
260 u64 reserved_960_1023
: 64;
261 #elif defined(__LITTLE_ENDIAN_BITFIELD)
262 u64 reserved_960_1023
: 64;
268 * union zip_nptr_s - ZIP Instruction Next-Chunk-Buffer Pointer (NPTR)
271 * ZIP_NPTR structure is used to chain all the zip instruction buffers
272 * together. ZIP instruction buffers are managed (allocated and released) by
278 #if defined(__BIG_ENDIAN_BITFIELD)
279 u64 reserved_49_63
: 15;
281 #elif defined(__LITTLE_ENDIAN_BITFIELD)
283 u64 reserved_49_63
: 15;
289 * union zip_zptr_s - ZIP Generic Pointer Structure.
291 * It is the generic format of pointers in ZIP_INST_S.
296 #if defined(__BIG_ENDIAN_BITFIELD)
297 u64 reserved_49_63
: 15;
299 #elif defined(__LITTLE_ENDIAN_BITFIELD)
301 u64 reserved_49_63
: 15;
303 #if defined(__BIG_ENDIAN_BITFIELD)
304 u64 reserved_112_127
: 16;
306 u64 reserved_67_95
: 29;
310 #elif defined(__LITTLE_ENDIAN_BITFIELD)
314 u64 reserved_67_95
: 29;
316 u64 reserved_112_127
: 16;
322 * union zip_zres_s - ZIP Result Structure
324 * The ZIP coprocessor writes the result structure after it completes the
325 * invocation. The result structure is exactly 24 bytes, and each invocation of
326 * the ZIP coprocessor produces exactly one result structure.
331 #if defined(__BIG_ENDIAN_BITFIELD)
334 #elif defined(__LITTLE_ENDIAN_BITFIELD)
338 #if defined(__BIG_ENDIAN_BITFIELD)
339 u64 totalbyteswritten
: 32;
340 u64 totalbytesread
: 32;
341 #elif defined(__LITTLE_ENDIAN_BITFIELD)
342 u64 totalbytesread
: 32;
343 u64 totalbyteswritten
: 32;
345 #if defined(__BIG_ENDIAN_BITFIELD)
346 u64 totalbitsprocessed
: 32;
348 u64 reserved_155_158
: 4;
350 u64 reserved_151_151
: 1;
352 u64 reserved_137_143
: 7;
355 volatile u64 compcode
: 8;
356 #elif defined(__LITTLE_ENDIAN_BITFIELD)
358 volatile u64 compcode
: 8;
360 u64 reserved_137_143
: 7;
362 u64 reserved_151_151
: 1;
364 u64 reserved_155_158
: 4;
366 u64 totalbitsprocessed
: 32;
372 * union zip_cmd_ctl - Structure representing the register that controls
377 struct zip_cmd_ctl_s
{
378 #if defined(__BIG_ENDIAN_BITFIELD)
379 u64 reserved_2_63
: 62;
382 #elif defined(__LITTLE_ENDIAN_BITFIELD)
385 u64 reserved_2_63
: 62;
390 #define ZIP_CMD_CTL 0x0ull
393 * union zip_constants - Data structure representing the register that contains
394 * all of the current implementation-related parameters of the zip core in this
397 union zip_constants
{
399 struct zip_constants_s
{
400 #if defined(__BIG_ENDIAN_BITFIELD)
402 u64 reserved_49_55
: 7;
403 u64 syncflush_capable
: 1;
407 u64 reserved_1_7
: 7;
409 #elif defined(__LITTLE_ENDIAN_BITFIELD)
411 u64 reserved_1_7
: 7;
415 u64 syncflush_capable
: 1;
416 u64 reserved_49_55
: 7;
422 #define ZIP_CONSTANTS 0x00A0ull
425 * union zip_corex_bist_status - Represents registers which have the BIST
426 * status of memories in zip cores.
428 * Each bit is the BIST result of an individual memory
429 * (per bit, 0 = pass and 1 = fail).
431 union zip_corex_bist_status
{
433 struct zip_corex_bist_status_s
{
434 #if defined(__BIG_ENDIAN_BITFIELD)
435 u64 reserved_53_63
: 11;
437 #elif defined(__LITTLE_ENDIAN_BITFIELD)
439 u64 reserved_53_63
: 11;
444 static inline u64
ZIP_COREX_BIST_STATUS(u64 param1
)
447 return 0x0520ull
+ (param1
& 1) * 0x8ull
;
448 pr_err("ZIP_COREX_BIST_STATUS: %llu\n", param1
);
453 * union zip_ctl_bist_status - Represents register that has the BIST status of
454 * memories in ZIP_CTL (instruction buffer, G/S pointer FIFO, input data
455 * buffer, output data buffers).
457 * Each bit is the BIST result of an individual memory
458 * (per bit, 0 = pass and 1 = fail).
460 union zip_ctl_bist_status
{
462 struct zip_ctl_bist_status_s
{
463 #if defined(__BIG_ENDIAN_BITFIELD)
464 u64 reserved_9_63
: 55;
466 #elif defined(__LITTLE_ENDIAN_BITFIELD)
468 u64 reserved_9_63
: 55;
473 #define ZIP_CTL_BIST_STATUS 0x0510ull
476 * union zip_ctl_cfg - Represents the register that controls the behavior of
477 * the ZIP DMA engines.
479 * It is recommended to keep default values for normal operation. Changing the
480 * values of the fields may be useful for diagnostics.
484 struct zip_ctl_cfg_s
{
485 #if defined(__BIG_ENDIAN_BITFIELD)
486 u64 reserved_52_63
: 12;
488 u64 reserved_36_47
: 12;
490 u64 reserved_27_31
: 5;
492 u64 reserved_19_23
: 5;
494 u64 reserved_2_15
: 14;
496 u64 reserved_0_0
: 1;
497 #elif defined(__LITTLE_ENDIAN_BITFIELD)
498 u64 reserved_0_0
: 1;
500 u64 reserved_2_15
: 14;
502 u64 reserved_19_23
: 5;
504 u64 reserved_27_31
: 5;
506 u64 reserved_36_47
: 12;
508 u64 reserved_52_63
: 12;
513 #define ZIP_CTL_CFG 0x0560ull
516 * union zip_dbg_corex_inst - Represents the registers that reflect the status
517 * of the current instruction that the ZIP core is executing or has executed.
519 * These registers are only for debug use.
521 union zip_dbg_corex_inst
{
523 struct zip_dbg_corex_inst_s
{
524 #if defined(__BIG_ENDIAN_BITFIELD)
526 u64 reserved_35_62
: 28;
529 #elif defined(__LITTLE_ENDIAN_BITFIELD)
532 u64 reserved_35_62
: 28;
538 static inline u64
ZIP_DBG_COREX_INST(u64 param1
)
541 return 0x0640ull
+ (param1
& 1) * 0x8ull
;
542 pr_err("ZIP_DBG_COREX_INST: %llu\n", param1
);
547 * union zip_dbg_corex_sta - Represents registers that reflect the status of
550 * They are for debug use only.
552 union zip_dbg_corex_sta
{
554 struct zip_dbg_corex_sta_s
{
555 #if defined(__BIG_ENDIAN_BITFIELD)
557 u64 reserved_37_62
: 26;
560 #elif defined(__LITTLE_ENDIAN_BITFIELD)
563 u64 reserved_37_62
: 26;
569 static inline u64
ZIP_DBG_COREX_STA(u64 param1
)
572 return 0x0680ull
+ (param1
& 1) * 0x8ull
;
573 pr_err("ZIP_DBG_COREX_STA: %llu\n", param1
);
578 * union zip_dbg_quex_sta - Represets registers that reflect status of the zip
579 * instruction queues.
581 * They are for debug use only.
583 union zip_dbg_quex_sta
{
585 struct zip_dbg_quex_sta_s
{
586 #if defined(__BIG_ENDIAN_BITFIELD)
588 u64 reserved_56_62
: 7;
591 #elif defined(__LITTLE_ENDIAN_BITFIELD)
594 u64 reserved_56_62
: 7;
600 static inline u64
ZIP_DBG_QUEX_STA(u64 param1
)
603 return 0x1800ull
+ (param1
& 7) * 0x8ull
;
604 pr_err("ZIP_DBG_QUEX_STA: %llu\n", param1
);
609 * union zip_ecc_ctl - Represents the register that enables ECC for each
610 * individual internal memory that requires ECC.
612 * For debug purpose, it can also flip one or two bits in the ECC data.
616 struct zip_ecc_ctl_s
{
617 #if defined(__BIG_ENDIAN_BITFIELD)
618 u64 reserved_19_63
: 45;
621 u64 reserved_15_15
: 1;
624 u64 reserved_11_11
: 1;
627 u64 reserved_7_7
: 1;
630 u64 reserved_3_3
: 1;
633 #elif defined(__LITTLE_ENDIAN_BITFIELD)
636 u64 reserved_3_3
: 1;
639 u64 reserved_7_7
: 1;
642 u64 reserved_11_11
: 1;
645 u64 reserved_15_15
: 1;
648 u64 reserved_19_63
: 45;
653 #define ZIP_ECC_CTL 0x0568ull
655 /* NCB - zip_ecce_ena_w1c */
656 union zip_ecce_ena_w1c
{
658 struct zip_ecce_ena_w1c_s
{
659 #if defined(__BIG_ENDIAN_BITFIELD)
660 u64 reserved_37_63
: 27;
662 u64 reserved_5_31
: 27;
664 #elif defined(__LITTLE_ENDIAN_BITFIELD)
666 u64 reserved_5_31
: 27;
668 u64 reserved_37_63
: 27;
673 #define ZIP_ECCE_ENA_W1C 0x0598ull
675 /* NCB - zip_ecce_ena_w1s */
676 union zip_ecce_ena_w1s
{
678 struct zip_ecce_ena_w1s_s
{
679 #if defined(__BIG_ENDIAN_BITFIELD)
680 u64 reserved_37_63
: 27;
682 u64 reserved_5_31
: 27;
684 #elif defined(__LITTLE_ENDIAN_BITFIELD)
686 u64 reserved_5_31
: 27;
688 u64 reserved_37_63
: 27;
693 #define ZIP_ECCE_ENA_W1S 0x0590ull
696 * union zip_ecce_int - Represents the register that contains the status of the
697 * ECC interrupt sources.
701 struct zip_ecce_int_s
{
702 #if defined(__BIG_ENDIAN_BITFIELD)
703 u64 reserved_37_63
: 27;
705 u64 reserved_5_31
: 27;
707 #elif defined(__LITTLE_ENDIAN_BITFIELD)
709 u64 reserved_5_31
: 27;
711 u64 reserved_37_63
: 27;
716 #define ZIP_ECCE_INT 0x0580ull
718 /* NCB - zip_ecce_int_w1s */
719 union zip_ecce_int_w1s
{
721 struct zip_ecce_int_w1s_s
{
722 #if defined(__BIG_ENDIAN_BITFIELD)
723 u64 reserved_37_63
: 27;
725 u64 reserved_5_31
: 27;
727 #elif defined(__LITTLE_ENDIAN_BITFIELD)
729 u64 reserved_5_31
: 27;
731 u64 reserved_37_63
: 27;
736 #define ZIP_ECCE_INT_W1S 0x0588ull
738 /* NCB - zip_fife_ena_w1c */
739 union zip_fife_ena_w1c
{
741 struct zip_fife_ena_w1c_s
{
742 #if defined(__BIG_ENDIAN_BITFIELD)
743 u64 reserved_42_63
: 22;
745 #elif defined(__LITTLE_ENDIAN_BITFIELD)
747 u64 reserved_42_63
: 22;
752 #define ZIP_FIFE_ENA_W1C 0x0090ull
754 /* NCB - zip_fife_ena_w1s */
755 union zip_fife_ena_w1s
{
757 struct zip_fife_ena_w1s_s
{
758 #if defined(__BIG_ENDIAN_BITFIELD)
759 u64 reserved_42_63
: 22;
761 #elif defined(__LITTLE_ENDIAN_BITFIELD)
763 u64 reserved_42_63
: 22;
768 #define ZIP_FIFE_ENA_W1S 0x0088ull
770 /* NCB - zip_fife_int */
773 struct zip_fife_int_s
{
774 #if defined(__BIG_ENDIAN_BITFIELD)
775 u64 reserved_42_63
: 22;
777 #elif defined(__LITTLE_ENDIAN_BITFIELD)
779 u64 reserved_42_63
: 22;
784 #define ZIP_FIFE_INT 0x0078ull
786 /* NCB - zip_fife_int_w1s */
787 union zip_fife_int_w1s
{
789 struct zip_fife_int_w1s_s
{
790 #if defined(__BIG_ENDIAN_BITFIELD)
791 u64 reserved_42_63
: 22;
793 #elif defined(__LITTLE_ENDIAN_BITFIELD)
795 u64 reserved_42_63
: 22;
800 #define ZIP_FIFE_INT_W1S 0x0080ull
803 * union zip_msix_pbax - Represents the register that is the MSI-X PBA table
805 * The bit number is indexed by the ZIP_INT_VEC_E enumeration.
807 union zip_msix_pbax
{
809 struct zip_msix_pbax_s
{
810 #if defined(__BIG_ENDIAN_BITFIELD)
812 #elif defined(__LITTLE_ENDIAN_BITFIELD)
818 static inline u64
ZIP_MSIX_PBAX(u64 param1
)
821 return 0x0000838000FF0000ull
;
822 pr_err("ZIP_MSIX_PBAX: %llu\n", param1
);
827 * union zip_msix_vecx_addr - Represents the register that is the MSI-X vector
828 * table, indexed by the ZIP_INT_VEC_E enumeration.
830 union zip_msix_vecx_addr
{
832 struct zip_msix_vecx_addr_s
{
833 #if defined(__BIG_ENDIAN_BITFIELD)
834 u64 reserved_49_63
: 15;
836 u64 reserved_1_1
: 1;
838 #elif defined(__LITTLE_ENDIAN_BITFIELD)
840 u64 reserved_1_1
: 1;
842 u64 reserved_49_63
: 15;
847 static inline u64
ZIP_MSIX_VECX_ADDR(u64 param1
)
850 return 0x0000838000F00000ull
+ (param1
& 31) * 0x10ull
;
851 pr_err("ZIP_MSIX_VECX_ADDR: %llu\n", param1
);
856 * union zip_msix_vecx_ctl - Represents the register that is the MSI-X vector
857 * table, indexed by the ZIP_INT_VEC_E enumeration.
859 union zip_msix_vecx_ctl
{
861 struct zip_msix_vecx_ctl_s
{
862 #if defined(__BIG_ENDIAN_BITFIELD)
863 u64 reserved_33_63
: 31;
865 u64 reserved_20_31
: 12;
867 #elif defined(__LITTLE_ENDIAN_BITFIELD)
869 u64 reserved_20_31
: 12;
871 u64 reserved_33_63
: 31;
876 static inline u64
ZIP_MSIX_VECX_CTL(u64 param1
)
879 return 0x0000838000F00008ull
+ (param1
& 31) * 0x10ull
;
880 pr_err("ZIP_MSIX_VECX_CTL: %llu\n", param1
);
885 * union zip_quex_done - Represents the registers that contain the per-queue
886 * instruction done count.
888 union zip_quex_done
{
890 struct zip_quex_done_s
{
891 #if defined(__BIG_ENDIAN_BITFIELD)
892 u64 reserved_20_63
: 44;
894 #elif defined(__LITTLE_ENDIAN_BITFIELD)
896 u64 reserved_20_63
: 44;
901 static inline u64
ZIP_QUEX_DONE(u64 param1
)
904 return 0x2000ull
+ (param1
& 7) * 0x8ull
;
905 pr_err("ZIP_QUEX_DONE: %llu\n", param1
);
910 * union zip_quex_done_ack - Represents the registers on write to which will
911 * decrement the per-queue instructiona done count.
913 union zip_quex_done_ack
{
915 struct zip_quex_done_ack_s
{
916 #if defined(__BIG_ENDIAN_BITFIELD)
917 u64 reserved_20_63
: 44;
919 #elif defined(__LITTLE_ENDIAN_BITFIELD)
921 u64 reserved_20_63
: 44;
926 static inline u64
ZIP_QUEX_DONE_ACK(u64 param1
)
929 return 0x2200ull
+ (param1
& 7) * 0x8ull
;
930 pr_err("ZIP_QUEX_DONE_ACK: %llu\n", param1
);
935 * union zip_quex_done_ena_w1c - Represents the register which when written
936 * 1 to will disable the DONEINT interrupt for the queue.
938 union zip_quex_done_ena_w1c
{
940 struct zip_quex_done_ena_w1c_s
{
941 #if defined(__BIG_ENDIAN_BITFIELD)
942 u64 reserved_1_63
: 63;
944 #elif defined(__LITTLE_ENDIAN_BITFIELD)
946 u64 reserved_1_63
: 63;
951 static inline u64
ZIP_QUEX_DONE_ENA_W1C(u64 param1
)
954 return 0x2600ull
+ (param1
& 7) * 0x8ull
;
955 pr_err("ZIP_QUEX_DONE_ENA_W1C: %llu\n", param1
);
960 * union zip_quex_done_ena_w1s - Represents the register that when written 1 to
961 * will enable the DONEINT interrupt for the queue.
963 union zip_quex_done_ena_w1s
{
965 struct zip_quex_done_ena_w1s_s
{
966 #if defined(__BIG_ENDIAN_BITFIELD)
967 u64 reserved_1_63
: 63;
969 #elif defined(__LITTLE_ENDIAN_BITFIELD)
971 u64 reserved_1_63
: 63;
976 static inline u64
ZIP_QUEX_DONE_ENA_W1S(u64 param1
)
979 return 0x2400ull
+ (param1
& 7) * 0x8ull
;
980 pr_err("ZIP_QUEX_DONE_ENA_W1S: %llu\n", param1
);
985 * union zip_quex_done_wait - Represents the register that specifies the per
986 * queue interrupt coalescing settings.
988 union zip_quex_done_wait
{
990 struct zip_quex_done_wait_s
{
991 #if defined(__BIG_ENDIAN_BITFIELD)
992 u64 reserved_48_63
: 16;
994 u64 reserved_20_31
: 12;
996 #elif defined(__LITTLE_ENDIAN_BITFIELD)
998 u64 reserved_20_31
: 12;
1000 u64 reserved_48_63
: 16;
1005 static inline u64
ZIP_QUEX_DONE_WAIT(u64 param1
)
1008 return 0x2800ull
+ (param1
& 7) * 0x8ull
;
1009 pr_err("ZIP_QUEX_DONE_WAIT: %llu\n", param1
);
1014 * union zip_quex_doorbell - Represents doorbell registers for the ZIP
1015 * instruction queues.
1017 union zip_quex_doorbell
{
1019 struct zip_quex_doorbell_s
{
1020 #if defined(__BIG_ENDIAN_BITFIELD)
1021 u64 reserved_20_63
: 44;
1023 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1025 u64 reserved_20_63
: 44;
1030 static inline u64
ZIP_QUEX_DOORBELL(u64 param1
)
1033 return 0x4000ull
+ (param1
& 7) * 0x8ull
;
1034 pr_err("ZIP_QUEX_DOORBELL: %llu\n", param1
);
1038 union zip_quex_err_ena_w1c
{
1040 struct zip_quex_err_ena_w1c_s
{
1041 #if defined(__BIG_ENDIAN_BITFIELD)
1042 u64 reserved_5_63
: 59;
1048 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1054 u64 reserved_5_63
: 59;
1059 static inline u64
ZIP_QUEX_ERR_ENA_W1C(u64 param1
)
1062 return 0x3600ull
+ (param1
& 7) * 0x8ull
;
1063 pr_err("ZIP_QUEX_ERR_ENA_W1C: %llu\n", param1
);
1067 union zip_quex_err_ena_w1s
{
1069 struct zip_quex_err_ena_w1s_s
{
1070 #if defined(__BIG_ENDIAN_BITFIELD)
1071 u64 reserved_5_63
: 59;
1077 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1083 u64 reserved_5_63
: 59;
1088 static inline u64
ZIP_QUEX_ERR_ENA_W1S(u64 param1
)
1091 return 0x3400ull
+ (param1
& 7) * 0x8ull
;
1092 pr_err("ZIP_QUEX_ERR_ENA_W1S: %llu\n", param1
);
1097 * union zip_quex_err_int - Represents registers that contain the per-queue
1100 union zip_quex_err_int
{
1102 struct zip_quex_err_int_s
{
1103 #if defined(__BIG_ENDIAN_BITFIELD)
1104 u64 reserved_5_63
: 59;
1110 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1116 u64 reserved_5_63
: 59;
1121 static inline u64
ZIP_QUEX_ERR_INT(u64 param1
)
1124 return 0x3000ull
+ (param1
& 7) * 0x8ull
;
1125 pr_err("ZIP_QUEX_ERR_INT: %llu\n", param1
);
1129 /* NCB - zip_que#_err_int_w1s */
1130 union zip_quex_err_int_w1s
{
1132 struct zip_quex_err_int_w1s_s
{
1133 #if defined(__BIG_ENDIAN_BITFIELD)
1134 u64 reserved_5_63
: 59;
1140 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1146 u64 reserved_5_63
: 59;
1151 static inline u64
ZIP_QUEX_ERR_INT_W1S(u64 param1
)
1154 return 0x3200ull
+ (param1
& 7) * 0x8ull
;
1155 pr_err("ZIP_QUEX_ERR_INT_W1S: %llu\n", param1
);
1160 * union zip_quex_gcfg - Represents the registers that reflect status of the
1161 * zip instruction queues,debug use only.
1163 union zip_quex_gcfg
{
1165 struct zip_quex_gcfg_s
{
1166 #if defined(__BIG_ENDIAN_BITFIELD)
1167 u64 reserved_4_63
: 60;
1171 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1175 u64 reserved_4_63
: 60;
1180 static inline u64
ZIP_QUEX_GCFG(u64 param1
)
1183 return 0x1A00ull
+ (param1
& 7) * 0x8ull
;
1184 pr_err("ZIP_QUEX_GCFG: %llu\n", param1
);
1189 * union zip_quex_map - Represents the registers that control how each
1190 * instruction queue maps to zip cores.
1192 union zip_quex_map
{
1194 struct zip_quex_map_s
{
1195 #if defined(__BIG_ENDIAN_BITFIELD)
1196 u64 reserved_2_63
: 62;
1198 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1200 u64 reserved_2_63
: 62;
1205 static inline u64
ZIP_QUEX_MAP(u64 param1
)
1208 return 0x1400ull
+ (param1
& 7) * 0x8ull
;
1209 pr_err("ZIP_QUEX_MAP: %llu\n", param1
);
1214 * union zip_quex_sbuf_addr - Represents the registers that set the buffer
1215 * parameters for the instruction queues.
1217 * When quiescent (i.e. outstanding doorbell count is 0), it is safe to rewrite
1218 * this register to effectively reset the command buffer state machine.
1219 * These registers must be programmed after SW programs the corresponding
1220 * ZIP_QUE(0..7)_SBUF_CTL.
1222 union zip_quex_sbuf_addr
{
1224 struct zip_quex_sbuf_addr_s
{
1225 #if defined(__BIG_ENDIAN_BITFIELD)
1226 u64 reserved_49_63
: 15;
1229 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1232 u64 reserved_49_63
: 15;
1237 static inline u64
ZIP_QUEX_SBUF_ADDR(u64 param1
)
1240 return 0x1000ull
+ (param1
& 7) * 0x8ull
;
1241 pr_err("ZIP_QUEX_SBUF_ADDR: %llu\n", param1
);
1246 * union zip_quex_sbuf_ctl - Represents the registers that set the buffer
1247 * parameters for the instruction queues.
1249 * When quiescent (i.e. outstanding doorbell count is 0), it is safe to rewrite
1250 * this register to effectively reset the command buffer state machine.
1251 * These registers must be programmed before SW programs the corresponding
1252 * ZIP_QUE(0..7)_SBUF_ADDR.
1254 union zip_quex_sbuf_ctl
{
1256 struct zip_quex_sbuf_ctl_s
{
1257 #if defined(__BIG_ENDIAN_BITFIELD)
1258 u64 reserved_45_63
: 19;
1261 u64 reserved_24_30
: 7;
1263 u64 reserved_12_15
: 4;
1265 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1267 u64 reserved_12_15
: 4;
1269 u64 reserved_24_30
: 7;
1272 u64 reserved_45_63
: 19;
1277 static inline u64
ZIP_QUEX_SBUF_CTL(u64 param1
)
1280 return 0x1200ull
+ (param1
& 7) * 0x8ull
;
1281 pr_err("ZIP_QUEX_SBUF_CTL: %llu\n", param1
);
1286 * union zip_que_ena - Represents queue enable register
1288 * If a queue is disabled, ZIP_CTL stops fetching instructions from the queue.
1292 struct zip_que_ena_s
{
1293 #if defined(__BIG_ENDIAN_BITFIELD)
1294 u64 reserved_8_63
: 56;
1296 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1298 u64 reserved_8_63
: 56;
1303 #define ZIP_QUE_ENA 0x0500ull
1306 * union zip_que_pri - Represents the register that defines the priority
1307 * between instruction queues.
1311 struct zip_que_pri_s
{
1312 #if defined(__BIG_ENDIAN_BITFIELD)
1313 u64 reserved_8_63
: 56;
1315 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1317 u64 reserved_8_63
: 56;
1322 #define ZIP_QUE_PRI 0x0508ull
1325 * union zip_throttle - Represents the register that controls the maximum
1326 * number of in-flight X2I data fetch transactions.
1328 * Writing 0 to this register causes the ZIP module to temporarily suspend NCB
1329 * accesses; it is not recommended for normal operation, but may be useful for
1332 union zip_throttle
{
1334 struct zip_throttle_s
{
1335 #if defined(__BIG_ENDIAN_BITFIELD)
1336 u64 reserved_6_63
: 58;
1338 #elif defined(__LITTLE_ENDIAN_BITFIELD)
1340 u64 reserved_6_63
: 58;
1345 #define ZIP_THROTTLE 0x0010ull
1347 #endif /* _CSRS_ZIP__ */