tomahawk2_mmu_flex_init.h (6792B)
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_mmu_flex_init.h 8 */ 9 10 11 #ifndef _SOC_TOMAHAWK2_MMU_FLEXPORT_H_ 12 #define _SOC_TOMAHAWK2_MMU_FLEXPORT_H_ 13 14 15 #include <soc/flexport/flexport_common.h> 16 #include <soc/flexport/tomahawk2_flexport_defines.h> 17 18 #include <soc/flexport/tomahawk2_mmu_defines.h> 19 #include <soc/flexport/tomahawk2_tdm_flexport.h> 20 21 22 /*! @file tomahawk2_mmu_flex_init.h 23 * @brief Mmu FlexPort functions and structures for Tomahawk2. 24 * Details are shown below. 25 */ 26 27 28 /* Some functions from MMU_CONFIG */ 29 extern int soc_tomahawk2_mmu_get_num_l0_nodes_per_port(int unit, int lcl_port, 30 int pipe, 31 int *number_l0_nodes); 32 33 34 extern int soc_tomahawk2_mmu_get_num_l1_uc_nodes_per_port( 35 int unit, int lcl_port, int pipe, int *number_l1_uc_nodes); 36 37 38 extern int soc_tomahawk2_mmu_get_num_l1_mc_nodes_per_port( 39 int unit, int lcl_port, int pipe, int *number_l1_mc_nodes); 40 41 42 extern int soc_tomahawk2_mmu_get_l0_base_offset_for_port(int unit, int lcl_port, 43 int *l0_offset); 44 45 46 extern int soc_tomahawk2_mmu_get_l1_base_offset_for_port(int unit, int lcl_port, 47 int uc_bit, 48 int *l1_offset); 49 50 extern int soc_tomahawk2_mmu_get_valid_ipipes_for_xpe(int unit, int xpe, 51 int *ipipes); 52 53 54 extern int soc_tomahawk2_mmu_get_valid_epipes_for_xpe(int unit, int xpe, 55 int *epipes); 56 57 extern int soc_tomahawk2_mmu_is_xpe_valid(int unit, int xpe, int *valid); 58 59 60 extern int soc_tomahawk2_get_min_max_src_ct_speed(int unit,int speed_decode, 61 int ct_mode, int ct_profile, 62 uint64 *min_speed, 63 uint64 *max_speed); 64 65 66 extern int soc_tomahawk2_get_asf_xmit_start_count(int unit, int dst_decode, 67 int ct_mode, 68 uint64 *asf_count); 69 70 71 extern int soc_tomahawk2_mmu_get_bst_mode(int unit, int *bst_mode); 72 73 74 extern int soc_tomahawk2_mmu_get_pktstat_mode(int unit, int *pktstat_mode); 75 76 77 extern int soc_tomahawk2_mmu_get_ct_ep_credit_low_high_threshold( 78 int unit, int speed_decode, int frequency, int oversub, int oversub_ratio, 79 uint64 *ep_credit_low, uint64 *ep_credit_hi); 80 81 82 extern int soc_tomahawk2_get_ct_fifo_threshold_depth(int unit, int dst_decode, 83 int ct_mode, int oversub, 84 uint64 *fifo_thresh, 85 uint64 *fifo_depth); 86 87 88 extern int soc_tomahawk2_mmu_return_dip_delay_amount(int unit, int port_speed, 89 uint64 *dip_amount); 90 91 92 extern int soc_tomahawk2_mmu_thdi_get_pg_hdrm_setting(int unit, int speed, 93 int line_rate, 94 uint32 *setting); 95 96 97 /*PORT FLUSH Functions from RQE_VBS_MTRO */ 98 extern int soc_tomahawk2_mmu_vbs_port_flush( 99 int unit, soc_port_resource_t *port_resource_t, uint64 set_val); 100 101 102 extern int soc_tomahawk2_mmu_rqe_port_flush( 103 int unit, soc_port_resource_t *port_resource_t, int phy_port, uint64 set_val); 104 105 106 extern int soc_tomahawk2_mmu_mtro_port_flush( 107 int unit, soc_port_resource_t *port_resource_t, uint64 set_val); 108 109 110 /* THDI/WRED Clear Functions */ 111 extern int soc_tomahawk2_mmu_thdi_bst_clr(int unit, 112 soc_port_resource_t *port_resource_t); 113 114 115 extern int soc_tomahawk2_mmu_wred_clr(int unit, 116 soc_port_resource_t *port_resource_t); 117 118 119 extern int soc_tomahawk2_mmu_get_xpe_from_pipe(int pipe, pipe_t direction, 120 int* xpe_offs); 121 122 123 extern int soc_tomahawk2_mmu_ctr_clr(int unit, 124 soc_port_resource_t *port_resource_t); 125 126 127 /* THDI Setup function */ 128 extern int soc_tomahawk2_mmu_thdi_setup(int unit, 129 soc_port_resource_t *port_resource_t, 130 int lossy); 131 132 133 /* TDM Port EP Credit Clear function*/ 134 extern int soc_tomahawk2_mmu_clear_prev_ep_credits( 135 int unit, soc_port_resource_t *port_resource_t); 136 137 138 /*PORT MAPPING */ 139 extern int soc_tomahawk2_mmu_set_mmu_to_phy_port_mapping( 140 int unit,soc_port_resource_t *port_resource_t); 141 142 143 /*VBS Credit Clear Functions */ 144 extern int soc_tomahawk2_mmu_clear_vbs_credit_memories( 145 int unit,soc_port_resource_t *port_resource_t); 146 147 148 /* MTRO Credit Clear Functions */ 149 extern int soc_tomahawk2_mmu_clear_mtro_bucket_mems( 150 int unit, soc_port_resource_t *port_resource_t); 151 152 153 /*CT Setting Functions */ 154 extern int soc_tomahawk2_mmu_reinit_ct_setting( 155 int unit,soc_port_resource_t *port_resource_t, soc_asf_mode_e ct_mode, 156 soc_asf_mem_profile_e ct_profile, int frequency, 157 int exact_speed, int oversub_ratio); 158 159 160 /* Port Up Sequence */ 161 extern int soc_tomahawk2_flex_mmu_port_up( 162 int unit, soc_port_schedule_state_t *port_schedule_state_t); 163 164 165 /* Port Down Sequence */ 166 extern int soc_tomahawk2_flex_mmu_port_down( 167 int unit, soc_port_schedule_state_t *port_schedule_state_t); 168 169 170 /* Reconfigure Sequence Phase 1 Phase 2 */ 171 extern int soc_tomahawk2_flex_mmu_reconfigure_phase1( 172 int unit, soc_port_schedule_state_t *port_schedule_state_t); 173 174 175 extern int soc_tomahawk2_flex_mmu_reconfigure_phase2( 176 int unit, soc_port_schedule_state_t *port_schedule_state_t); 177 178 179 /* DIP/ForceSAF Sequence */ 180 extern int soc_tomahawk2_mmu_reinit_dip_fsaf_setting( 181 int unit, soc_port_resource_t *port_resource_t); 182 183 184 /* THDU functions */ 185 extern int soc_tomahawk2_mmu_thdu_bst_clr( 186 int unit, 187 soc_port_resource_t *port_resource_t 188 ); 189 190 191 extern int soc_tomahawk2_mmu_thdu_pktstat_clr( 192 int unit, 193 soc_port_resource_t *port_resource_t 194 ); 195 196 197 extern int soc_tomahawk2_mmu_thdu_qgrp_min_limit_config( 198 int unit, 199 soc_port_resource_t *port_resource_t, 200 int lossy 201 ); 202 203 204 /*THDM functions */ 205 extern int soc_tomahawk2_mmu_thdm_bst_clr ( 206 int unit, 207 soc_port_resource_t *port_resource_t 208 ); 209 210 211 #endif