1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
10 #define CPT_COMP_NOT_DONE (0x0ull)
11 #define CPT_COMP_GOOD (0x1ull)
12 #define CPT_COMP_FAULT (0x2ull)
13 #define CPT_COMP_SWERR (0x3ull)
14 #define CPT_COMP_HWERR (0x4ull)
15 #define CPT_COMP_INSTERR (0x5ull)
16 #define CPT_COMP_WARN (0x6ull) /* [CN10K, .) */
18 #define CPT_LF_INT_VEC_MISC (0x0ull)
19 #define CPT_LF_INT_VEC_DONE (0x1ull)
20 #define CPT_LF_CTL (0x10ull)
21 #define CPT_LF_DONE_WAIT (0x30ull)
22 #define CPT_LF_INPROG (0x40ull)
23 #define CPT_LF_DONE (0x50ull)
24 #define CPT_LF_DONE_ACK (0x60ull)
25 #define CPT_LF_DONE_INT_ENA_W1S (0x90ull)
26 #define CPT_LF_DONE_INT_ENA_W1C (0xa0ull)
27 #define CPT_LF_MISC_INT (0xb0ull)
28 #define CPT_LF_MISC_INT_W1S (0xc0ull)
29 #define CPT_LF_MISC_INT_ENA_W1S (0xd0ull)
30 #define CPT_LF_MISC_INT_ENA_W1C (0xe0ull)
31 #define CPT_LF_Q_BASE (0xf0ull)
32 #define CPT_LF_Q_SIZE (0x100ull)
33 #define CPT_LF_Q_INST_PTR (0x110ull)
34 #define CPT_LF_Q_GRP_PTR (0x120ull)
35 #define CPT_LF_NQX(a) (0x400ull | (uint64_t)(a) << 3)
36 #define CPT_LF_CTX_CTL (0x500ull)
37 #define CPT_LF_CTX_FLUSH (0x510ull)
38 #define CPT_LF_CTX_ERR (0x520ull)
39 #define CPT_LF_CTX_ENC_BYTE_CNT (0x530ull)
40 #define CPT_LF_CTX_ENC_PKT_CNT (0x540ull)
41 #define CPT_LF_CTX_DEC_BYTE_CNT (0x550ull)
42 #define CPT_LF_CTX_DEC_PKT_CNT (0x560ull)
43 #define CPT_LF_CTX_RELOAD (0x570ull)
45 #define CPT_AF_LFX_CTL(a) (0x27000ull | (uint64_t)(a) << 3)
46 #define CPT_AF_LFX_CTL2(a) (0x29000ull | (uint64_t)(a) << 3)
48 /* Structures definitions */
55 uint64_t fc_up_crossing : 1;
56 uint64_t reserved_3_3 : 1;
57 uint64_t fc_hyst_bits : 4;
58 uint64_t reserved_8_63 : 56;
62 union cpt_lf_ctx_flush {
67 uint64_t reserved_47_63 : 17;
71 union cpt_lf_ctx_reload {
75 uint64_t reserved_46_63 : 18;
81 struct cpt_lf_inprog_s {
82 uint64_t inflight : 9;
83 uint64_t reserved_9_15 : 7;
86 uint64_t reserved_18_30 : 13;
87 uint64_t grb_partial : 1;
90 uint64_t reserved_48_63 : 16;
94 union cpt_lf_q_inst_ptr {
96 struct cpt_lf_q_inst_ptr_s {
98 uint64_t reserved_20_31 : 12;
100 uint64_t reserved_52_62 : 11;
105 union cpt_lf_q_base {
107 struct cpt_lf_q_base_s {
109 uint64_t stopped : 1;
110 uint64_t reserved_2_6 : 5;
112 uint64_t reserved_53_63 : 11;
116 union cpt_lf_q_size {
118 struct cpt_lf_q_size_s {
119 uint64_t size_div40 : 15;
120 uint64_t reserved_15_63 : 49;
124 union cpt_lf_misc_int {
126 struct cpt_lf_misc_int_s {
127 uint64_t reserved_0_0 : 1;
131 uint64_t reserved_4_4 : 1;
134 uint64_t reserved_7_63 : 57;
138 union cpt_lf_q_grp_ptr {
141 uint64_t dq_ptr : 15;
142 uint64_t reserved_31_15 : 17;
143 uint64_t nq_ptr : 15;
144 uint64_t reserved_47_62 : 16;
153 uint64_t param2 : 16;
154 uint64_t param1 : 16;
155 uint64_t opcode_major : 8;
156 uint64_t opcode_minor : 8;
164 uint64_t ctx_val : 1;
173 uint64_t doneint : 1;
174 uint64_t nixtx_addr : 60;
186 uint64_t reserved_172_175 : 4;
187 uint64_t rvu_pf_func : 16;
195 uint64_t reserved_194_193 : 2;
196 uint64_t wqe_ptr : 61;
201 union cpt_inst_w4 w4;
207 union cpt_inst_w7 w7;
211 struct cpt_cn10k_res_s {
212 uint64_t compcode : 7;
213 uint64_t doneint : 1;
214 uint64_t uc_compcode : 8;
221 struct cpt_cn9k_res_s {
222 uint64_t compcode : 8;
223 uint64_t uc_compcode : 8;
224 uint64_t doneint : 1;
225 uint64_t reserved_17_63 : 47;
227 uint64_t reserved_64_127;
234 struct cpt_parse_hdr_s {
240 uint8_t num_frags : 3;
244 uint8_t reas_sts : 4;
245 uint8_t reserved_53 : 1;
249 uint16_t match_id : 16;
251 uint32_t cookie : 32;
263 uint8_t fi_offset : 5;
265 uint16_t orig_pf_func;
266 uint16_t reserved_145_160;
276 uint16_t reserved_209_224;
286 uint64_t frag1_wqe_ptr;
290 union cpt_frag_info {
299 struct cpt_frag_info_s {
304 /* CPT HW swaps each 8B word implicitly */
305 union cpt_frag_info f0;
306 union cpt_frag_info f1;
307 union cpt_frag_info f2;
308 union cpt_frag_info f3;
316 /* CPT HW swaps each 8B word implicitly */
325 union cpt_fc_write_s {
328 uint32_t reserved_32_63;
329 uint64_t reserved_64_127;
334 #endif /* __CPT_HW_H__ */