net/bnxt: update TruFlow core index table
[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, 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, 0
23         },
24         [TF_IDENT_TYPE_PROF_FUNC] = {
25                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_PROF_FUNC,
26                 0, 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, 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, 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, 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, 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, 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, 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, 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, 0
65         },
66         [TF_TBL_TYPE_WC_FKB] = {
67                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_FKB,
68                 0, 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, 0
73         },
74         [TF_TBL_TYPE_METER_INST] = {
75                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_METER,
76                 0, 0, 0
77         },
78         [TF_TBL_TYPE_MIRROR_CONFIG] = {
79                 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_MIRROR,
80                 0, 0, 0
81         },
82         /* Policy - ARs in bank 1 */
83         [TF_TBL_TYPE_FULL_ACT_RECORD] = {
84                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
85                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1,
86                 .slices          = 1,
87         },
88         [TF_TBL_TYPE_COMPACT_ACT_RECORD] = {
89                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
90                 .parent_subtype  = TF_TBL_TYPE_FULL_ACT_RECORD,
91                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_1,
92                 .slices          = 1,
93         },
94         /* Policy - Encaps in bank 2 */
95         [TF_TBL_TYPE_ACT_ENCAP_8B] = {
96                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
97                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
98                 .slices          = 1,
99         },
100         [TF_TBL_TYPE_ACT_ENCAP_16B] = {
101                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
102                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
103                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
104                 .slices          = 1,
105         },
106         [TF_TBL_TYPE_ACT_ENCAP_32B] = {
107                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
108                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
109                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
110                 .slices          = 1,
111         },
112         [TF_TBL_TYPE_ACT_ENCAP_64B] = {
113                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
114                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
115                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
116                 .slices          = 1,
117         },
118         /* Policy - Modify in bank 2 with Encaps */
119         [TF_TBL_TYPE_ACT_MODIFY_8B] = {
120                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
121                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
122                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
123                 .slices          = 1,
124         },
125         [TF_TBL_TYPE_ACT_MODIFY_16B] = {
126                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
127                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
128                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
129                 .slices          = 1,
130         },
131         [TF_TBL_TYPE_ACT_MODIFY_32B] = {
132                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
133                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
134                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
135                 .slices          = 1,
136         },
137         [TF_TBL_TYPE_ACT_MODIFY_64B] = {
138                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
139                 .parent_subtype  = TF_TBL_TYPE_ACT_ENCAP_8B,
140                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_2,
141                 .slices          = 1,
142         },
143         /* Policy - SP in bank 0 */
144         [TF_TBL_TYPE_ACT_SP_SMAC] = {
145                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
146                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
147                 .slices          = 1,
148         },
149         [TF_TBL_TYPE_ACT_SP_SMAC_IPV4] = {
150                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
151                 .parent_subtype  = TF_TBL_TYPE_ACT_SP_SMAC,
152                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
153                 .slices          = 1,
154         },
155         [TF_TBL_TYPE_ACT_SP_SMAC_IPV6] = {
156                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_CHILD,
157                 .parent_subtype  = TF_TBL_TYPE_ACT_SP_SMAC,
158                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_0,
159                 .slices          = 1,
160         },
161         /* Policy - Stats in bank 3 */
162         [TF_TBL_TYPE_ACT_STATS_64] = {
163                 .cfg_type        = TF_RM_ELEM_CFG_HCAPI_BA_PARENT,
164                 .hcapi_type      = CFA_RESOURCE_TYPE_P58_SRAM_BANK_3,
165                 .slices          = 1,
166         },
167 };
168
169 struct tf_rm_element_cfg tf_em_int_p58[TF_EM_TBL_TYPE_MAX] = {
170         [TF_EM_TBL_TYPE_EM_RECORD] = {
171                 TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P58_EM_REC,
172                 0, 0, 0
173         },
174 };
175
176 struct tf_if_tbl_cfg tf_if_tbl_p58[TF_IF_TBL_TYPE_MAX] = {
177         [TF_IF_TBL_TYPE_PROF_PARIF_DFLT_ACT_REC_PTR] = {
178                 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_DFLT_ACT_REC_PTR},
179         [TF_IF_TBL_TYPE_PROF_PARIF_ERR_ACT_REC_PTR] = {
180                 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_ERR_ACT_REC_PTR},
181         [TF_IF_TBL_TYPE_ILT] = {
182                 TF_IF_TBL_CFG, CFA_P58_TBL_ILT},
183         [TF_IF_TBL_TYPE_VSPT] = {
184                 TF_IF_TBL_CFG, CFA_P58_TBL_VSPT},
185 };
186
187 struct tf_global_cfg_cfg tf_global_cfg_p58[TF_GLOBAL_CFG_TYPE_MAX] = {
188         [TF_TUNNEL_ENCAP] = {
189                 TF_GLOBAL_CFG_CFG_HCAPI, TF_TUNNEL_ENCAP
190         },
191         [TF_ACTION_BLOCK] = {
192                 TF_GLOBAL_CFG_CFG_HCAPI, TF_ACTION_BLOCK
193         },
194         [TF_COUNTER_CFG] = {
195                 TF_GLOBAL_CFG_CFG_HCAPI, TF_COUNTER_CFG
196         },
197 };
198 #endif /* _TF_DEVICE_P58_H_ */