1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019-2021 Broadcom
6 #ifndef _TF_DEVICE_P58_H_
7 #define _TF_DEVICE_P58_H_
9 #include "cfa_resource_types.h"
12 #include "tf_if_tbl.h"
13 #include "tf_global_cfg.h"
15 extern struct tf_rm_element_cfg tf_tbl_p58[TF_DIR_MAX][TF_TBL_TYPE_MAX];
17 struct tf_rm_element_cfg tf_ident_p58[TF_IDENT_TYPE_MAX] = {
18 [TF_IDENT_TYPE_L2_CTXT_HIGH] = {
19 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_HIGH,
22 [TF_IDENT_TYPE_L2_CTXT_LOW] = {
23 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_LOW,
26 [TF_IDENT_TYPE_PROF_FUNC] = {
27 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_PROF_FUNC,
30 [TF_IDENT_TYPE_WC_PROF] = {
31 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_TCAM_PROF_ID,
34 [TF_IDENT_TYPE_EM_PROF] = {
35 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_EM_PROF_ID,
40 struct tf_rm_element_cfg tf_tcam_p58[TF_TCAM_TBL_TYPE_MAX] = {
41 [TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH] = {
42 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_HIGH,
45 [TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW] = {
46 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_LOW,
49 [TF_TCAM_TBL_TYPE_PROF_TCAM] = {
50 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_PROF_TCAM,
53 [TF_TCAM_TBL_TYPE_WC_TCAM] = {
54 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_WC_TCAM,
57 [TF_TCAM_TBL_TYPE_VEB_TCAM] = {
58 TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P58_VEB_TCAM,
63 struct tf_rm_element_cfg tf_em_int_p58[TF_EM_TBL_TYPE_MAX] = {
64 [TF_EM_TBL_TYPE_EM_RECORD] = {
65 TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P58_EM_REC,
70 struct tf_if_tbl_cfg tf_if_tbl_p58[TF_IF_TBL_TYPE_MAX] = {
71 [TF_IF_TBL_TYPE_PROF_PARIF_DFLT_ACT_REC_PTR] = {
72 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_DFLT_ACT_REC_PTR},
73 [TF_IF_TBL_TYPE_PROF_PARIF_ERR_ACT_REC_PTR] = {
74 TF_IF_TBL_CFG, CFA_P58_TBL_PROF_PARIF_ERR_ACT_REC_PTR},
75 [TF_IF_TBL_TYPE_ILT] = {
76 TF_IF_TBL_CFG, CFA_P58_TBL_ILT},
77 [TF_IF_TBL_TYPE_VSPT] = {
78 TF_IF_TBL_CFG, CFA_P58_TBL_VSPT},
81 struct tf_global_cfg_cfg tf_global_cfg_p58[TF_GLOBAL_CFG_TYPE_MAX] = {
83 TF_GLOBAL_CFG_CFG_HCAPI, TF_TUNNEL_ENCAP
86 TF_GLOBAL_CFG_CFG_HCAPI, TF_ACTION_BLOCK
89 TF_GLOBAL_CFG_CFG_HCAPI, TF_COUNTER_CFG
92 TF_GLOBAL_CFG_CFG_HCAPI, TF_METER_CFG
94 [TF_METER_INTERVAL_CFG] = {
95 TF_GLOBAL_CFG_CFG_HCAPI, TF_METER_INTERVAL_CFG
99 const struct tf_hcapi_resource_map tf_hcapi_res_map_p58[CFA_RESOURCE_TYPE_P58_LAST + 1] = {
100 [CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_HIGH] = {
101 TF_MODULE_TYPE_IDENTIFIER, 1 << TF_IDENT_TYPE_L2_CTXT_HIGH
103 [CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP_LOW] = {
104 TF_MODULE_TYPE_IDENTIFIER, 1 << TF_IDENT_TYPE_L2_CTXT_LOW
106 [CFA_RESOURCE_TYPE_P58_PROF_FUNC] = {
107 TF_MODULE_TYPE_IDENTIFIER, 1 << TF_IDENT_TYPE_PROF_FUNC
109 [CFA_RESOURCE_TYPE_P58_WC_TCAM_PROF_ID] = {
110 TF_MODULE_TYPE_IDENTIFIER, 1 << TF_IDENT_TYPE_WC_PROF
112 [CFA_RESOURCE_TYPE_P58_EM_PROF_ID] = {
113 TF_MODULE_TYPE_IDENTIFIER, 1 << TF_IDENT_TYPE_EM_PROF
115 [CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_HIGH] = {
116 TF_MODULE_TYPE_TCAM, 1 << TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_HIGH
118 [CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM_LOW] = {
119 TF_MODULE_TYPE_TCAM, 1 << TF_TCAM_TBL_TYPE_L2_CTXT_TCAM_LOW
121 [CFA_RESOURCE_TYPE_P58_PROF_TCAM] = {
122 TF_MODULE_TYPE_TCAM, 1 << TF_TCAM_TBL_TYPE_PROF_TCAM
124 [CFA_RESOURCE_TYPE_P58_WC_TCAM] = {
125 TF_MODULE_TYPE_TCAM, 1 << TF_TCAM_TBL_TYPE_WC_TCAM
127 [CFA_RESOURCE_TYPE_P58_VEB_TCAM] = {
128 TF_MODULE_TYPE_TCAM, 1 << TF_TCAM_TBL_TYPE_VEB_TCAM
130 [CFA_RESOURCE_TYPE_P58_EM_FKB] = {
131 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_EM_FKB
133 [CFA_RESOURCE_TYPE_P58_WC_FKB] = {
134 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_WC_FKB
136 [CFA_RESOURCE_TYPE_P58_METER_PROF] = {
137 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_METER_PROF
139 [CFA_RESOURCE_TYPE_P58_METER] = {
140 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_METER_INST
142 [CFA_RESOURCE_TYPE_P58_METER_DROP_CNT] = {
143 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_METER_DROP_CNT
145 [CFA_RESOURCE_TYPE_P58_MIRROR] = {
146 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_MIRROR_CONFIG
148 [CFA_RESOURCE_TYPE_P58_METADATA] = {
149 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_METADATA
151 /* Resources in bank 1 */
152 [CFA_RESOURCE_TYPE_P58_SRAM_BANK_1] = {
153 TF_MODULE_TYPE_TABLE,
154 1 << TF_TBL_TYPE_FULL_ACT_RECORD
155 | 1 << TF_TBL_TYPE_COMPACT_ACT_RECORD
157 /* Resources in bank 2 */
158 [CFA_RESOURCE_TYPE_P58_SRAM_BANK_2] = {
159 TF_MODULE_TYPE_TABLE,
160 1 << TF_TBL_TYPE_ACT_ENCAP_8B |
161 1 << TF_TBL_TYPE_ACT_ENCAP_16B |
162 1 << TF_TBL_TYPE_ACT_ENCAP_32B |
163 1 << TF_TBL_TYPE_ACT_ENCAP_64B |
164 1 << TF_TBL_TYPE_ACT_MODIFY_8B |
165 1 << TF_TBL_TYPE_ACT_MODIFY_16B |
166 1 << TF_TBL_TYPE_ACT_MODIFY_32B |
167 1 << TF_TBL_TYPE_ACT_MODIFY_64B
170 /* Resources in bank 0 */
171 [CFA_RESOURCE_TYPE_P58_SRAM_BANK_0] = {
172 TF_MODULE_TYPE_TABLE,
173 1 << TF_TBL_TYPE_ACT_SP_SMAC |
174 1 << TF_TBL_TYPE_ACT_SP_SMAC_IPV4 |
175 1 << TF_TBL_TYPE_ACT_SP_SMAC_IPV6
177 /* Resources in bank 3 */
178 [CFA_RESOURCE_TYPE_P58_SRAM_BANK_3] = {
179 TF_MODULE_TYPE_TABLE, 1 << TF_TBL_TYPE_ACT_STATS_64
181 [CFA_RESOURCE_TYPE_P58_EM_REC] = {
182 TF_MODULE_TYPE_EM, 1 << TF_EM_TBL_TYPE_EM_RECORD
185 #endif /* _TF_DEVICE_P58_H_ */