openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

trident3_tdm.h (6326B)


      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:        trident3_tdm.h
      8  */
      9 
     10 #ifndef _SOC_TRIDENT3_TDM_H_
     11 #define _SOC_TRIDENT3_TDM_H_
     12 
     13 #include <soc/esw/port.h>
     14 
     15 /*** START SDK API COMMON CODE ***/
     16 
     17 /* TD3 specific defines */
     18 #define TRIDENT3_TDM_PORTS_PER_PBLK         4
     19 #define TRIDENT3_TDM_PBLKS_PER_PIPE         16
     20 #define TRIDENT3_TDM_PBLKS_PER_HPIPE        8
     21 #define TRIDENT3_TDM_PIPES_PER_DEV          2
     22 #define TRIDENT3_TDM_HPIPES_PER_PIPE        2
     23 
     24 #define TRIDENT3_TDM_PBLKS_PER_DEV          \
     25                  (TRIDENT3_TDM_PBLKS_PER_PIPE * TRIDENT3_TDM_PIPES_PER_DEV)
     26 #define TRIDENT3_TDM_GPORTS_PER_HPIPE       \
     27                  (TRIDENT3_TDM_PORTS_PER_PBLK * TRIDENT3_TDM_PBLKS_PER_HPIPE)
     28 #define TRIDENT3_TDM_GPORTS_PER_PIPE        \
     29                  (TRIDENT3_TDM_PORTS_PER_PBLK * TRIDENT3_TDM_PBLKS_PER_PIPE)
     30 #define TRIDENT3_TDM_GPORTS_PER_DEV         \
     31                  (TRIDENT3_TDM_GPORTS_PER_PIPE * TRIDENT3_TDM_PIPES_PER_DEV)
     32 
     33 /* Physical port */
     34 /* 64 General device port + 1 CPU/Management + 1 Loopback */
     35 #define TRIDENT3_TDM_PHY_PORTS_PER_PIPE     \
     36                  (TRIDENT3_TDM_GPORTS_PER_PIPE + 2)
     37 #define TRIDENT3_TDM_PHY_PORTS_PER_DEV      \
     38                  (TRIDENT3_TDM_PHY_PORTS_PER_PIPE * TRIDENT3_TDM_PIPES_PER_DEV)
     39 #define TRIDENT3_TDM_PHY_MGMT0              129
     40 #define TRIDENT3_TDM_PHY_MGMT1              128 /* Shared with physical port 128 */
     41 #define TRIDENT3_TDM_DEV_MGMT0              66
     42 #define TRIDENT3_TDM_DEV_MGMT1              130 /* Shared with device port 130 */
     43 
     44 /* MMU ancillary port number */
     45 #define TRIDENT3_TDM_MMU_OVSB_TOKEN         0x42
     46 #define TRIDENT3_TDM_MMU_NULL_TOKEN         0x43
     47 #define TRIDENT3_TDM_MMU_PURG_TOKEN         0x44
     48 #define TRIDENT3_TDM_MMU_UNUSED_TOKEN       0x7f
     49 #define TRIDENT3_TDM_MMU_MGMT1_TOKEN        0xc0
     50 
     51 /* IDB ancillary port number */
     52 #define TRIDENT3_TDM_IDB_OVSB_TOKEN         0x42
     53 #define TRIDENT3_TDM_IDB_NULL_TOKEN         0x43
     54 #define TRIDENT3_TDM_IDB_SBUS_TOKEN         0x44
     55 #define TRIDENT3_TDM_IDB_OPT1_TOKEN         0x45
     56 #define TRIDENT3_TDM_IDB_UNUSED_TOKEN       0x7f
     57 #define TRIDENT3_TDM_IDB_MGMT1_TOKEN        0x40
     58 
     59 /* Oversub groups */
     60 #define TRIDENT3_TDM_OVS_GROUPS_PER_PIPE    12
     61 #define TRIDENT3_TDM_OVS_GROUPS_PER_HPIPE   6
     62 #define TRIDENT3_TDM_OVS_GROUP_LENGTH       12
     63 #define TRIDENT3_OVS_HPIPE_COUNT_PER_PIPE   2
     64 
     65 /*** START SDK API COMMON CODE ***/
     66 extern void _soc_td3_tdm_print_port_map(int unit, soc_port_map_type_t *port_map);
     67 extern void _soc_td3_tdm_print_tdm_info(int unit, soc_tdm_schedule_t *tdm_info,
     68                                         int hpipe, int is_ing);
     69 extern void _soc_td3_tdm_print_port_resource(int unit,
     70                                  soc_port_resource_t *port_info, int entry_num);
     71 extern void _soc_td3_tdm_print_schedule_state(int unit,
     72                                  soc_port_schedule_state_t *sch_info);
     73 extern int _soc_td3_tdm_calculation(int unit,
     74                                  soc_port_schedule_state_t *sch_info);
     75 extern int _soc_td3_tdm_set_idb_calendar(int unit,
     76                                  soc_port_schedule_state_t *sch_info);
     77 extern int _soc_td3_tdm_set_idb_hsp(int unit,
     78                                  soc_port_schedule_state_t *sch_info);
     79 extern int _soc_td3_tdm_set_idb_pkt_calendar(int unit,
     80                                  soc_port_schedule_state_t *sch_info);
     81 extern int _soc_td3_tdm_set_idb_ppe_credit(int unit,
     82                                  soc_port_schedule_state_t *sch_info,
     83                                  int full_credit_threshold_0,
     84                                  int opp_credit_threshold_0,
     85                                  int full_credit_threshold_1,
     86                                  int opp_credit_threshold_1 );
     87 extern int _soc_td3_tdm_set_idb_opportunistic(int unit,
     88                                  soc_port_schedule_state_t *sch_info,
     89                                  int cpu_op_en, int lb_opp_en, int opp1_port_en,
     90                                  int opp2_port_en, int opp_ovr_sub_en);
     91 extern int _soc_td3_tdm_set_ovs_group_sel(int unit,
     92                                  soc_port_schedule_state_t *sch_info,
     93                                  int set_idb, int set_mmu);
     94 extern int _soc_td3_tdm_set_ovs_group(int unit,
     95                                  soc_port_schedule_state_t *sch_info);
     96 extern int _soc_td3_tdm_set_mmu_calendar(int unit,
     97                                  soc_port_schedule_state_t *sch_info);
     98 extern int _soc_td3_tdm_set_mmu_hsp(int unit,
     99                                  soc_port_schedule_state_t *sch_info);
    100 extern int _soc_td3_tdm_set_mmu_opportunistic(int unit,
    101                                  soc_port_schedule_state_t *sch_info,
    102                                  int cpu_op_en, int lb_opp_en, int opp1_port_en,
    103                                  int opp2_port_en, int opp_ovr_sub_en);
    104 
    105 extern int soc_td3_tdm_set_idb_dpp_ctrl(int unit,
    106                                  soc_port_schedule_state_t *schedule_state,
    107                                  int credits);
    108 extern int soc_td3_tdm_init(int unit, soc_port_schedule_state_t *schedule_state);
    109 extern void soc_td3_tdm_get_port_ratio(int unit,
    110                                  soc_port_schedule_state_t *sch_info,
    111                                  int pm_num, int *pm_mode, int prev_or_new);
    112 extern void _soc_td3_tdm_get_pipe_map(int unit,
    113                                  soc_port_schedule_state_t *sch_info,
    114                                  uint32 *pipe_map);
    115 extern void _soc_td3_tdm_get_ovs_pipe_map(int unit,
    116                                  soc_port_schedule_state_t *sch_info,
    117                                  uint32 *ovs_pipe_map);
    118 extern int _soc_td3_tdm_get_speed_ovs_class(int unit, int speed);
    119 extern int _soc_td3_tdm_get_same_port_spacing_e(int unit, int speed);
    120 
    121 extern void soc_trident3_port_schedule_speed_remap(int unit,
    122                                  soc_port_schedule_state_t *port_schedule_state);
    123 
    124 extern int soc_td3_tdm_get_log_port_speed(int unit,
    125                     soc_port_schedule_state_t *port_schedule_state,
    126                     int log_port, int prev_or_new, int *speed, int *num_lanes);
    127 
    128 /*** END SDK API COMMON CODE ***/
    129 
    130 #endif	/* !_SOC_TRIDENT3_TDM_H_ */