1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Broadcom
10 typedef enum tf_type {
12 TF_TYPE_LAST = TF_TYPE_TRUFLOW,
15 typedef enum tf_subtype {
16 HWRM_TFT_GET_GLOBAL_CFG = 821,
17 HWRM_TFT_SET_GLOBAL_CFG = 822,
18 HWRM_TFT_TBL_TYPE_BULK_GET = 825,
19 HWRM_TFT_IF_TBL_SET = 827,
20 HWRM_TFT_IF_TBL_GET = 828,
21 TF_SUBTYPE_LAST = HWRM_TFT_IF_TBL_GET,
24 /* Request and Response compile time checking */
25 /* u32_t tlv_req_value[26]; */
26 #define TF_MAX_REQ_SIZE 104
27 /* u32_t tlv_resp_value[170]; */
28 #define TF_MAX_RESP_SIZE 680
30 /* Use this to allocate/free any kind of
31 * indexes over HWRM and fill the parms pointer
33 #define TF_BULK_RECV 128
34 #define TF_BULK_SEND 16
37 #define TF_DEV_DATA_TYPE_TF_EM_RULE_INSERT_KEY_DATA 0x2e30UL
39 #define TF_DEV_DATA_TYPE_TF_EM_RULE_DELETE_KEY_DATA 0x2e40UL
40 /* L2 Context DMA Address Type */
41 #define TF_DEV_DATA_TYPE_TF_L2_CTX_DMA_ADDR 0x2fe0UL
42 /* L2 Context Entry */
43 #define TF_DEV_DATA_TYPE_TF_L2_CTX_ENTRY 0x2fe1UL
44 /* Prof tcam DMA Address Type */
45 #define TF_DEV_DATA_TYPE_TF_PROF_TCAM_DMA_ADDR 0x3030UL
47 #define TF_DEV_DATA_TYPE_TF_PROF_TCAM_ENTRY 0x3031UL
48 /* WC DMA Address Type */
49 #define TF_DEV_DATA_TYPE_TF_WC_DMA_ADDR 0x30d0UL
51 #define TF_DEV_DATA_TYPE_TF_WC_ENTRY 0x30d1UL
52 /* SPIF DFLT L2 CTXT Entry */
53 #define TF_DEV_DATA_TYPE_SPIF_DFLT_L2_CTXT 0x3131UL
54 /* PARIF DFLT ACT REC PTR Entry */
55 #define TF_DEV_DATA_TYPE_PARIF_DFLT_ACT_REC 0x3132UL
56 /* PARIF ERR DFLT ACT REC PTR Entry */
57 #define TF_DEV_DATA_TYPE_PARIF_ERR_DFLT_ACT_REC 0x3133UL
59 #define TF_DEV_DATA_TYPE_ILT 0x3134UL
61 #define TF_DEV_DATA_TYPE_VNIC_SVIF 0x3135UL
63 #define TF_DEV_DATA_TYPE_TF_ACTION_DATA 0x3170UL
64 #define TF_DEV_DATA_TYPE_LAST TF_DEV_DATA_TYPE_TF_ACTION_DATA
66 #define TF_BITS2BYTES(x) (((x) + 7) >> 3)
67 #define TF_BITS2BYTES_WORD_ALIGN(x) ((((x) + 31) >> 5) * 4)
69 struct tf_set_global_cfg_input;
70 struct tf_get_global_cfg_input;
71 struct tf_get_global_cfg_output;
72 struct tf_tbl_type_bulk_get_input;
73 struct tf_tbl_type_bulk_get_output;
74 struct tf_if_tbl_set_input;
75 struct tf_if_tbl_get_input;
76 struct tf_if_tbl_get_output;
77 /* Input params for global config set */
78 typedef struct tf_set_global_cfg_input {
80 uint32_t fw_session_id;
83 /* When set to 0, indicates the query apply to RX */
84 #define TF_SET_GLOBAL_CFG_INPUT_FLAGS_DIR_RX (0x0)
85 /* When set to 1, indicates the query apply to TX */
86 #define TF_SET_GLOBAL_CFG_INPUT_FLAGS_DIR_TX (0x1)
89 /* Offset of the type */
91 /* Size of the data to set in bytes */
94 uint8_t data[TF_BULK_SEND];
95 } tf_set_global_cfg_input_t, *ptf_set_global_cfg_input_t;
97 /* Input params for global config to get */
98 typedef struct tf_get_global_cfg_input {
100 uint32_t fw_session_id;
103 /* When set to 0, indicates the query apply to RX */
104 #define TF_GET_GLOBAL_CFG_INPUT_FLAGS_DIR_RX (0x0)
105 /* When set to 1, indicates the query apply to TX */
106 #define TF_GET_GLOBAL_CFG_INPUT_FLAGS_DIR_TX (0x1)
107 /* Config to retrieve */
109 /* Offset to retrieve */
111 /* Size of the data to set in bytes */
113 } tf_get_global_cfg_input_t, *ptf_get_global_cfg_input_t;
115 /* Output params for global config */
116 typedef struct tf_get_global_cfg_output {
117 /* Size of the total data read in bytes */
120 uint8_t data[TF_BULK_SEND];
121 } tf_get_global_cfg_output_t, *ptf_get_global_cfg_output_t;
123 /* Input params for table type get */
124 typedef struct tf_tbl_type_bulk_get_input {
126 uint32_t fw_session_id;
129 /* When set to 0, indicates the get apply to RX */
130 #define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX (0x0)
131 /* When set to 1, indicates the get apply to TX */
132 #define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX (0x1)
133 /* When set to 1, indicates the clear entry on read */
134 #define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ (0x2)
135 /* Type of the object to set */
137 /* Starting index to get from */
138 uint32_t start_index;
139 /* Number of entries to get */
140 uint32_t num_entries;
141 /* Host memory where data will be stored */
143 } tf_tbl_type_bulk_get_input_t, *ptf_tbl_type_bulk_get_input_t;
145 /* Output params for table type get */
146 typedef struct tf_tbl_type_bulk_get_output {
147 /* Size of the total data read in bytes */
149 } tf_tbl_type_bulk_get_output_t, *ptf_tbl_type_bulk_get_output_t;
151 /* Input params for if tbl set */
152 typedef struct tf_if_tbl_set_input {
154 uint32_t fw_session_id;
157 /* When set to 0, indicates the query apply to RX */
158 #define TF_IF_TBL_SET_INPUT_FLAGS_DIR_RX (0x0)
159 /* When set to 1, indicates the query apply to TX */
160 #define TF_IF_TBL_SET_INPUT_FLAGS_DIR_TX (0x1)
162 uint16_t tf_if_tbl_type;
163 /* index of table entry */
165 /* size of the data write to table entry */
166 uint32_t data_sz_in_bytes;
167 /* data to write into table entry */
169 } tf_if_tbl_set_input_t, *ptf_if_tbl_set_input_t;
171 /* Input params for if tbl get */
172 typedef struct tf_if_tbl_get_input {
174 uint32_t fw_session_id;
177 /* When set to 0, indicates the query apply to RX */
178 #define TF_IF_TBL_GET_INPUT_FLAGS_DIR_RX (0x0)
179 /* When set to 1, indicates the query apply to TX */
180 #define TF_IF_TBL_GET_INPUT_FLAGS_DIR_TX (0x1)
182 uint16_t tf_if_tbl_type;
183 /* size of the data get from table entry */
184 uint32_t data_sz_in_bytes;
185 /* index of table entry */
187 } tf_if_tbl_get_input_t, *ptf_if_tbl_get_input_t;
189 /* output params for if tbl get */
190 typedef struct tf_if_tbl_get_output {
191 /* Value read from table entry */
193 } tf_if_tbl_get_output_t, *ptf_if_tbl_get_output_t;
195 #endif /* _HWRM_TF_H_ */