tomahawk2_flexport.h (3895B)
1 /* 2 * 3 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 4 * 5 * Copyright 2007-2019 Broadcom Inc. All rights reserved. 6 * 7 * $File: tomahawk2_flexport.h 8 */ 9 10 11 #ifndef SOC_TOMAHAWK2_FLEXPORT_H 12 #define SOC_TOMAHAWK2_FLEXPORT_H 13 14 15 /*! @file tomahawk2_flexport.h 16 * @brief FlexPort functions and structures for Tomahawk2. 17 * Details are shown below. 18 */ 19 20 #include <soc/flexport/flexport_common.h> 21 #include <soc/flexport/tomahawk2_tdm_flexport.h> 22 #include <soc/flexport/tomahawk2_mmu_flex_init.h> 23 #include <soc/flexport/tomahawk2_idb_flexport.h> 24 #include <soc/flexport/tomahawk2_ep_flexport.h> 25 26 #include <soc/flexport/tomahawk2_mac_flexport.h> 27 28 /*! @struct soc_tomahawk2_flex_scratch_t 29 * @brief Scratch pad locals. Caller must not allocate. Callee allocates 30 * at entry and deallocates before return. This area is pointed 31 * to by the cookie in soc_port_schedule_state_t struct type. 32 */ 33 typedef struct soc_tomahawk2_flex_scratch_s { 34 /*!< Previous OVS tables needed by the OVS consolidation sequence */ 35 soc_tdm_schedule_pipe_t prev_tdm_ingress_schedule_pipe[SOC_MAX_NUM_PIPES]; 36 soc_tdm_schedule_pipe_t prev_tdm_egress_schedule_pipe[SOC_MAX_NUM_PIPES]; 37 /*!< Current state of OVS tables; is changing during flexport sequence 38 * initial state is prev OVS tables and after OVS flexport sequence 39 * converges to new_ OVS tables*/ 40 soc_tdm_schedule_pipe_t curr_tdm_ingress_schedule_pipe[SOC_MAX_NUM_PIPES]; 41 soc_tdm_schedule_pipe_t curr_tdm_egress_schedule_pipe[SOC_MAX_NUM_PIPES]; 42 /*!< Previous and new Oversub ratios; per PIPE and per HALF PIPE 43 * These are coded as follows: 44 * 10 - this is LR; 45 * 15 - this is OVS with 3:2; ovs_ratio <= 1.5; 46 * 20 - this is OVS with 2:1; 1.5 < ovs_ratio <= 2.0; 47 */ 48 int prev_pipe_ovs_ratio[SOC_MAX_NUM_PIPES]; /* per PIPE ovs_ratio 49 * per Half PIPE ovs_ratio */ 50 int prev_hpipe_ovs_ratio[SOC_MAX_NUM_PIPES][_TH2_OVS_HPIPE_COUNT_PER_PIPE]; 51 int new_pipe_ovs_ratio[SOC_MAX_NUM_PIPES]; /* per PIPE ovs_ratio 52 * per Half PIPE ovs_ratio */ 53 int new_hpipe_ovs_ratio[SOC_MAX_NUM_PIPES][_TH2_OVS_HPIPE_COUNT_PER_PIPE]; 54 55 /* This keeps the exact bitrate of the out_port_map.log_port_speed[] */ 56 enum port_speed_e exact_out_log_port_speed[SOC_MAX_NUM_PORTS]; 57 } soc_tomahawk2_flex_scratch_t; 58 59 60 extern void *soc_tomahawk2_port_lane_info_alloc (void); 61 62 63 extern int soc_tomahawk2_set_port_lane_info ( 64 int unit, 65 const void *lane_info_ptr, 66 int port_idx, 67 int pgw, 68 int xlp 69 ); 70 71 72 extern int soc_tomahawk2_get_port_lane_info ( 73 int unit, 74 const void *lane_info_ptr, 75 int * port_idx, 76 int * pgw, 77 int * xlp 78 ); 79 80 81 extern int soc_tomahawk2_reconfigure_ports ( 82 int unit, 83 soc_port_schedule_state_t *port_schedule_state 84 ); 85 86 87 extern int soc_tomahawk2_flex_start ( 88 int unit, 89 soc_port_schedule_state_t *port_schedule_state 90 ); 91 92 93 extern int soc_tomahawk2_flex_end ( 94 int unit, 95 soc_port_schedule_state_t *port_schedule_state 96 ); 97 98 99 extern int soc_tomahawk2_flex_top_port_down ( 100 int unit, 101 soc_port_schedule_state_t *port_schedule_state 102 ); 103 104 105 extern int soc_tomahawk2_flex_top_port_up ( 106 int unit, 107 soc_port_schedule_state_t *port_schedule_state 108 ); 109 110 extern int soc_tomahawk2_get_ct_class(int speed); 111 112 extern int (*flexport_phases[MAX_FLEX_PHASES]) (int unit, 113 soc_port_schedule_state_t 114 *port_schedule_state); 115 116 #endif /* SOC_TOMAHAWK2_FLEXPORT_H */