OpenBIC
OpenSource Bridge-IC
plat_class.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for plat_class.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CARD_STATUS_
 

Macros

#define SYS_CLASS_1   1
 
#define SYS_CLASS_2   2
 
#define CPLD_CLASS_TYPE_REG   0x05
 
#define CPLD_2OU_EXPANSION_CARD_REG   0x06
 
#define CPLD_BOARD_REV_ID_REG   0x08
 
#define CPLD_1OU_CARD_DETECTION   0x09
 
#define CPLD_1OU_VPP_POWER_STATUS   0x11
 
#define I2C_DATA_SIZE   5
 
#define NUMBER_OF_ADC_CHANNEL   16
 
#define AST1030_ADC_BASE_ADDR   0x7e6e9000
 
#define HSC_TYPE_ADC_TOLERANCE   0.2
 
#define MAX_1OU_M2_COUNT   4
 

Typedefs

typedef struct _CARD_STATUS_ CARD_STATUS
 

Enumerations

enum  BIC_BOARD_REVISION {
  SYS_BOARD_POC = 0x0 , SYS_BOARD_EVT , SYS_BOARD_EVT2 , SYS_BOARD_EVT3_HOTSWAP ,
  SYS_BOARD_EVT3_EFUSE , SYS_BOARD_DVT_HOTSWAP , SYS_BOARD_DVT_EFUSE , SYS_BOARD_PVT_HOTSWAP ,
  SYS_BOARD_PVT_EFUSE , SYS_BOARD_MP_HOTSWAP , SYS_BOARD_MP_EFUSE , SYS_BOARD_MP_2_HOTSWAP ,
  SYS_BOARD_MP_2_EFUSE , SYS_BOARD_POC = 0x0 , SYS_BOARD_EVT , SYS_BOARD_DVT = 0x03 ,
  SYS_BOARD_PVT = 0x05 , SYS_BOARD_MP , SYS_BOARD_POC = 0x0 , SYS_BOARD_EVT ,
  SYS_BOARD_EVT2 , SYS_BOARD_DVT , SYS_BOARD_PVT , SYS_BOARD_PVT2 ,
  SYS_BOARD_PVT2_5 , SYS_BOARD_MP
}
 
enum  _1OU_CARD_TYPE_ {
  TYPE_1OU_SI_TEST_CARD = 0x0 , TYPE_1OU_EXP_WITH_6_M2 , TYPE_1OU_RAINBOW_FALLS , TYPE_1OU_VERNAL_FALLS_WITH_TI ,
  TYPE_1OU_VERNAL_FALLS_WITH_AST , TYPE_1OU_EXP_WITH_NIC = 0x07 , TYPE_1OU_ABSENT = 0xFE , TYPE_1OU_UNKNOWN = 0xFF ,
  TYPE_1OU_SI_TEST_CARD = 0x0 , TYPE_1OU_EXP_WITH_6_M2 , TYPE_1OU_RAINBOW_FALLS , TYPE_1OU_VERNAL_FALLS_WITH_TI ,
  TYPE_1OU_VERNAL_FALLS_WITH_AST , TYPE_1OU_KAHUNA_FALLS , TYPE_1OU_WAIMANO_FALLS , TYPE_1OU_EXP_WITH_NIC ,
  TYPE_1OU_ABSENT = 0xFE , TYPE_1OU_UNKNOWN = 0xFF , TYPE_1OU_SI_TEST_CARD = 0x0 , TYPE_1OU_EXP_WITH_6_M2 ,
  TYPE_1OU_RAINBOW_FALLS , TYPE_1OU_VERNAL_FALLS_WITH_TI , TYPE_1OU_VERNAL_FALLS_WITH_AST , TYPE_1OU_KAHUNA_FALLS ,
  TYPE_1OU_WAIMANO_FALLS , TYPE_1OU_EXP_WITH_NIC , TYPE_1OU_OLMSTED_POINT , TYPE_1OU_NIAGARA_FALLS = 0x09 ,
  TYPE_1OU_EXP_WITH_E1S , TYPE_1OU_ABSENT = 0xFE , TYPE_1OU_UNKNOWN = 0xFF , TYPE_1OU_SI_TEST_CARD = 0x0 ,
  TYPE_1OU_EXP_WITH_6_M2 , TYPE_1OU_RAINBOW_FALLS , TYPE_1OU_VERNAL_FALLS_WITH_TI , TYPE_1OU_VERNAL_FALLS_WITH_AST ,
  TYPE_1OU_KAHUNA_FALLS , TYPE_1OU_WAIMANO_FALLS , TYPE_1OU_EXP_WITH_NIC , TYPE_1OU_EXP_WITH_E1S ,
  TYPE_1OU_ABSENT = 0xFE , TYPE_1OU_UNKNOWN = 0xFF , TYPE_1OU_SI_TEST_CARD = 0x0 , TYPE_1OU_EXP_WITH_6_M2 ,
  TYPE_1OU_RAINBOW_FALLS , TYPE_1OU_VERNAL_FALLS_WITH_TI , TYPE_1OU_VERNAL_FALLS_WITH_AST , TYPE_1OU_KAHUNA_FALLS ,
  TYPE_1OU_WAIMANO_FALLS , TYPE_1OU_EXP_WITH_NIC , TYPE_1OU_EXP_WITH_E1S , TYPE_1OU_ABSENT = 0xFE ,
  TYPE_1OU_UNKNOWN = 0xFF , TYPE_1OU_SI_TEST_CARD = 0x0 , TYPE_1OU_EXP_WITH_6_M2 , TYPE_1OU_RAINBOW_FALLS ,
  TYPE_1OU_VERNAL_FALLS_WITH_TI , TYPE_1OU_VERNAL_FALLS_WITH_AST , TYPE_1OU_KAHUNA_FALLS , TYPE_1OU_WAIMANO_FALLS ,
  TYPE_1OU_EXP_WITH_NIC , TYPE_1OU_ABSENT = 0xFE , TYPE_1OU_UNKNOWN = 0xFF
}
 
enum  _2OU_CARD_TYPE_ {
  TYPE_2OU_EXP = 0x1 , TYPE_2OU_EXP_E1S = 0x2 , TYPE_2OU_HSM = 0x6 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF , TYPE_2OU_DPV2_8 = 0x07 , TYPE_2OU_DPV2_16 = 0x70 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF , TYPE_2OU_DPV2_8 = 0x07 , TYPE_2OU_DPV2_16 = 0x70 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF , TYPE_2OU_DPV2_8 = 0x07 , TYPE_2OU_DPV2_16 = 0x70 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF , TYPE_2OU_DPV2_8 = 0x07 , TYPE_2OU_DPV2_16 = 0x70 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF , TYPE_2OU_DPV2_8 = 0x07 , TYPE_2OU_DPV2_16 = 0x70 , TYPE_2OU_ABSENT = 0xFE ,
  TYPE_2OU_UNKNOWN = 0xFF
}
 
enum  ADC_CHANNEL {
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_6 = 6 , CHANNEL_7 = 7 ,
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_6 = 6 , CHANNEL_6 = 6 ,
  CHANNEL_6 = 6 , CHANNEL_7 = 7 , CHANNEL_5 = 5 , NUMBER_OF_ADC_CHANNEL = 16 ,
  ADC_CHANNEL_2 = 2 , ADC_CHANNEL_12 = 12 , ADC_CHANNEL_13 = 13 , NUMBER_OF_ADC_CHANNEL = 16
}
 
enum  HSC_MODULE {
  HSC_MODULE_ADM1272 , HSC_MODULE_XDP710 , HSC_MODULE_UNKNOWN , HSC_MODULE_ADM1272 ,
  HSC_MODULE_LTC4286 , HSC_MODULE_UNKNOWN = 0xFF , HSC_MODULE_ADM1278 , HSC_MODULE_LTC4282 ,
  HSC_MODULE_MP5990 , HSC_MODULE_ADM1276 , HSC_MODULE_UNKNOWN = 0xFF , HSC_MODULE_ADM1278 ,
  HSC_MODULE_LTC4282 , HSC_MODULE_MP5990 , HSC_MODULE_LTC4286 = 0x04 , HSC_MODULE_UNKNOWN = 0xFF ,
  HSC_MODULE_ADM1278 = 0b00 , HSC_MODULE_MP5990 = 0b01 , HSC_MODULE_UNKNOWN , HSC_MODULE_ADM1278 = 0b00 ,
  HSC_MODULE_LTC4282 = 0b01 , HSC_MODULE_MP5990 = 0b10 , HSC_MODULE_UNKNOWN , HSC_MODULE_ADM1278 = 0b00 ,
  HSC_MODULE_LTC4282 = 0b01 , HSC_MODULE_MP5990 = 0b10 , HSC_MODULE_UNKNOWN , HSC_MODULE_MP5990 ,
  HSC_MODULE_RS31380R , HSC_MODULE_UNKNOWN = 0xFF
}
 
enum  RETIMER_MODULE { RETIMER_MODULE_PT4080L , RETIMER_MODULE_DS160PT801 , RETIMER_MODULE_UNKNOWN = 0xFF }
 
enum  OTHER_MODULE { OTH_MODULE_PRIMARY , OTH_MODULE_SECOND , OTH_MODULE_UNKNOWN = 0xFF }
 
enum  BIC_CARD_PRESENT {
  CARD_UNPRESENT = false , CARD_PRESENT = true , CARD_UNPRESENT = false , CARD_PRESENT = true ,
  CARD_UNPRESENT = false , CARD_PRESENT = true , CARD_UNPRESENT = false , CARD_PRESENT = true ,
  CARD_UNPRESENT = false , CARD_PRESENT = true
}
 
enum  FIRMWARE_COMPONENT_ID {
  JI_COMPNT_CPLD , JI_COMPNT_BIC = 2 , JI_COMPNT_CPUDVDD , JI_COMPNT_CPUVDD ,
  JI_COMPNT_SOCVDD , JI_COMPNT_RETIMER , JI_COMPNT_FBVDDP2 , JI_COMPNT_1V2 ,
  JI_COMPNT_MAX
}
 

Functions

uint8_t get_system_class ()
 
CARD_STATUS get_1ou_status ()
 
CARD_STATUS get_2ou_status ()
 
uint8_t get_board_revision ()
 
uint8_t get_hsc_module ()
 
uint8_t get_retimer_module ()
 
void set_retimer_module (uint8_t module)
 
uint8_t get_oth_module ()
 
bool get_adc_voltage (int channel, float *voltage)
 
void init_hsc_module (uint8_t board_revision)
 
void init_platform_config ()
 

Macro Definition Documentation

◆ AST1030_ADC_BASE_ADDR

#define AST1030_ADC_BASE_ADDR   0x7e6e9000

◆ CPLD_1OU_CARD_DETECTION

#define CPLD_1OU_CARD_DETECTION   0x09

◆ CPLD_1OU_VPP_POWER_STATUS

#define CPLD_1OU_VPP_POWER_STATUS   0x11

◆ CPLD_2OU_EXPANSION_CARD_REG

#define CPLD_2OU_EXPANSION_CARD_REG   0x06

◆ CPLD_BOARD_REV_ID_REG

#define CPLD_BOARD_REV_ID_REG   0x08

◆ CPLD_CLASS_TYPE_REG

#define CPLD_CLASS_TYPE_REG   0x05

◆ HSC_TYPE_ADC_TOLERANCE

#define HSC_TYPE_ADC_TOLERANCE   0.2

◆ I2C_DATA_SIZE

#define I2C_DATA_SIZE   5

◆ MAX_1OU_M2_COUNT

#define MAX_1OU_M2_COUNT   4

◆ NUMBER_OF_ADC_CHANNEL

#define NUMBER_OF_ADC_CHANNEL   16

◆ SYS_CLASS_1

#define SYS_CLASS_1   1

◆ SYS_CLASS_2

#define SYS_CLASS_2   2

Typedef Documentation

◆ CARD_STATUS

typedef struct _CARD_STATUS_ CARD_STATUS

Enumeration Type Documentation

◆ _1OU_CARD_TYPE_

Enumerator
TYPE_1OU_SI_TEST_CARD 
TYPE_1OU_EXP_WITH_6_M2 
TYPE_1OU_RAINBOW_FALLS 
TYPE_1OU_VERNAL_FALLS_WITH_TI 
TYPE_1OU_VERNAL_FALLS_WITH_AST 
TYPE_1OU_EXP_WITH_NIC 
TYPE_1OU_ABSENT 
TYPE_1OU_UNKNOWN 
TYPE_1OU_SI_TEST_CARD 
TYPE_1OU_EXP_WITH_6_M2 
TYPE_1OU_RAINBOW_FALLS 
TYPE_1OU_VERNAL_FALLS_WITH_TI 
TYPE_1OU_VERNAL_FALLS_WITH_AST 
TYPE_1OU_KAHUNA_FALLS 
TYPE_1OU_WAIMANO_FALLS 
TYPE_1OU_EXP_WITH_NIC 
TYPE_1OU_ABSENT 
TYPE_1OU_UNKNOWN 
TYPE_1OU_SI_TEST_CARD 
TYPE_1OU_EXP_WITH_6_M2 
TYPE_1OU_RAINBOW_FALLS 
TYPE_1OU_VERNAL_FALLS_WITH_TI 
TYPE_1OU_VERNAL_FALLS_WITH_AST 
TYPE_1OU_KAHUNA_FALLS 
TYPE_1OU_WAIMANO_FALLS 
TYPE_1OU_EXP_WITH_NIC 
TYPE_1OU_OLMSTED_POINT 
TYPE_1OU_NIAGARA_FALLS 
TYPE_1OU_EXP_WITH_E1S 
TYPE_1OU_ABSENT 
TYPE_1OU_UNKNOWN 
TYPE_1OU_SI_TEST_CARD 
TYPE_1OU_EXP_WITH_6_M2 
TYPE_1OU_RAINBOW_FALLS 
TYPE_1OU_VERNAL_FALLS_WITH_TI 
TYPE_1OU_VERNAL_FALLS_WITH_AST 
TYPE_1OU_KAHUNA_FALLS 
TYPE_1OU_WAIMANO_FALLS 
TYPE_1OU_EXP_WITH_NIC 
TYPE_1OU_EXP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CHANNEL_7 
CHANNEL_6 
CHANNEL_6 
CHANNEL_6 
CHANNEL_7 
CHANNEL_5 
NUMBER_OF_ADC_CHANNEL 
ADC_CHANNEL_2 
ADC_CHANNEL_12 
ADC_CHANNEL_13 
NUMBER_OF_ADC_CHANNEL 

◆ BIC_BOARD_REVISION

Enumerator
SYS_BOARD_POC 
SYS_BOARD_EVT 
SYS_BOARD_EVT2 
SYS_BOARD_EVT3_HOTSWAP 
SYS_BOARD_EVT3_EFUSE 
SYS_BOARD_DVT_HOTSWAP 
SYS_BOARD_DVT_EFUSE 
SYS_BOARD_PVT_HOTSWAP 
SYS_BOARD_PVT_EFUSE 
SYS_BOARD_MP_HOTSWAP 
SYS_BOARD_MP_EFUSE 
SYS_BOARD_MP_2_HOTSWAP 
SYS_BOARD_MP_2_EFUSE 
SYS_BOARD_POC 
SYS_BOARD_EVT 
SYS_BOARD_DVT 
SYS_BOARD_PVT 
SYS_BOARD_MP 
SYS_BOARD_POC 
SYS_BOARD_EVT 
SYS_BOARD_EVT2 
SYS_BOARD_DVT 
SYS_BOARD_PVT 
SYS_BOARD_PVT2 
SYS_BOARD_PVT2_5 
SYS_BOARD_MP 

◆ BIC_CARD_PRESENT

Enumerator
CARD_UNPRESENT 
CARD_PRESENT 
CARD_UNPRESENT 
CARD_PRESENT 
CARD_UNPRESENT 
CARD_PRESENT 
CARD_UNPRESENT 
CARD_PRESENT 
CARD_UNPRESENT 
CARD_PRESENT 

◆ FIRMWARE_COMPONENT_ID

Enumerator
JI_COMPNT_CPLD 
JI_COMPNT_BIC 
JI_COMPNT_CPUDVDD 
JI_COMPNT_CPUVDD 
JI_COMPNT_SOCVDD 
JI_COMPNT_RETIMER 
JI_COMPNT_FBVDDP2 
JI_COMPNT_1V2 
JI_COMPNT_MAX 

◆ HSC_MODULE

enum HSC_MODULE
Enumerator
HSC_MODULE_ADM1272 
HSC_MODULE_XDP710 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1272 
HSC_MODULE_LTC4286 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1278 
HSC_MODULE_LTC4282 
HSC_MODULE_MP5990 
HSC_MODULE_ADM1276 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1278 
HSC_MODULE_LTC4282 
HSC_MODULE_MP5990 
HSC_MODULE_LTC4286 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1278 
HSC_MODULE_MP5990 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1278 
HSC_MODULE_LTC4282 
HSC_MODULE_MP5990 
HSC_MODULE_UNKNOWN 
HSC_MODULE_ADM1278 
HSC_MODULE_LTC4282 
HSC_MODULE_MP5990 
HSC_MODULE_UNKNOWN 
HSC_MODULE_MP5990 
HSC_MODULE_RS31380R 
HSC_MODULE_UNKNOWN 

◆ OTHER_MODULE

Enumerator
OTH_MODULE_PRIMARY 
OTH_MODULE_SECOND 
OTH_MODULE_UNKNOWN 

◆ RETIMER_MODULE

Enumerator
RETIMER_MODULE_PT4080L 
RETIMER_MODULE_DS160PT801 
RETIMER_MODULE_UNKNOWN 

Function Documentation

◆ get_1ou_status()

CARD_STATUS get_1ou_status ( )

◆ get_2ou_status()

CARD_STATUS get_2ou_status ( )

◆ get_adc_voltage()

bool get_adc_voltage ( int  channel,
float *  voltage 
)

◆ get_board_revision()

uint8_t get_board_revision ( )

◆ get_hsc_module()

uint8_t get_hsc_module ( )

◆ get_oth_module()

uint8_t get_oth_module ( )

◆ get_retimer_module()

uint8_t get_retimer_module ( )

◆ get_system_class()

uint8_t get_system_class ( )

◆ init_hsc_module()

void init_hsc_module ( uint8_t  board_revision)
Here is the call graph for this function:

◆ init_platform_config()

void init_platform_config ( )

◆ set_retimer_module()

void set_retimer_module ( uint8_t  module)