port.h (7481B)
1 /** \file bcm_int/dnx/port/port.h 2 * 3 * Adding and removing ports 4 * 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 8 */ 9 10 #ifndef DNX_PORT_INCLUDED_H 11 /* 12 * { 13 */ 14 #define DNX_PORT_INCLUDED_H 15 16 #ifndef BCM_DNX_SUPPORT 17 #error "This file is for use by DNX family only!" 18 #endif 19 20 /* 21 * Include files. 22 * { 23 */ 24 #include <bcm/port.h> 25 #include <soc/dnxc/dnxc_port.h> 26 /* 27 * } 28 */ 29 30 /* 31 * DEFINES 32 * { 33 */ 34 35 /* 36 * } 37 */ 38 39 /** 40 * \brief - Set per tm_port out_pp_port and destination_system_port 41 * Provide mapping between source system port and gport 42 * 43 * \param [in] unit - Relevant unit 44 * \param [in] core_id - Core id 45 * \param [in] out_pp_port - Out pp port 46 * \param [in] tm_port - Tm port 47 * \param [in] src_system_port - Source system port 48 * \param [in] dst_system_port - Destination system port 49 * 50 * \return 51 * shr_error_e 52 * 53 * \remark 54 * * None 55 * \see 56 * * None 57 */ 58 shr_error_e dnx_port_pp_mapping_set( 59 int unit, 60 bcm_core_t core_id, 61 uint32 out_pp_port, 62 uint32 tm_port, 63 uint32 src_system_port, 64 uint32 dst_system_port); 65 66 /** 67 * \brief - Configure general PP port configuration for the basic PP port addition 68 * 69 * \param [in] unit - Relevant unit 70 * 71 * \return 72 * shr_error_e 73 * 74 * \remark 75 * * None 76 * \see 77 * * None 78 */ 79 shr_error_e dnx_port_add_pp_init( 80 int unit); 81 82 /** 83 * \brief - Configure general PP port configuration for the basic PP port removal 84 * 85 * \param [in] unit - Relevant unit 86 * 87 * \return 88 * shr_error_e 89 * 90 * \remark 91 * * None 92 * \see 93 * * None 94 */ 95 shr_error_e dnx_port_remove_pp_init( 96 int unit); 97 98 /** 99 * \brief - retrieve status queries the PHY 100 * 101 * \param [in] unit - Relevant unit 102 * \param [in] port - port 103 * \param [out] link - link status 104 * 105 * \return 106 * shr_error_e 107 * 108 * \remark 109 * * None 110 * \see 111 * * None 112 */ 113 shr_error_e dnx_port_link_get( 114 int unit, 115 bcm_port_t port, 116 int *link); 117 118 /** 119 * \brief - clear pp_dsp mapping table. 120 * 121 * \param [in] unit - unit number 122 * \param [in] core - core index 123 * \param [in] pp_dsp - pp_dsp 124 * 125 * \return 126 * shr_error_e 127 * 128 * \remark 129 * * None 130 * \see 131 * * None 132 */ 133 shr_error_e dnx_port_pp_dsp_table_mapping_clear( 134 int unit, 135 int core, 136 int pp_dsp); 137 138 /** 139 * \brief - set pp_dsp to tm port mapping. 140 * this mapping for existing local ports should be 1 to 1 and it is taken as an assumption in many places. 141 * pp dsps that are currently not assotiated with any local ports should be set to invlaid_otm_port value. 142 * 143 * \param [in] unit - unit number 144 * \param [in] core - core index 145 * \param [in] pp_dsp - pp_dsp 146 * \param [in] tm_port - tm port to set 147 * 148 * \return 149 * shr_error_e 150 * 151 * \remark 152 * * None 153 * \see 154 * * None 155 */ 156 shr_error_e dnx_port_pp_dsp_to_tm_mapping_set( 157 int unit, 158 int core, 159 int pp_dsp, 160 int tm_port); 161 162 /** 163 * \brief - get pp_dsp to tm port mapping. 164 * this mapping for existing local ports should be 1 to 1 and it is taken as an assumption in many places. 165 * pp dsps that are currently not assotiated with any local ports will be set to invlaid_otm_port value. 166 * 167 * \param [in] unit - unit number 168 * \param [in] core - core index 169 * \param [in] pp_dsp - pp_dsp 170 * \param [out] tm_port - tm port to get 171 * 172 * \return 173 * shr_error_e 174 * 175 * \remark 176 * * None 177 * \see 178 * * None 179 */ 180 shr_error_e dnx_port_pp_dsp_to_tm_mapping_get( 181 int unit, 182 int core, 183 int pp_dsp, 184 int *tm_port); 185 186 /** 187 * \brief - set dsp_ptr_table 188 * 189 * \param [in] unit - unit number 190 * \param [in] tm_port - tm port 191 * \param [in] core - core index 192 * \param [in] out_pp_port - pp port to set 193 * \param [in] destination_system_port - destination system port 194 * to set 195 * 196 * \return 197 * shr_error_e 198 * 199 * \remark 200 * * it is assumed that TM_PORT == PP_DSP when this function is used. 201 * \see 202 * * None 203 */ 204 shr_error_e dnx_port_dsp_table_mapping_set( 205 int unit, 206 int tm_port, 207 int core, 208 int out_pp_port, 209 uint32 destination_system_port); 210 211 /** 212 * \brief - get dsp_ptr_table 213 * 214 * \param [in] unit - unit number 215 * \param [in] tm_port - tm port 216 * \param [in] core - core index 217 * \param [in] out_pp_port - recieved pp port 218 * \param [in] destination_system_port - recieved destination 219 * system port 220 * 221 * \return 222 * shr_error_e 223 * 224 * \remark 225 * * it is assumed that TM_PORT == PP_DSP when this function is used. 226 * \see 227 * * None 228 */ 229 shr_error_e dnx_port_dsp_table_mapping_get( 230 int unit, 231 int core, 232 int tm_port, 233 int *out_pp_port, 234 uint32 *destination_system_port); 235 236 /** 237 * \brief - Get PP_DSP for a port 238 * 239 * \param [in] unit - Unit ID 240 * \param [in] port - port ID 241 * \param [out] pp_dsp - pp_dsp for the port 242 * \param [out] core - core for coe port 243 * 244 * \return 245 * shr_error_e 246 * 247 * \remark 248 * * None 249 * \see 250 * * None 251 */ 252 shr_error_e 253 dnx_port_pp_dsp_get( 254 int unit, 255 bcm_port_t port, 256 int *pp_dsp, 257 bcm_core_t *core); 258 259 /** 260 * \brief - Get the port info according the aciton mask. 261 */ 262 shr_error_e dnx_port_selective_get( 263 int unit, 264 bcm_port_t port, 265 bcm_port_info_t * info); 266 267 /** 268 * \brief - Get all the support port info for the given port. 269 */ 270 shr_error_e dnx_port_info_get( 271 int unit, 272 bcm_port_t port, 273 bcm_port_info_t * info); 274 275 /** 276 * \brief 277 * Verify that port is from allowed types. 278 * 279 * \param [in] unit - unit ID 280 * \param [in] port - port 281 * 282 * \return 283 * shr_err_e 284 * \remark 285 * * None 286 * \see 287 * * None 288 */ 289 shr_error_e dnx_port_logical_verify( 290 int unit, 291 bcm_gport_t port); 292 293 /** 294 * \brief 295 * Get the logical port of a specific port 296 * 297 * \param [in] unit - unit ID 298 * \param [in] port - port 299 * \param [out] logical_port - logical port 300 * \return 301 * shr_err_e 302 * 303 * \remark 304 * * None 305 * \see 306 * * None 307 */ 308 shr_error_e dnx_port_logical_get( 309 int unit, 310 bcm_gport_t port, 311 bcm_port_t * logical_port); 312 313 /** 314 * \brief - PHY Measure for all the IMB ports. 315 */ 316 shr_error_e dnx_port_phy_measure_get( 317 int unit, 318 bcm_port_t port, 319 int is_rx, 320 soc_dnxc_port_phy_measure_t * phy_measure); 321 322 /* 323 * \brief 324 * Get SoC property values of phy lane config bits. 325 * set/clear the bits in port_resource.phy_lane_config accordingly 326 */ 327 shr_error_e dnx_port_resource_lane_config_soc_properties_get( 328 int unit, 329 bcm_port_t port, 330 bcm_port_resource_t * port_resource); 331 332 /** 333 * \brief - Configure the FlexE client resource 334 */ 335 shr_error_e dnx_port_flexe_resource_set( 336 int unit, 337 bcm_port_t port, 338 uint32 flags); 339 340 /** 341 * \brief - ILKN RX link status change interrupt handler 342 * 343 * \param [in] unit - Relevant unit 344 * \param [in] block_instance - ILKN block instance. 345 * \param [in] port_in_core - Internal port index in core (0,1) 346 */ 347 shr_error_e dnx_port_ilkn_rx_status_change_interrupt_handler( 348 int unit, 349 int block_instance, 350 uint8 *port_in_core); 351 352 /** 353 * \brief - Configure per port the first header offset to skip 354 * 355 * \param [in] unit - Relevant unit 356 * \param [in] port - Port 357 * \param [in] first_header_size_value - The size (in bytes) of the first header offset to skip 358 * 359 * \return 360 * shr_error_e 361 * 362 * \remark 363 * * None 364 * \see 365 * * None 366 */ 367 shr_error_e dnx_port_first_header_size_to_skip_set( 368 int unit, 369 bcm_port_t port, 370 uint32 first_header_size_value); 371 /* 372 * } 373 */ 374 #endif /** DNX_PORT_INCLUDED_H */