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

blackhawk_cfg_seq.h (9817B)


      1 /*----------------------------------------------------------------------
      2  * 
      3  *
      4  * Broadcom Corporation
      5  * Proprietary and Confidential information
      6  * All rights reserved
      7  * This source file is the property of Broadcom Corporation, and
      8  * may not be copied or distributed in any isomorphic form without the
      9  * prior written consent of Broadcom Corporation.
     10  *---------------------------------------------------------------------
     11  * File       : blackhawk_cfg_seq.h
     12  * Description: c functions implementing Tier1s for TEMod Serdes Driver
     13  *---------------------------------------------------------------------*/
     14 /*
     15  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
     16  * 
     17  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
     18  * 
     19 */
     20 
     21 
     22 #ifndef BLACKHAWK_CFG_SEQ_H
     23 #define BLACKHAWK_CFG_SEQ_H
     24 
     25 #include "common/srds_api_err_code.h"
     26 #include <phymod/phymod_diagnostics.h>
     27 
     28 typedef struct {
     29   int8_t pll_pwrdn;
     30   int8_t tx_s_pwrdn;
     31   int8_t rx_s_pwrdn;
     32 } power_status_t;
     33 
     34 typedef struct {
     35   int8_t revid_model;
     36   int8_t revid_process;
     37   int8_t revid_bonding;
     38   int8_t revid_rev_number;
     39   int8_t revid_rev_letter;
     40 } blackhawk_rev_id0_t;
     41 
     42 typedef struct {
     43   int8_t revid_eee;
     44   int8_t revid_llp;
     45   int8_t revid_pir;
     46   int8_t revid_cl72;
     47   int8_t revid_micro;
     48   int8_t revid_mdio;
     49   int8_t revid_multiplicity;
     50 } blackhawk_rev_id1_t;
     51 
     52 typedef enum {
     53   TX = 0,
     54   Rx
     55 } tx_rx_t;
     56 
     57 typedef enum {
     58     BLACKHAWK_PRBS_POLYNOMIAL_7 = 0,
     59     BLACKHAWK_PRBS_POLYNOMIAL_9,
     60     BLACKHAWK_PRBS_POLYNOMIAL_11,
     61     BLACKHAWK_PRBS_POLYNOMIAL_15,
     62     BLACKHAWK_PRBS_POLYNOMIAL_23,
     63     BLACKHAWK_PRBS_POLYNOMIAL_31,
     64     BLACKHAWK_PRBS_POLYNOMIAL_58,
     65     BLACKHAWK_PRBS_POLYNOMIAL_TYPE_COUNT
     66 }blackhawk_prbs_polynomial_type_t;
     67 
     68 #define PATTERN_MAX_SIZE 8
     69 
     70 extern err_code_t _blackhawk_pmd_mwr_reg_byte(  phymod_access_t *pa, uint16_t addr, uint16_t mask, uint8_t lsb, uint8_t val);
     71 extern uint8_t _blackhawk_pmd_rde_field_byte(  phymod_access_t *pa, uint16_t addr, uint8_t shift_left, uint8_t shift_right, err_code_t *err_code_p);
     72 extern uint16_t _blackhawk_pmd_rde_field(  phymod_access_t *pa, uint16_t addr, uint8_t shift_left, uint8_t shift_right, err_code_t *err_code_p);
     73 err_code_t blackhawk_tx_pi_control_get( phymod_access_t *pa,  int16_t *value);
     74 err_code_t blackhawk_tx_rx_polarity_set( phymod_access_t *pa, uint32_t tx_pol, uint32_t rx_pol);
     75 err_code_t blackhawk_tx_rx_polarity_get( phymod_access_t *pa, uint32_t *tx_pol, uint32_t *rx_pol);
     76 err_code_t blackhawk_lane_pll_selection_set( phymod_access_t *pa, uint32_t pll_index);
     77 err_code_t blackhawk_lane_pll_selection_get( phymod_access_t *sa__, uint32_t *pll_index);
     78 err_code_t blackhawk_uc_active_set( phymod_access_t *pa, uint32_t enable);
     79 err_code_t blackhawk_uc_active_get( phymod_access_t *pa, uint32_t *enable);
     80 /* int blackhawk_uc_reset( phymod_access_t *pa, uint32_t enable); */
     81 err_code_t blackhawk_prbs_tx_inv_data_get( phymod_access_t *pa, uint32_t *inv_data);
     82 err_code_t blackhawk_prbs_rx_inv_data_get( phymod_access_t *pa, uint32_t *inv_data);
     83 err_code_t blackhawk_prbs_tx_poly_get( phymod_access_t *pa, blackhawk_prbs_polynomial_type_t *prbs_poly);
     84 err_code_t blackhawk_prbs_rx_poly_get( phymod_access_t *pa, blackhawk_prbs_polynomial_type_t *prbs_poly);
     85 err_code_t blackhawk_prbs_tx_enable_get( phymod_access_t *pa, uint32_t *enable);
     86 err_code_t blackhawk_prbs_rx_enable_get( phymod_access_t *pa, uint32_t *enable);
     87 err_code_t blackhawk_pmd_force_signal_detect( phymod_access_t *pa, uint8_t force_en, uint8_t force_val);
     88 err_code_t blackhawk_pll_mode_set( phymod_access_t *pa, int pll_mode);
     89 err_code_t blackhawk_pll_mode_get( phymod_access_t *pa, uint32_t *pll_mode);
     90 err_code_t blackhawk_afe_pll_reg_set( phymod_access_t *pa,  const phymod_afe_pll_t *afe_pll);
     91 err_code_t blackhawk_afe_pll_reg_get( phymod_access_t *pa, phymod_afe_pll_t *afe_pll);
     92 err_code_t blackhawk_osr_mode_set( phymod_access_t *pa, int osr_mode);
     93 err_code_t blackhawk_osr_mode_get( phymod_access_t *pa, int *osr_mode);
     94 err_code_t blackhawk_tsc_dig_lpbk_get( phymod_access_t *pa, uint32_t *lpbk);
     95 err_code_t blackhawk_tsc_rmt_lpbk_get( phymod_access_t *pa, uint32_t *lpbk);
     96 err_code_t blackhawk_core_soft_reset( phymod_access_t *pa);
     97 err_code_t blackhawk_core_soft_reset_release( phymod_access_t *pa, uint32_t enable);
     98 err_code_t blackhawk_core_soft_reset_read( phymod_access_t *pa, uint32_t *enable);
     99 err_code_t blackhawk_lane_soft_reset_read( phymod_access_t *pa, uint32_t *enable);
    100 err_code_t blackhawk_pmd_tx_disable_pin_dis_set( phymod_access_t *pa, uint32_t enable);
    101 err_code_t blackhawk_pmd_tx_disable_pin_dis_get( phymod_access_t *pa, uint32_t *enable);
    102 err_code_t blackhawk_tsc_pwrdn_set( phymod_access_t *pa, int tx_rx, int pwrdn);
    103 err_code_t blackhawk_tsc_pwrdn_get( phymod_access_t *pa, power_status_t *pwrdn);
    104 err_code_t blackhawk_pcs_lane_swap_tx( phymod_access_t *pa, uint32_t tx_lane_map);
    105 err_code_t blackhawk_pmd_lane_swap ( phymod_access_t *pa, uint32_t lane_map);
    106 err_code_t blackhawk_pmd_lane_map_get( phymod_access_t *pa, uint32_t *tx_lane_map, uint32_t *rx_lane_map);
    107 err_code_t blackhawk_pmd_loopback_get( phymod_access_t *pa, uint32_t *enable);
    108 err_code_t blackhawk_tsc_identify( phymod_access_t *pa, blackhawk_rev_id0_t *rev_id0, blackhawk_rev_id1_t *rev_id1);
    109 err_code_t blackhawk_pmd_ln_h_rstb_pkill_override(  phymod_access_t *pa, uint16_t val);
    110 err_code_t blackhawk_lane_soft_reset( phymod_access_t *pa, uint32_t enable);   /* pmd core soft reset */
    111 err_code_t blackhawk_lane_soft_reset_get( phymod_access_t *pa, uint32_t *enable);
    112 err_code_t blackhawk_lane_hard_soft_reset_release( phymod_access_t *pa, uint32_t enable);
    113 err_code_t blackhawk_clause72_control( phymod_access_t *pc, uint32_t cl_72_en);        /* CLAUSE_72_CONTROL */
    114 err_code_t blackhawk_clause72_control_get( phymod_access_t *pc, uint32_t *cl_72_en);   /* CLAUSE_72_CONTROL */
    115 err_code_t blackhawk_pmd_cl72_enable_get( phymod_access_t *pa, uint32_t *enable);
    116 err_code_t blackhawk_pmd_cl72_receiver_status( phymod_access_t *pa, uint32_t *status);
    117 err_code_t blackhawk_tsc_ucode_init(  phymod_access_t *pa );
    118 err_code_t blackhawk_pram_firmware_enable( phymod_access_t *pa, int enable, int wait);
    119 err_code_t blackhawk_pmd_reset_seq( phymod_access_t *pa, int pmd_touched);
    120 err_code_t blackhawk_pll_reset_enable_set( phymod_access_t *pa, int enable);
    121 err_code_t blackhawk_tsc_read_pll_range( phymod_access_t *pa, uint32_t *pll_range);
    122 err_code_t blackhawk_tsc_signal_detect ( phymod_access_t *pa, uint32_t *signal_detect);
    123 err_code_t blackhawk_force_tx_set_rst ( phymod_access_t *pa, uint32_t rst);
    124 err_code_t blackhawk_force_tx_get_rst ( phymod_access_t *pa, uint32_t *rst);
    125 err_code_t blackhawk_force_rx_set_rst ( phymod_access_t *pa, uint32_t rst);
    126 err_code_t blackhawk_force_rx_get_rst ( phymod_access_t *pa, uint32_t *rst);
    127 err_code_t blackhawk_tsc_ladder_setting_to_mV( phymod_access_t *pa, int8_t y, int16_t* level);
    128 err_code_t blackhawk_electrical_idle_set( phymod_access_t *pa, uint8_t en);
    129 err_code_t blackhawk_electrical_idle_get( phymod_access_t *pa, uint8_t *en);
    130 err_code_t blackhawk_tsc_get_vco ( phymod_phy_inf_config_t* config, uint32_t *vco_rate, uint32_t *new_pll_div, int16_t *new_os_mode);
    131 err_code_t blackhawk_tsc_tx_shared_patt_gen_en_get(  phymod_access_t *pa, uint8_t *enable);
    132 err_code_t blackhawk_tsc_config_shared_tx_pattern_idx_set(  phymod_access_t *pa,  uint32_t *pattern_len);
    133 err_code_t blackhawk_tsc_config_shared_tx_pattern_idx_get(  phymod_access_t *pa, uint32_t *pattern_len, uint32_t *pattern);
    134 err_code_t blackhawk_tsc_tx_disable_get ( phymod_access_t *pa, uint8_t *enable);
    135 err_code_t blackhawk_refclk_set( phymod_access_t *pa, phymod_ref_clk_t ref_clock);
    136 err_code_t blackhawk_pmd_force_signal_detect_get( phymod_access_t *sa__, uint8_t *force_en, uint8_t *force_val);
    137 err_code_t blackhawk_channel_loss_set( phymod_access_t *sa__, uint32_t loss_in_db);
    138 err_code_t blackhawk_channel_loss_get( phymod_access_t *sa__, uint32_t *loss_in_db);
    139 err_code_t blackhawk_tsc_tx_tap_mode_get( phymod_access_t *sa__, uint8_t *mode);
    140 err_code_t blackhawk_tsc_pam4_tx_pattern_enable_get( phymod_access_t *sa__, phymod_PAM4_tx_pattern_t pattern_type, uint32_t* enable);
    141 err_code_t blackhawk_tsc_signalling_mode_status_get( phymod_access_t *sa__, phymod_phy_signalling_method_t *mode);
    142 err_code_t blackhawk_tsc_tx_nrz_mode_get(phymod_access_t *sa__, uint16_t *tx_nrz_mode);
    143 err_code_t blackhawk_tsc_tx_pam4_precoder_enable_set(phymod_access_t *sa__, int enable);
    144 err_code_t blackhawk_tsc_tx_pam4_precoder_enable_get(phymod_access_t *sa__, int *enable);
    145 err_code_t blackhawk_micro_clk_source_select( phymod_access_t *sa__, uint32_t pll_index);
    146 err_code_t blackhawk_speed_config_get(uint32_t speed, int ref_clk_is_156p25, uint32_t *pll_multiplier, uint32_t *is_pam4, uint32_t *osr_mode);
    147 
    148 /* Get the PLL powerdown status */
    149 err_code_t blackhawk_tsc_pll_pwrdn_get(phymod_access_t *sa__, uint32_t *is_pwrdn);
    150 err_code_t blackhawk_tsc_lane_cfg_fwapi_data1_set( phymod_access_t *sa__, uint32_t val);
    151 err_code_t blackhawk_tsc_enable_pass_through_configuration(phymod_access_t *sa__, int enable);
    152 /* Locks TX_PI to Loop timing, external CDR */
    153 err_code_t blackhawk_tsc_ext_loop_timing(phymod_access_t *sa__, uint8_t enable);
    154 err_code_t blackhawk_tsc_error_analyzer_status_clear(phymod_access_t *sa__);
    155 err_code_t blackhawk_tsc_rx_ppm(phymod_access_t *sa__, int16_t *rx_ppm);
    156 /* Set/Get clk4sync_en, clk4sync_div */
    157 err_code_t blackhawk_tsc_clk4sync_enable_set(phymod_access_t *sa__, uint32_t en, uint32_t div);
    158 err_code_t blackhawk_tsc_clk4sync_enable_get(phymod_access_t *sa__, uint32_t *en, uint32_t *div);
    159 err_code_t blackhawk_ams_version_get(phymod_access_t *sa__, uint32_t *ams_version);
    160 err_code_t blackhawk_tsc_pll_lock_get(phymod_access_t *sa__, uint32_t *pll_lock);
    161 #endif /* PHY_TSC_IBLK_H */