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

madura_sdk_interface.h (4285B)


      1 /*
      2  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3  * 
      4  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      5  * 
      6 */
      7 /* 
      8  *
      9  *  Broadcom Confidential/Proprietary.
     10  *  Copyright (c) 2015 Broadcom Corporation. All rights reserved.
     11  */
     12 
     13 #ifndef MADURA_SDK_INTERFACE_H_
     14 #define MADURA_SDK_INTERFACE_H_
     15 
     16 /** @file madura_sdk_interface.h
     17  *  Declaration of data structure and constants shared by Madura firmware and Madura SDK.
     18  */
     19 
     20 /** @enum E_MADURA_SYS_LINE_SEL
     21  *  Constants to select Madura system side or line side in some functions.
     22  */
     23 /** @enum E_MADURA_MEDIA_TYPE
     24  *  Constants to select Serdes media type.
     25  */
     26 
     27 /** @enum E_MADURA_DFE_OPTION
     28  *  Constants to select DFE type.
     29  */
     30 
     31 /** @enum E_MADURA_TX_TIMING_MODE
     32  *  Constants to select Serdes Tx timing source.
     33  */
     34 
     35 /** @typedef union madura_user_port_config_un madura_port_config_t
     36  *  Data structure to specify Madura user configuration at port level.
     37  */
     38 
     39 enum E_MADURA_SYS_LINE_SEL
     40 {
     41     MADURA_SYS  = 0,  /**< select Madura system side */
     42     MADURA_LINE = 1   /**< select Madura line side */
     43 };
     44 
     45 enum E_MADURA_MEDIA_TYPE
     46 {
     47     SERDES_MEDIA_TYPE_BACK_PLANE             = 0,  /**< KR link: back plane media  */
     48     SERDES_MEDIA_TYPE_COPPER_CABLE           = 1,  /**< CR link: direct-attached copper cable  */
     49     SERDES_MEDIA_TYPE_OPTICAL_RELIABLE_LOS   = 2,  /**< SR/LR link: optical fiber with reliable LOS detection  */
     50     SERDES_MEDIA_TYPE_OPTICAL_UNRELIABLE_LOS = 3   /**< SR/LR link: optical fiber with unreliable LOS detection  */
     51 };
     52 
     53 enum E_MADURA_DFE_OPTION
     54 {
     55     SERDES_DFE_OPTION_NO_DFE      = 0,  /**< no DFE is used  */
     56     SERDES_DFE_OPTION_DFE         = 1,  /**< DFE is enabled  */
     57     SERDES_DFE_OPTION_BRDEF       = 2,  /**< Force BRDFE mode, DFE will be on, too.  */
     58     SERDES_DFE_OPTION_DFE_LP_MODE = 3   /**< DFE is enabled in low-power mode  */
     59 };
     60 
     61 enum E_MADURA_TX_TIMING_MODE
     62 {
     63     MADURA_TX_REPEATER      = 0, /**< Tx repeater mode, chip default  */
     64     MADURA_TX_REPEATER1     = 1, /**< Alternative value for Tx repeater mode  */
     65     MADURA_TX_RETIMER       = 2, /**< Tx retimer mode  */
     66     MADURA_TX_REPEATER_ULL  = 3  /**< Tx repeater mode with ULL data path  */
     67 };
     68 
     69 #ifdef  MADURA_UNTESTED_CODE
     70 typedef union madura_port_user_config_un
     71 {
     72     union {
     73         uint16_t word;
     74         struct {
     75             uint8_t sys_media_type       : 2; /**< [1:0] use the symbols in E_MADURA_MEDIA_TYPE  */
     76             uint8_t sys_DFE_option       : 2; /**< [3:2] use the symbols in E_MADURA_DFE_OPTION_TYPE  */
     77             uint8_t sys_Tx_training_en   : 1; /**< [4]   0/1: disable/enable forced Tx training at system side  */
     78             uint8_t sys_Tx_timing_mode   : 2; /**< [6:5] use the symbols in E_MADURA_TX_TIMING_MODE for LRx->STx direction  */
     79             uint8_t loopback_change      : 1; /**< [7]   0/1: loopback config at either side no change/changed.  */
     80 
     81             uint8_t line_media_type      : 2; /**< [9:8] use the symbols in E_MADURA_MEDIA_TYPE  */
     82             uint8_t line_DFE_option      : 2; /**< [11:10] use the symbols in E_MADURA_DFE_OPTION_TYPE  */
     83             uint8_t line_Tx_training_en  : 1; /**< [12]  0/1: disable/enable forced Tx training at line side  */
     84             uint8_t line_Tx_timing_mode  : 2; /**< [14:13] use the symbols in E_MADURA_TX_TIMING_MODE for SRx->LTx direction  */
     85             uint8_t AN_enable            : 1; /**< [15]  0/1: disable/enable auto-negotiation at line side  */
     86         } fields;
     87     } both_sides;
     88 
     89     union {
     90         uint8_t byte;
     91         struct {
     92             uint8_t media_type           : 2; /**< [1:0] use the symbols in E_MADURA_MEDIA_TYPE  */
     93             uint8_t DFE_option           : 2; /**< [3:2] use the symbols in E_MADURA_DFE_OPTION_TYPE  */
     94             uint8_t Tx_training_en       : 1; /**< [4]   0/1: disable/enable forced Tx training at system side  */
     95             uint8_t Tx_timing_mode       : 2; /**< [6:5] use the symbols in E_MADURA_TX_TIMING_MODE  */
     96             uint8_t chip_feature_en      : 1; /**< [7]   0/1: disable/enable chip level features such as loopback and auto-negotiation  */
     97         } fields;
     98     } at_side[2];
     99 } madura_port_user_config_t;
    100 #endif /* MADURA_UNTESTED_CODE */
    101 
    102 #endif /* MADURA_SDK_INTERFACE_H_ */
    103