eal: remove sys/queue.h from public headers
[dpdk.git] / drivers / net / bnxt / tf_core / tf_device_p58.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019-2021 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _TF_DEVICE_P58_H_
7 #define _TF_DEVICE_P58_H_
8
9 #include "cfa_resource_types.h"
10 #include "tf_core.h"
11 #include "tf_rm.h"
12 #include "tf_if_tbl.h"
13 #include "tf_global_cfg.h"
14
15 struct tf_rm_element_cfg tf_ident_p58[TF_IDENT_TYPE_MAX] = {
16         [TF_IDENT_TYPE_L2_CTXT_HIGH] = {
17                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_HIGH,
18                 0, 0
19         },
20         [TF_IDENT_TYPE_L2_CTXT_LOW] = {
21                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_LOW,
22                 0, 0
23         },
24         [TF_IDENT_TYPE_PROF_FUNC] = {
25                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_PROF_FUNC,
26                 0, 0
27         },
28         [TF_IDENT_TYPE_WC_PROF] = {
29                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_TCAM_PROF_ID,
30                 0, 0
31         },
32         [TF_IDENT_TYPE_EM_PROF] = {
33                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_EM_PROF_ID,
34                 0, 0
35         },
36 };
37
38 struct tf_rm_element_cfg tf_tcam_p58[TF_TCAM_TBL_TYPE_MAX] = {
39         [TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH] = {
40                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_HIGH,
41                 0, 0
42         },
43         [TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW] = {
44                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_LOW,
45                 0, 0
46         },
47         [TF_TCAM_TBL_TYPE_PROF_TCAM] = {
48                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_PROF_TCAM,
49                 0, 0
50         },
51         [TF_TCAM_TBL_TYPE_WC_TCAM] = {
52                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_TCAM,
53                 0, 0
54         },
55         [TF_TCAM_TBL_TYPE_VEB_TCAM] = {
56                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_VEB_TCAM,
57                 0, 0
58         },
59 };
60
61 struct tf_rm_element_cfg tf_tbl_p58[TF_TBL_TYPE_MAX] = {
62         [TF_TBL_TYPE_EM_FKB] = {
63                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_EM_FKB,
64                 0, 0
65         },
66         [TF_TBL_TYPE_WC_FKB] = {
67                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_FKB,
68                 0, 0
69         },
70         [TF_TBL_TYPE_METER_PROF] = {
71                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_METER_PROF,
72                 0, 0
73         },
74         [TF_TBL_TYPE_METER_INST] = {
75                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_METER,
76                 0, 0
77         },
78         [TF_TBL_TYPE_METER_DROP_CNT] = {
79                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_METER_DROP_CNT,
80                 0, 0
81         },
82         [TF_TBL_TYPE_MIRROR_CONFIG] = {
83                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_MIRROR,
84                 0, 0
85         },
86         [TF_TBL_TYPE_METADATA] = {
87                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_METADATA,
88                 0, 0
89         },
90         /* Policy - ARs in bank 1 */
91         [TF_TBL_TYPE_FULL_ACT_RECORD] = {
92                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
93                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1,
94                 .slices          = 4,
95         },
96         [TF_TBL_TYPE_COMPACT_ACT_RECORD] = {
97                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
98                 .parent_subtype  = TF_TBL_TYPE_FULL_ACT_RECORD,
99                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1,
100                 .slices          = 8,
101         },
102         /* Policy - Encaps in bank 2 */
103         [TF_TBL_TYPE_ACT_ENCAP_8B] = {
104                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
105                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
106                 .slices          = 8,
107         },
108         [TF_TBL_TYPE_ACT_ENCAP_16B] = {
109                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
110                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
111                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
112                 .slices          = 4,
113         },
114         [TF_TBL_TYPE_ACT_ENCAP_32B] = {
115                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
116                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
117                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
118                 .slices          = 2,
119         },
120         [TF_TBL_TYPE_ACT_ENCAP_64B] = {
121                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
122                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
123                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
124                 .slices          = 1,
125         },
126         /* Policy - Modify in bank 2 with Encaps */
127         [TF_TBL_TYPE_ACT_MODIFY_8B] = {
128                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
129                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
130                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
131                 .slices          = 8,
132         },
133         [TF_TBL_TYPE_ACT_MODIFY_16B] = {
134                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
135                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
136                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
137                 .slices          = 4,
138         },
139         [TF_TBL_TYPE_ACT_MODIFY_32B] = {
140                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
141                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
142                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
143                 .slices          = 2,
144         },
145         [TF_TBL_TYPE_ACT_MODIFY_64B] = {
146                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
147                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
148                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
149                 .slices          = 1,
150         },
151         /* Policy - SP in bank 0 */
152         [TF_TBL_TYPE_ACT_SP_SMAC] = {
153                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
154                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
155                 .slices          = 8,
156         },
157         [TF_TBL_TYPE_ACT_SP_SMAC_IPV4] = {
158                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
159                 .parent_subtype  = TF_TBL_TYPE_ACT_SP_SMAC,
160                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
161                 .slices          = 4,
162         },
163         [TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = {
164                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
165                 .parent_subtype  = TF_TBL_TYPE_ACT_SP_SMAC,
166                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
167                 .slices          = 2,
168         },
169         /* Policy - Stats in bank 3 */
170         [TF_TBL_TYPE_ACT_STATS_64] = {
171                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
172                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_3,
173                 .slices          = 8,
174         },
175 };
176
177 struct tf_rm_element_cfg tf_em_int_p58[TF_EM_TBL_TYPE_MAX] = {
178         [TF_EM_TBL_TYPE_EM_RECORD] = {
179                 TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P58_EM_REC,
180                 0, 0
181         },
182 };
183
184 struct tf_if_tbl_cfg tf_if_tbl_p58[TF_IF_TBL_TYPE_MAX] = {
185         [TF_IF_TBL_TYPE_PROF_PARIF_DFLT_ACT_REC_PTR] = {
186                 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_DFLT_ACT_REC_PTR},
187         [TF_IF_TBL_TYPE_PROF_PARIF_ERR_ACT_REC_PTR] = {
188                 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_ERR_ACT_REC_PTR},
189         [TF_IF_TBL_TYPE_ILT] = {
190                 TF_IF_TBL_CFG, CFA_P58_TBL_ILT},
191         [TF_IF_TBL_TYPE_VSPT] = {
192                 TF_IF_TBL_CFG, CFA_P58_TBL_VSPT},
193 };
194
195 struct tf_global_cfg_cfg tf_global_cfg_p58[TF_GLOBAL_CFG_TYPE_MAX] = {
196         [TF_TUNNEL_ENCAP] = {
197                 TF_GLOBAL_CFG_CFG_HCAPI, TF_TUNNEL_ENCAP
198         },
199         [TF_ACTION_BLOCK] = {
200                 TF_GLOBAL_CFG_CFG_HCAPI, TF_ACTION_BLOCK
201         },
202         [TF_COUNTER_CFG] = {
203                 TF_GLOBAL_CFG_CFG_HCAPI, TF_COUNTER_CFG
204         },
205         [TF_METER_CFG] = {
206                 TF_GLOBAL_CFG_CFG_HCAPI, TF_METER_CFG
207         },
208         [TF_METER_INTERVAL_CFG] = {
209                 TF_GLOBAL_CFG_CFG_HCAPI, TF_METER_INTERVAL_CFG
210         },
211 };
212 #endif /* _TF_DEVICE_P58_H_ */