common/cnxk: add missing reserved fields
[dpdk.git] / drivers / common / cnxk / hw / cpt.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #ifndef __CPT_HW_H__
6 #define __CPT_HW_H__
7
8 /* Register offsets */
9
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, .) */
17
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)
44
45 #define CPT_AF_LFX_CTL(a)  (0x27000ull | (uint64_t)(a) << 3)
46 #define CPT_AF_LFX_CTL2(a) (0x29000ull | (uint64_t)(a) << 3)
47
48 /* Structures definitions */
49
50 union cpt_lf_ctl {
51         uint64_t u;
52         struct cpt_lf_ctl_s {
53                 uint64_t ena : 1;
54                 uint64_t fc_ena : 1;
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;
59         } s;
60 };
61
62 union cpt_lf_ctx_flush {
63         uint64_t u;
64         struct {
65                 uint64_t cptr : 46;
66                 uint64_t inval : 1;
67                 uint64_t reserved_47_63 : 17;
68         } s;
69 };
70
71 union cpt_lf_ctx_reload {
72         uint64_t u;
73         struct {
74                 uint64_t cptr : 46;
75                 uint64_t reserved_46_63 : 18;
76         } s;
77 };
78
79 union cpt_lf_inprog {
80         uint64_t u;
81         struct cpt_lf_inprog_s {
82                 uint64_t inflight : 9;
83                 uint64_t reserved_9_15 : 7;
84                 uint64_t eena : 1;
85                 uint64_t grp_drp : 1;
86                 uint64_t reserved_18_30 : 13;
87                 uint64_t grb_partial : 1;
88                 uint64_t grb_cnt : 8;
89                 uint64_t gwb_cnt : 8;
90                 uint64_t reserved_48_63 : 16;
91         } s;
92 };
93
94 union cpt_lf_q_base {
95         uint64_t u;
96         struct cpt_lf_q_base_s {
97                 uint64_t fault : 1;
98                 uint64_t stopped : 1;
99                 uint64_t reserved_2_6 : 5;
100                 uint64_t addr : 46;
101                 uint64_t reserved_53_63 : 11;
102         } s;
103 };
104
105 union cpt_lf_q_size {
106         uint64_t u;
107         struct cpt_lf_q_size_s {
108                 uint64_t size_div40 : 15;
109                 uint64_t reserved_15_63 : 49;
110         } s;
111 };
112
113 union cpt_lf_misc_int {
114         uint64_t u;
115         struct cpt_lf_misc_int_s {
116                 uint64_t reserved_0_0 : 1;
117                 uint64_t nqerr : 1;
118                 uint64_t irde : 1;
119                 uint64_t nwrp : 1;
120                 uint64_t reserved_4_4 : 1;
121                 uint64_t hwerr : 1;
122                 uint64_t fault : 1;
123                 uint64_t reserved_7_63 : 57;
124         } s;
125 };
126
127 union cpt_lf_q_grp_ptr {
128         uint64_t u;
129         struct {
130                 uint64_t dq_ptr : 15;
131                 uint64_t reserved_31_15 : 17;
132                 uint64_t nq_ptr : 15;
133                 uint64_t reserved_47_62 : 16;
134                 uint64_t xq_xor : 1;
135         } s;
136 };
137
138 union cpt_inst_w4 {
139         uint64_t u64;
140         struct {
141                 uint64_t dlen : 16;
142                 uint64_t param2 : 16;
143                 uint64_t param1 : 16;
144                 uint64_t opcode_major : 8;
145                 uint64_t opcode_minor : 8;
146         } s;
147 };
148
149 union cpt_inst_w7 {
150         uint64_t u64;
151         struct {
152                 uint64_t cptr : 60;
153                 uint64_t ctx_val : 1;
154                 uint64_t egrp : 3;
155         } s;
156 };
157
158 struct cpt_inst_s {
159         union cpt_inst_w0 {
160                 struct {
161                         uint64_t nixtxl : 3;
162                         uint64_t doneint : 1;
163                         uint64_t nixtx_addr : 60;
164                 } s;
165                 uint64_t u64;
166         } w0;
167
168         uint64_t res_addr;
169
170         union cpt_inst_w2 {
171                 struct {
172                         uint64_t tag : 32;
173                         uint64_t tt : 2;
174                         uint64_t grp : 10;
175                         uint64_t reserved_172_175 : 4;
176                         uint64_t rvu_pf_func : 16;
177                 } s;
178                 uint64_t u64;
179         } w2;
180
181         union cpt_inst_w3 {
182                 struct {
183                         uint64_t qord : 1;
184                         uint64_t reserved_194_193 : 2;
185                         uint64_t wqe_ptr : 61;
186                 } s;
187                 uint64_t u64;
188         } w3;
189
190         union cpt_inst_w4 w4;
191
192         uint64_t dptr;
193
194         uint64_t rptr;
195
196         union cpt_inst_w7 w7;
197 };
198
199 union cpt_res_s {
200         struct cpt_cn10k_res_s {
201                 uint64_t compcode : 7;
202                 uint64_t doneint : 1;
203                 uint64_t uc_compcode : 8;
204                 uint64_t rlen : 16;
205                 uint64_t spi : 32;
206
207                 uint64_t esn;
208         } cn10k;
209
210         struct cpt_cn9k_res_s {
211                 uint64_t compcode : 8;
212                 uint64_t uc_compcode : 8;
213                 uint64_t doneint : 1;
214                 uint64_t reserved_17_63 : 47;
215
216                 uint64_t reserved_64_127;
217         } cn9k;
218 };
219
220 /* [CN10K, .) */
221 struct cpt_parse_hdr_s {
222         /* WORD 0 */
223         union {
224                 uint64_t u64;
225                 struct {
226                         uint8_t pad_len : 3;
227                         uint8_t num_frags : 3;
228                         uint8_t pkt_out : 2;
229
230                         uint8_t err_sum : 1;
231                         uint8_t reas_sts : 4;
232                         uint8_t reserved_53 : 1;
233                         uint8_t et_owr : 1;
234                         uint8_t pkt_fmt : 1;
235
236                         uint16_t match_id : 16;
237
238                         uint32_t cookie : 32;
239                 };
240         } w0;
241
242         /* WORD 1 */
243         uint64_t wqe_ptr;
244
245         /* WORD 2 */
246         union {
247                 uint64_t u64;
248                 struct {
249                         uint8_t fi_pad : 3;
250                         uint8_t fi_offset : 5;
251                         uint8_t il3_off;
252                         uint16_t orig_pf_func;
253                         uint16_t reserved_145_160;
254                         uint16_t frag_age;
255                 };
256         } w2;
257
258         /* WORD 3 */
259         union {
260                 uint64_t u64;
261                 struct {
262                         uint32_t spi;
263                         uint16_t reserved_209_224;
264                         uint8_t uc_ccode;
265                         uint8_t hw_ccode;
266                 };
267         } w3;
268
269         /* WORD 4 */
270         union {
271                 uint64_t u64;
272                 uint64_t esn;
273                 uint64_t frag1_wqe_ptr;
274         };
275 };
276
277 union cpt_frag_info {
278         uint16_t info;
279         struct {
280                 uint16_t f_off : 13;
281                 uint16_t f_mf : 1;
282                 uint16_t f_rsv : 2;
283         };
284 };
285
286 struct cpt_frag_info_s {
287         /* WORD 0 */
288         union {
289                 uint64_t u64;
290                 struct {
291                         union cpt_frag_info f3;
292                         union cpt_frag_info f2;
293                         union cpt_frag_info f1;
294                         union cpt_frag_info f0;
295                 };
296         } w0;
297
298         /* WORD 1 */
299         union {
300                 uint64_t u64;
301                 struct {
302                         uint16_t frag_size3;
303                         uint16_t frag_size2;
304                         uint16_t frag_size1;
305                         uint16_t frag_size0;
306                 };
307         } w1;
308 };
309
310 #endif /* __CPT_HW_H__ */