octeon: native driver for Marvell Octeon SoC
[vpp.git] / src / plugins / dev_octeon / hw_defs.h
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright (c) 2023 Cisco Systems, Inc.
3  */
4
5 #ifndef _OCT_HW_DEFS_H_
6 #define _OCT_HW_DEFS_H_
7
8 #include <vppinfra/clib.h>
9 #include <base/roc_api.h>
10
11 typedef union
12 {
13   struct
14   {
15     u64 tail : 20;
16     u64 head : 20;
17     u64 resv40 : 6;
18     u64 cq_err : 1;
19     u64 resv47 : 16;
20     u64 op_err : 1;
21   };
22   u64 as_u64;
23 } oct_nix_lf_cq_op_status_t;
24
25 STATIC_ASSERT_SIZEOF (oct_nix_lf_cq_op_status_t, 8);
26
27 typedef union
28 {
29   struct
30   {
31     u64 aura : 20;
32     u64 _reseved20 : 12;
33     u64 count_eot : 1;
34     u64 _reserved33 : 30;
35     u64 fabs : 1;
36   };
37   u64 as_u64;
38 } oct_npa_lf_aura_batch_free0_t;
39
40 STATIC_ASSERT_SIZEOF (oct_npa_lf_aura_batch_free0_t, 8);
41
42 typedef struct
43 {
44   oct_npa_lf_aura_batch_free0_t w0;
45   u64 data[15];
46 } oct_npa_lf_aura_batch_free_line_t;
47
48 STATIC_ASSERT_SIZEOF (oct_npa_lf_aura_batch_free_line_t, 128);
49
50 typedef union
51 {
52   struct npa_batch_alloc_compare_s compare_s;
53   u64 as_u64;
54 } oct_npa_batch_alloc_compare_t;
55
56 typedef union
57 {
58   struct
59   {
60     union nix_send_hdr_w0_u hdr_w0;
61     union nix_send_hdr_w1_u hdr_w1;
62     union nix_send_sg_s sg[8];
63   };
64   u128 as_u128[5];
65 } oct_tx_desc_t;
66
67 STATIC_ASSERT_SIZEOF (oct_tx_desc_t, 80);
68
69 typedef union
70 {
71   u128 dwords[8];
72   u64 words[16];
73 } lmt_line_t;
74
75 STATIC_ASSERT_SIZEOF (lmt_line_t, 1 << ROC_LMT_LINE_SIZE_LOG2);
76
77 typedef union
78 {
79   union nix_rx_parse_u f;
80   u64 w[7];
81 } oct_nix_rx_parse_t;
82
83 STATIC_ASSERT_SIZEOF (oct_nix_rx_parse_t, 56);
84
85 typedef struct
86 {
87   CLIB_ALIGN_MARK (desc, 128);
88   struct nix_cqe_hdr_s hdr;
89   oct_nix_rx_parse_t parse;
90   struct nix_rx_sg_s sg0;
91   void *segs0[3];
92   struct nix_rx_sg_s sg1;
93   void *segs1[3];
94 } oct_nix_rx_cqe_desc_t;
95
96 STATIC_ASSERT_SIZEOF (oct_nix_rx_cqe_desc_t, 128);
97
98 #endif /* _OCT_HW_DEFS_H_ */