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

tdm_hx5_methods.h (9431B)


      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  * All Rights Reserved.$
      7  *
      8  * TDM function prototypes for BCM56870
      9  */
     10 
     11 #ifndef TDM_HX5_PREPROCESSOR_PROTOTYPES_H
     12 #define TDM_HX5_PREPROCESSOR_PROTOTYPES_H
     13 
     14 #ifdef _TDM_STANDALONE
     15 	#include <tdm_hx5_soc.h>
     16 #else
     17 	#include <soc/tdm/helix5/tdm_hx5_soc.h>
     18 #endif
     19 
     20 
     21 /* Chip executive polymorphic functions 
     22         tdm_hx5_main_init
     23         tdm_hx5_main_transcription
     24         tdm_hx5_main_ingress
     25         tdm_hx5_filter
     26         tdm_hx5_parse_tdm_tbl
     27         tdm_hx5_chk
     28         tdm_hx5_main_free
     29         tdm_hx5_main_corereq
     30         tdm_hx5_main_post
     31 */
     32 
     33 /* Core executive polymorphic functions 
     34         tdm_hx5_proc_cal
     35         tdm_hx5_shim_get_port_pm
     36         tdm_hx5_scan_pipe_ethernet
     37 */
     38 
     39 /* main */
     40 LINKER_DECL int  tdm_hx5_main_corereq(tdm_mod_t *_tdm);
     41 LINKER_DECL int  tdm_hx5_main_ingress_pipe(tdm_mod_t *_tdm);
     42 LINKER_DECL int  tdm_hx5_main_ingress(tdm_mod_t *_tdm);
     43 LINKER_DECL int  tdm_hx5_main_transcription(tdm_mod_t *_tdm);
     44 LINKER_DECL int  tdm_hx5_main_init(tdm_mod_t *_tdm);
     45 LINKER_DECL int  tdm_hx5_main_chk(tdm_mod_t *_tdm);
     46 LINKER_DECL int  tdm_hx5_main_post(tdm_mod_t *_tdm);
     47 LINKER_DECL int  tdm_hx5_main_free(tdm_mod_t *_tdm);
     48 
     49 /* proc */
     50 LINKER_DECL int  tdm_hx5_proc_cal_ancl(tdm_mod_t *_tdm);
     51 LINKER_DECL int  tdm_hx5_proc_cal_idle(tdm_mod_t *_tdm);
     52 LINKER_DECL int  tdm_hx5_proc_cal_lr(tdm_mod_t *_tdm);
     53 LINKER_DECL int  tdm_hx5_proc_cal(tdm_mod_t *_tdm);
     54 
     55 /* filter */
     56 LINKER_DECL int tdm_hx5_same_port_1n6_filter( tdm_mod_t *_tdm );
     57 LINKER_DECL int  tdm_hx5_filter_chk_slot_shift_cond(int slot, int dir, int cal_len, int *cal_main, tdm_mod_t *_tdm);
     58 LINKER_DECL void tdm_hx5_filter_calc_jitter(int speed, int cal_len, int *space_min, int *space_max);
     59 LINKER_DECL int  tdm_hx5_filter_lr_jitter(tdm_mod_t *_tdm, int min_speed);
     60 LINKER_DECL int  tdm_hx5_filter_lr(tdm_mod_t *_tdm);
     61 LINKER_DECL int  tdm_hx5_filter(tdm_mod_t *_tdm);
     62 
     63 /* llist */
     64 LINKER_DECL void tdm_hx5_ll_print(struct hx5_ll_node *llist);
     65 LINKER_DECL int  tdm_hx5_ll_get_port_pm(int port, tdm_mod_t *_tdm);
     66 LINKER_DECL void tdm_hx5_ll_deref(struct hx5_ll_node *llist, int *tdm[HX5_LR_VBS_LEN], int lim);
     67 LINKER_DECL void tdm_hx5_ll_append(struct hx5_ll_node *llist, unsigned short port_append, int *pointer);
     68 LINKER_DECL void tdm_hx5_ll_insert(struct hx5_ll_node *llist, unsigned short port_insert, int idx);
     69 LINKER_DECL int  tdm_hx5_ll_delete(struct hx5_ll_node *llist, int idx);
     70 LINKER_DECL int  tdm_hx5_ll_get(struct hx5_ll_node *llist, int idx);
     71 LINKER_DECL int  tdm_hx5_ll_len(struct hx5_ll_node *llist);
     72 LINKER_DECL void tdm_hx5_ll_strip(struct hx5_ll_node *llist, int *pool, int token);
     73 LINKER_DECL int  tdm_hx5_ll_count(struct hx5_ll_node *llist, int token);
     74 LINKER_DECL void tdm_hx5_ll_weave(struct hx5_ll_node *llist, int token, tdm_mod_t *_tdm);
     75 LINKER_DECL void tdm_hx5_ll_retrace(struct hx5_ll_node *llist, tdm_mod_t *_tdm);
     76 LINKER_DECL int  tdm_hx5_ll_free(struct hx5_ll_node *llist);
     77 
     78 /* scan */
     79 LINKER_DECL int  tdm_hx5_scan_port_pm(tdm_mod_t *_tdm);
     80 LINKER_DECL int  tdm_hx5_scan_pipe_ethernet(tdm_mod_t *_tdm);
     81 
     82 /* hx5_vmap */
     83 LINKER_DECL int  tdm_hx5_core_vmap_alloc_mix(tdm_mod_t *_tdm);
     84 LINKER_DECL int  tdm_hx5_core_vmap_prealloc(tdm_mod_t *_tdm);
     85 
     86 /* ovsb */
     87 LINKER_DECL int  tdm_hx5_ovsb_apply_constraints(tdm_mod_t *_tdm);
     88 LINKER_DECL int  tdm_hx5_ovsb_part_halfpipe(tdm_mod_t *_tdm);
     89 LINKER_DECL int  tdm_hx5_ovsb_fill_group(tdm_mod_t *_tdm);
     90 LINKER_DECL int  tdm_hx5_ovsb_pkt_shaper(tdm_mod_t *_tdm);
     91 LINKER_DECL int  tdm_hx5_ovsb_pkt_shaper_per_port(tdm_mod_t *_tdm);
     92 LINKER_DECL int  tdm_hx5_ovsb_pkt_shaper_find_pm_indx(tdm_mod_t *_tdm);
     93 LINKER_DECL int  tdm_hx5_ovsb_map_pm_num_to_pblk(tdm_mod_t *_tdm);
     94 LINKER_DECL int  tdm_hx5_ovsb_flexmapping(tdm_mod_t *_tdm);
     95 LINKER_DECL int  tdm_hx5_ovsb_fixmapping(tdm_mod_t *_tdm);
     96 LINKER_DECL int  tdm_hx5_vbs_scheduler_ovs(tdm_mod_t *_tdm);
     97 
     98 /* parse */
     99 LINKER_DECL void tdm_hx5_print_pipe_config(tdm_mod_t *_tdm);
    100 LINKER_DECL void tdm_hx5_print_pipe_cal(tdm_mod_t *_tdm);
    101 LINKER_DECL int  tdm_hx5_print_lr_cal(tdm_mod_t *_tdm, int cal_id);
    102 LINKER_DECL int  tdm_hx5_parse_mgmt(tdm_mod_t *_tdm, int cal_id);
    103 LINKER_DECL int  tdm_hx5_parse_acc_idb(tdm_mod_t *_tdm, int cal_id);
    104 LINKER_DECL int  tdm_hx5_parse_acc_mmu(tdm_mod_t *_tdm, int cal_id);
    105 LINKER_DECL int  tdm_hx5_parse_ancl(tdm_mod_t *_tdm, int cal_id);
    106 LINKER_DECL int  tdm_hx5_parse_tdm_tbl(tdm_mod_t *_tdm);
    107 
    108 /* ovsb flexport */
    109 LINKER_DECL int  tdm_hx5_flex_get_pm_flexport_state( tdm_mod_t *_tdm, enum hx5_flex_pm_state_e *pm_flexport_state);
    110 LINKER_DECL int  tdm_hx5_flex_apply_constraints_flexport( tdm_mod_t *_tdm, enum hx5_flex_pm_state_e *pm_flexport_state);
    111 LINKER_DECL int  tdm_hx5_flex_pkt_shaper_flex_port( tdm_mod_t *_tdm );
    112 LINKER_DECL int  tdm_hx5_flex_pkt_shaper_flexport_remove_port( tdm_mod_t *_tdm );
    113 LINKER_DECL int  tdm_hx5_flex_map_pm_num_to_pblk_flex_port( tdm_mod_t *_tdm, enum hx5_flex_pm_state_e *pm_flexport_state );
    114 LINKER_DECL int  tdm_hx5_flex_get_pm_hpipe( tdm_mod_t *_tdm);
    115 LINKER_DECL int  tdm_hx5_flex_ovs_tables_update_grp_pms( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    116 LINKER_DECL int  tdm_hx5_flex_ovs_tables_init( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    117 LINKER_DECL int  tdm_hx5_flex_ovs_tables_evaluate( tdm_mod_t *_tdm, hx5_flxport_t *_flxport, int only_weight);
    118 LINKER_DECL int  tdm_hx5_flex_ovs_tables_remove( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    119 LINKER_DECL int  tdm_hx5_flex_ovs_tables_remove_port( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    120 LINKER_DECL int  tdm_hx5_flex_ovs_tables_consolidate( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    121 LINKER_DECL int  tdm_hx5_flex_ovs_tables_consolidate_speed( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    122 LINKER_DECL int  tdm_hx5_flex_ovs_tables_add_ports( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    123 LINKER_DECL int  tdm_hx5_flex_ovs_tables_add_ports_speed( tdm_mod_t *_tdm, hx5_flxport_t *_flxport );
    124 LINKER_DECL int  tdm_hx5_flex_ovs_tables_add_pm( tdm_mod_t *_tdm, hx5_flxport_t *_flxport, int pm_num, int hp_indx );
    125 LINKER_DECL int  tdm_hx5_sort_desc(int size, int *val_array, int *indx_array);
    126 LINKER_DECL int  tdm_hx5_flex_ovs_tables_rebalance( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    127 LINKER_DECL int  tdm_hx5_flex_ovs_tables_rebalance_speed( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    128 LINKER_DECL int  tdm_hx5_flex_ovs_tables_move_pm( tdm_mod_t *_tdm, hx5_flxport_t *_flxport, int src_grp, int dst_grp);
    129 LINKER_DECL int  tdm_hx5_flex_ovs_tables_post( tdm_mod_t *_tdm, hx5_flxport_t *_flxport);
    130 LINKER_DECL int  tdm_hx5_vbs_scheduler_ovs_flex_port_delta( tdm_mod_t *_tdm );
    131 LINKER_DECL enum port_speed_e tdm_hx5_vbs_scheduler_ovs_indx_to_speed(enum hx5_port_speed_indx_e _speed_indx);
    132 LINKER_DECL enum hx5_port_speed_indx_e tdm_hx5_vbs_scheduler_ovs_speed_to_indx(enum port_speed_e _speed);
    133 
    134 /* check */
    135 LINKER_DECL int  tdm_hx5_chk_get_speed_slots_5G(enum port_speed_e port_speed);
    136 LINKER_DECL int  tdm_hx5_chk_get_pipe_token_cnt(tdm_mod_t *_tdm, int cal_id, int port_token);
    137 LINKER_DECL int  tdm_hx5_chk_struct_os_ratio(tdm_mod_t *_tdm, int cal_id, int os_ratio_limit);
    138 LINKER_DECL int  tdm_hx5_chk_struct(tdm_mod_t *_tdm);
    139 LINKER_DECL int  tdm_hx5_chk_transcription(tdm_mod_t *_tdm);
    140 LINKER_DECL int  tdm_hx5_chk_sister(tdm_mod_t *_tdm);
    141 LINKER_DECL int  tdm_hx5_chk_same(tdm_mod_t *_tdm);
    142 LINKER_DECL int  tdm_hx5_chk_bandwidth_ancl(tdm_mod_t *_tdm);
    143 LINKER_DECL int  tdm_hx5_chk_bandwidth_lr_pipe(tdm_mod_t *_tdm, int cal_id);
    144 LINKER_DECL int  tdm_hx5_chk_bandwidth_os_pipe(tdm_mod_t *_tdm, int cal_id);
    145 LINKER_DECL int  tdm_hx5_chk_bandwidth_lr(tdm_mod_t *_tdm);
    146 LINKER_DECL int  tdm_hx5_chk_bandwidth_os(tdm_mod_t *_tdm);
    147 LINKER_DECL int  tdm_hx5_chk_bandwidth(tdm_mod_t *_tdm);
    148 LINKER_DECL int  tdm_hx5_chk_jitter_cmic(tdm_mod_t *_tdm, int cal_id);
    149 LINKER_DECL int  tdm_hx5_chk_jitter_lr_pipe(tdm_mod_t *_tdm, int cal_id);
    150 LINKER_DECL int  tdm_hx5_chk_jitter_lr(tdm_mod_t *_tdm);
    151 LINKER_DECL int  tdm_hx5_chk_os_halfpipe(tdm_mod_t *_tdm, int cal_id);
    152 LINKER_DECL int  tdm_hx5_chk_os_pkt_sched(tdm_mod_t *_tdm, int cal_id);
    153 LINKER_DECL int  tdm_hx5_chk(tdm_mod_t *_tdm);
    154 
    155 /* shim */
    156 LINKER_DECL int  tdm_hx5_shim_get_port_pm(tdm_mod_t *_tdm);
    157 LINKER_DECL int  tdm_hx5_shim_get_pipe_ethernet(tdm_mod_t *_tdm);
    158 LINKER_DECL int  tdm_hx5_shim_core_vbs_scheduler_ovs(tdm_mod_t *_tdm);
    159 
    160 /* common */
    161 LINKER_DECL int  tdm_hx5_cmn_get_port_pm(int port_token, tdm_mod_t *_tdm);
    162 LINKER_DECL int  tdm_hx5_cmn_get_port_speed(int port_token, tdm_mod_t *_tdm);
    163 LINKER_DECL int  tdm_hx5_cmn_get_port_state(int port_token, tdm_mod_t *_tdm);
    164 LINKER_DECL int  tdm_hx5_cmn_get_speed_lanes(int port_speed);
    165 LINKER_DECL int  tdm_hx5_cmn_get_speed_slots(int port_speed);
    166 LINKER_DECL void tdm_hx5_cmn_get_speed_jitter(int port_speed, int cal_len, int *space_min, int *space_max);
    167 LINKER_DECL void tdm_hx5_cmn_get_pipe_port_range(int cal_id, int *phy_lo, int *phy_hi);
    168 LINKER_DECL int  tdm_hx5_cmn_get_pipe_ethernet(int cal_id, tdm_mod_t *_tdm);
    169 LINKER_DECL int  tdm_hx5_cmn_get_pipe_higig(int cal_id, tdm_mod_t *_tdm);
    170 LINKER_DECL int  tdm_hx5_cmn_get_pipe_cal_len_max(int cal_id, tdm_mod_t *_tdm);
    171 LINKER_DECL int  tdm_hx5_cmn_get_pipe_cal_len(int cal_id, tdm_mod_t *_tdm);
    172 LINKER_DECL int  tdm_hx5_cmn_get_same_port_dist(int slot, int dir, int *cal_main, int cal_len);
    173 
    174 #endif /* TDM_HX5_PREPROCESSOR_PROTOTYPES_H */