tomahawk3_ep_init.h (4122B)
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: tomahawk3_ep_init.h 8 */ 9 10 11 #ifndef _SOC_TOMAHAWK3_EP_INIT_H_ 12 #define _SOC_TOMAHAWK3_EP_INIT_H_ 13 14 #include <soc/init/tomahawk3_flexport_defines.h> 15 #include <soc/init/tomahawk3_set_tdm.h> 16 17 /*** START SDK API COMMON CODE ***/ 18 19 #define TH3_EP_XMIT_XNT_NUM_FREQS 1 20 21 /* Transmit Start Count */ 22 typedef struct soc_th3_edb_xmit_start_count_s { 23 /* NOTE: DON'T ALTER FIELD ORDER */ 24 uint8 saf; /* SAF value */ 25 uint8 ct; /* CT val */ 26 } soc_th3_edb_xmit_start_count_t; 27 28 /* EP2MMU and Prebuffer core config */ 29 typedef struct soc_th3_ep_cfg_s { 30 /* NOTE: DON'T ALTER FIELD ORDER */ 31 int speed; 32 int ct_class; 33 int egr_mmu_credit; /* for general cases */ 34 int egr_mmu_credit_pfc_opt; /* for PFC optimized at 1325/1000 */ 35 soc_th3_edb_xmit_start_count_t xmit_cnt_per_freq[TH3_EP_XMIT_XNT_NUM_FREQS]; 36 } soc_th3_ep_core_cfg_t; 37 38 39 extern int soc_tomahawk3_div_round( 40 int nominator, 41 int denominator); 42 43 extern int soc_tomahawk3_get_set_slot_pipeline_latency( 44 int core_freq, 45 int dpp_freq, 46 int dppl, 47 int A_in, 48 int B_in, 49 int N_in, 50 int C_in, 51 int D_in, 52 int E_in, 53 int *slot_latency); 54 55 extern int soc_tomahawk3_ep_set_slot_pipeline_config( 56 int unit, 57 soc_port_schedule_state_t *port_schedule_state); 58 59 extern int soc_tomahawk3_ep_set_dev_to_phy( 60 int unit, 61 soc_port_schedule_state_t *port_schedule_state, 62 int pipe_num, 63 int phy_port, 64 int is_port_down); 65 66 extern int soc_tomahawk3_ep_set_mmu_cell_credit( 67 int unit, 68 soc_port_schedule_state_t *port_schedule_state, 69 int pipe_num, 70 int phy_port, 71 int is_port_down); 72 73 extern int soc_tomahawk3_get_speed_encoding( 74 int speed, 75 int *speed_encoding); 76 77 extern int soc_tomahawk3_get_ct_class(int speed); 78 79 extern int soc_tomahawk3_ep_get_ep2mmu_credit( 80 int unit, 81 soc_port_schedule_state_t *port_schedule_state, 82 int phy_port); 83 84 extern int soc_tomahawk3_ep_get_ep2mmu_credit_per_speed( 85 int unit, 86 soc_port_schedule_state_t *port_schedule_state, 87 int speed, 88 int *credit); 89 90 extern int soc_tomahawk3_ep_set_ct_class( 91 int unit, 92 soc_port_schedule_state_t *port_schedule_state, 93 int pipe_num, 94 int phy_port, 95 int is_port_down); 96 97 extern int soc_tomahawk3_ep_set_xmit_start_cnt( 98 int unit, 99 soc_port_schedule_state_t *port_schedule_state, 100 int pipe_num, 101 int phy_port, 102 int is_port_down); 103 104 extern int soc_tomahawk3_ep_get_xmit_start_count( 105 int unit, soc_port_schedule_state_t *port_schedule_state, 106 int logical_port, int *xmit_start_cnt); 107 108 extern int soc_tomahawk3_ep_set_egr_enable( 109 int unit, 110 soc_port_schedule_state_t *port_schedule_state, 111 int pipe_num, 112 int phy_port, 113 int is_port_down); 114 115 extern int soc_tomahawk3_ep_init_egr_enable( 116 int unit, 117 soc_port_schedule_state_t *port_schedule_state); 118 119 extern int soc_tomahawk3_ep_edb_init( 120 int unit, 121 soc_port_schedule_state_t *port_schedule_state); 122 123 extern int soc_tomahawk3_ep_init( 124 int unit, 125 soc_port_schedule_state_t *port_schedule_state); 126 127 extern int soc_tomahawk3_ep_drain_port( 128 int unit, 129 soc_port_schedule_state_t *port_schedule_state, 130 int pipe_num, 131 int phy_port); 132 133 extern int soc_tomahawk3_ep_sft_rst_port( 134 int unit, 135 soc_port_schedule_state_t *port_schedule_state, 136 int pipe_num, 137 int phy_port, 138 int rst_on); 139 140 extern int soc_tomahawk3_ep_port_down(int unit, 141 soc_port_schedule_state_t *port_schedule_state); 142 143 extern int soc_tomahawk3_ep_port_up(int unit, 144 soc_port_schedule_state_t *port_schedule_state); 145 146 extern int soc_tomahawk3_flex_ep_reconfigure_remove(int unit, 147 soc_port_schedule_state_t *port_schedule_state); 148 149 extern int soc_tomahawk3_flex_ep_reconfigure_add(int unit, 150 soc_port_schedule_state_t *port_schedule_state); 151 152 extern int soc_tomahawk3_ep_credit_rst_port( 153 int unit, 154 int phy_port); 155 156 /*** END SDK API COMMON CODE ***/ 157 158 #endif