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_ap_methods.h (10524B)


      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 BCM56860
      9  */
     10 
     11 #ifndef TDM_AP_PREPROCESSOR_PROTOTYPES_H
     12 #define TDM_AP_PREPROCESSOR_PROTOTYPES_H
     13 
     14 #ifdef _TDM_STANDALONE
     15 	#include <tdm_ap_soc.h>
     16 #else
     17 	#include <soc/tdm/apache/tdm_ap_soc.h>
     18 #endif
     19 
     20 /*
     21  * CHIP function prototypes 
     22  */
     23 
     24 /* Functions managed by TDM chip executive */
     25 LINKER_DECL int tdm_ap_init( tdm_mod_t *_tdm );
     26 LINKER_DECL int tdm_ap_pmap_transcription( tdm_mod_t *_tdm );
     27 LINKER_DECL int tdm_ap_lls_wrapper( tdm_mod_t *_tdm );
     28 LINKER_DECL void tdm_ap_mv_fb_ovs_gen(tdm_ap_chip_legacy_t *_ap_chip,int *ovs_tdm_tbl, int *ovs_spacing, int pgw_num);
     29 LINKER_DECL void tdm_ap_mv_fb_ovs_tbl_spacing(int *ovs_tdm_tbl, int *ovs_spacing);
     30 LINKER_DECL void tdm_ap_tdm_print(int *tdm_tbl, int length);
     31 LINKER_DECL void tdm_ap_check_mv_fb_config(ap_pgw_os_tdm_sel_e *ap_os_tdm_sel, tdm_ap_chip_legacy_t *ap_chip);
     32 LINKER_DECL void tdm_ap_mv_fb_ovs_tbl(tdm_ap_chip_legacy_t *ap_chip,int *ovs_tdm_tbl, unsigned int *pgw0_ovs_tbl_template,ap_pgw_os_tdm_sel_e *ap_pgw_os_tdm_sel, int pgw_num);
     33 LINKER_DECL int tdm_ap_vbs_wrapper( tdm_mod_t *_tdm );
     34 LINKER_DECL int tdm_ap_extract_cal( tdm_mod_t *_tdm );
     35 LINKER_DECL int tdm_ap_free( tdm_mod_t *_tdm );
     36 LINKER_DECL int tdm_ap_chk( tdm_mod_t *_tdm );
     37 LINKER_DECL int tdm_ap_corereq( tdm_mod_t *_tdm );
     38 LINKER_DECL int tdm_ap_filter_chain( tdm_mod_t *_tdm );
     39 LINKER_DECL int tdm_ap_post( tdm_mod_t *_tdm );
     40 /* Core executive polymorphic functions */
     41 LINKER_DECL int tdm_ap_which_tsc( tdm_mod_t *_tdm_s );
     42 LINKER_DECL int tdm_ap_vmap_alloc( tdm_mod_t *_tdm );
     43 LINKER_DECL int tdm_ap_vmap_alloc_old( tdm_mod_t *_tdm );
     44 LINKER_DECL int tdm_ap_parse_mmu_tdm_tbl( tdm_mod_t *_tdm );
     45 
     46 /* Internalized functions */
     47 LINKER_DECL int tdm_ap_check_ethernet( tdm_mod_t *_tdm_s );
     48 
     49 /* TDM.4 - APACHE linked list API */
     50 LINKER_DECL void tdm_ap_ll_print(struct ap_ll_node *llist);
     51 LINKER_DECL void tdm_ap_ll_deref(struct ap_ll_node *llist, int *tdm[AP_LR_LLS_LEN], int lim);
     52 LINKER_DECL void tdm_ap_ll_append(struct ap_ll_node *llist, unsigned short port_append, int *pointer);
     53 LINKER_DECL void tdm_ap_ll_insert(struct ap_ll_node *llist, unsigned short port_insert, int idx);
     54 LINKER_DECL int tdm_ap_ll_delete(struct ap_ll_node *llist, int idx);
     55 LINKER_DECL int tdm_ap_ll_get(struct ap_ll_node *llist, int idx);
     56 LINKER_DECL int tdm_ap_ll_len(struct ap_ll_node *llist);
     57 LINKER_DECL void tdm_ap_ll_strip(struct ap_ll_node *llist, int *pool, int token);
     58 LINKER_DECL int tdm_ap_ll_count(struct ap_ll_node *llist, int token);
     59 LINKER_DECL void tdm_ap_ll_weave(struct ap_ll_node *llist, int wc_array[AP_NUM_PHY_PM][AP_NUM_PM_LNS], int token);
     60 LINKER_DECL void tdm_ap_ll_retrace(struct ap_ll_node *llist, int wc_array[AP_NUM_PHY_PM][AP_NUM_PM_LNS]);
     61 LINKER_DECL int tdm_ap_ll_single_100(struct ap_ll_node *llist);
     62 LINKER_DECL void tdm_ap_ll_retrace_25(struct ap_ll_node *llist, int wc_array[AP_NUM_PHY_PM][AP_NUM_PM_LNS], int port[2], enum port_speed_e speed[2]);
     63 LINKER_DECL void tdm_ap_ll_retrace_cl(struct ap_ll_node *llist, tdm_ap_chip_legacy_t *ap_chip, int port[2], enum port_speed_e speed[2]);
     64 LINKER_DECL void tdm_ap_ll_weave_100(struct ap_ll_node *llist, int wc_array[AP_NUM_PHY_PM][AP_NUM_PM_LNS], int token);
     65 LINKER_DECL void tdm_ap_ll_remove_25(struct ap_ll_node *llist, int port);
     66 LINKER_DECL void tdm_ap_ll_append_25(struct ap_ll_node *llist, int token, int wc_array[AP_NUM_PM_LNS]);
     67 LINKER_DECL void tdm_ap_ll_reconfig_8x25(struct ap_ll_node *llist, int token);
     68 LINKER_DECL int tdm_ap_ll_free(struct ap_ll_node *llist);
     69 
     70 /* TDM.4 - APACHE chip API */
     71 LINKER_DECL int tdm_ap_lls_scheduler(struct ap_ll_node *pgw_tdm, tdm_ap_chip_legacy_t *ap_chip, ap_pgw_pntrs_t *pntrs_pkg, ap_pgw_scheduler_vars_t *vars_pkg, int *pgw_tdm_tbl[AP_LR_LLS_LEN], int *ovs_tdm_tbl[AP_OS_LLS_GRP_LEN], int op_flags[2], int *ap_fb_num_ovs, int *ap_fb_num_lr);
     72 LINKER_DECL int tdm_ap_vbs_scheduler( tdm_mod_t *_tdm );
     73 LINKER_DECL void tdm_ap_ovs_spacer(int *ovs_tdm_tbl, int *ovs_spacing);
     74 LINKER_DECL int tdm_ap_legacy_which_tsc(unsigned short port, int **tsc);
     75 LINKER_DECL int tdm_ap_actual_pmap( tdm_mod_t *_tdm );
     76 LINKER_DECL void tdm_ap_reconfig_ovs_tbl(int *ovs_tdm_tbl);
     77 LINKER_DECL void tdm_ap_reconfig_ovs_8x25(int *ovs_tdm_tbl, int port1, int port2);
     78 LINKER_DECL void tdm_ap_append_ovs_8x25(int *ovs_tdm_tbl, int port1, int port2, int cxx_port, enum port_speed_e cxx_speed);
     79 LINKER_DECL void tdm_ap_reconfig_ovs_4x25(int *ovs_tdm_tbl, int port);
     80 LINKER_DECL void tdm_ap_scheduler_ovs_4x25(int *ovs_tdm_tbl, int port);
     81 LINKER_DECL void tdm_ap_ovs_20_40_clport(int *ovs_tdm_tbl, tdm_ap_chip_legacy_t *ap_chip);
     82 LINKER_DECL void tdm_ap_clport_ovs_scheduler(int *ovs_tdm_tbl, int port[2], enum port_speed_e speed[2],int cxx_port, enum port_speed_e cxx_speed, int clk);
     83 LINKER_DECL int tdm_postalloc(unsigned short **vector_map, int freq, unsigned short spd, short *yy, short *y, int lr_idx_limit, unsigned short lr_stack[TDM_AUX_SIZE], int token, const char* speed, int num_ext_ports);
     84 LINKER_DECL int tdm_acc_alloc(unsigned short **vector_map, int freq, unsigned short spd, short *yy, int lr_idx_limit, int num_ext_ports);
     85 LINKER_DECL void tdm_ap_reconfig_pgw_tbl(int *cal, int port[2], enum port_speed_e speed[2]);
     86 
     87 /* TDM.4 - APACHE chip based prints and parses */
     88 LINKER_DECL void tdm_ap_print_tbl(int *cal, int len, const char* name, int id);
     89 LINKER_DECL void tdm_ap_print_tbl_ovs(int *cal, int *spc, int len, const char* name, int id);
     90 LINKER_DECL void tdm_ap_print_quad(enum port_speed_e *speed, enum port_state_e *state, int len, int idx_start, int idx_end);
     91 
     92 /* TDM.4 - APACHE chip based checks and scans */
     93 LINKER_DECL int tdm_ap_check_same_port_dist_dn(int idx, int *tdm_tbl, int lim);
     94 LINKER_DECL int tdm_ap_check_same_port_dist_up(int idx, int *tdm_tbl, int lim);
     95 LINKER_DECL int tdm_ap_check_same_port_dist_dn_port(int port, int idx, int *tdm_tbl, int lim);
     96 LINKER_DECL int tdm_ap_check_same_port_dist_up_port(int port, int idx, int *tdm_tbl, int lim);
     97 LINKER_DECL int tdm_ap_check_fit_smooth(int *tdm_tbl, int port, int lr_idx_limit, int clump_thresh);
     98 LINKER_DECL int tdm_ap_slice_size_local(unsigned short idx, int *tdm, int lim);
     99 LINKER_DECL int tdm_ap_slice_prox_dn(int slot, int *tdm, int lim, int **tsc, enum port_speed_e *speed);
    100 LINKER_DECL int tdm_ap_slice_prox_up(int slot, int *tdm, int **tsc, enum port_speed_e *speed);
    101 LINKER_DECL int tdm_ap_slice_size(unsigned short port, int *tdm, int lim);
    102 LINKER_DECL int tdm_ap_slice_idx(unsigned short port, int *tdm, int lim);
    103 LINKER_DECL int tdm_ap_slice_prox_local(unsigned short idx, int *tdm, int lim, int **tsc);
    104 LINKER_DECL int tdm_ap_check_lls_flat_up(int idx, int *tdm_tbl, enum port_speed_e *speed);
    105 LINKER_DECL int tdm_ap_num_lr_slots(int *tdm_tbl);
    106 LINKER_DECL int tdm_ap_scan_slice_min(unsigned short port, int *tdm, int lim, int *slice_start_idx, int pos);
    107 LINKER_DECL int tdm_ap_scan_slice_max(unsigned short port, int *tdm, int lim, int *slice_start_idx, int pos);
    108 LINKER_DECL int tdm_ap_scan_slice_size_local(unsigned short idx, int *tdm, int lim, int *slice_start_idx);
    109 LINKER_DECL int tdm_ap_scan_mix_slice_min(unsigned short port, int *tdm, int lim, int *slice_idx, int pos);
    110 LINKER_DECL int tdm_ap_scan_mix_slice_max(unsigned short port, int *tdm, int lim, int *slice_idx, int pos);
    111 LINKER_DECL int tdm_ap_scan_mix_slice_size_local(unsigned short idx, int *tdm, int lim, int *slice_start_idx);
    112 LINKER_DECL int tdm_ap_check_shift_cond_pattern(unsigned short port, int *tdm_tbl, int tdm_tbl_len, int **tsc, int dir);
    113 LINKER_DECL int tdm_ap_check_shift_cond_local_slice(unsigned short port, int *tdm_tbl, int tdm_tbl_len, int **tsc, int dir);
    114 LINKER_DECL int tdm_ap_check_slot_swap_cond(int idx, int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    115 LINKER_DECL int tdm_ap_scan_which_tsc(int port, int tsc[AP_NUM_PHY_PM][AP_NUM_PM_LNS]);
    116 
    117 /* TDM.4 - APACHE chip based filter methods */
    118 LINKER_DECL int tdm_ap_filter_dither(int *tdm_tbl, int lr_idx_limit, int accessories, int **tsc, int threshold, enum port_speed_e *speed);
    119 LINKER_DECL int tdm_ap_filter_fine_dither(int port, int *tdm_tbl, int lr_idx_limit, int accessories, int **tsc);
    120 LINKER_DECL int tdm_ap_filter_shift_lr_port(unsigned short port, int *tdm_tbl, int tdm_tbl_len, int dir);
    121 LINKER_DECL int tdm_ap_filter_migrate_os_slot(int idx_src, int idx_dst, int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    122 LINKER_DECL int tdm_ap_filter_smooth_idle_slice(int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    123 LINKER_DECL int tdm_ap_filter_smooth_os_slice(int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed, int dir);
    124 LINKER_DECL int tdm_ap_filter_smooth_os_slice_fine(int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    125 LINKER_DECL int tdm_ap_filter_smooth_os_os_up(int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    126 LINKER_DECL int tdm_ap_filter_smooth_os_os_dn(int *tdm_tbl, int tdm_tbl_len, int **tsc, enum port_speed_e *speed);
    127 LINKER_DECL int tdm_ap_filter_smooth_ancl(int ancl_token, int *tdm_tbl, int tdm_tbl_len, int ancl_space_min);
    128 
    129 /* TDM.4 - APACHE chip specific IARB calendars */
    130 LINKER_DECL void tdm_ap_init_iarb_tdm_table (int core_bw, int *iarb_tdm_wrap_ptr_lr_x, int *iarb_tdm_tbl_lr_x); 
    131 LINKER_DECL int tdm_ap_set_iarb_tdm(int core_bw, int is_x_ovs, int *iarb_tdm_wrap_ptr_x, int *iarb_tdm_tbl_x);
    132 
    133 /* TDM.4 - APACHE self-check operations */
    134 LINKER_DECL int tdm_ap_chk_ethernet(tdm_mod_t *_tdm);
    135 LINKER_DECL int tdm_ap_chk_struc(tdm_mod_t *_tdm);
    136 LINKER_DECL int tdm_ap_chk_tsc(tdm_mod_t *_tdm);
    137 LINKER_DECL int tdm_ap_chk_min(tdm_mod_t *_tdm);
    138 LINKER_DECL int tdm_ap_chk_sub_lr( tdm_mod_t *_tdm);
    139 LINKER_DECL int tdm_ap_chk_sub_os(tdm_mod_t *_tdm);
    140 LINKER_DECL int tdm_ap_chk_sub_cpu( tdm_mod_t *_tdm);
    141 LINKER_DECL int tdm_ap_chk_sub_lpbk( tdm_mod_t *_tdm);
    142 LINKER_DECL int tdm_ap_chk_sub_acc( tdm_mod_t *_tdm);
    143 LINKER_DECL int tdm_ap_chk_subscription(tdm_mod_t *_tdm);
    144 LINKER_DECL int tdm_ap_chk_os_jitter(tdm_mod_t *_tdm);
    145 LINKER_DECL int tdm_ap_chk_lr_jitter(tdm_mod_t *_tdm, int fail[16]);
    146 LINKER_DECL int tdm_ap_chk_lls(tdm_mod_t *_tdm);
    147 LINKER_DECL int tdm_ap_chk_ovs_space( tdm_mod_t *_tdm);
    148 LINKER_DECL int tdm_ap_chk_pgw_min( tdm_mod_t *_tdm);
    149 LINKER_DECL void tdm_ap_chk_chip_specific(tdm_mod_t *_tdm, int fail[16]);
    150 
    151 #endif /* TDM_AP_PREPROCESSOR_PROTOTYPES_H */