OpenBIC
OpenSource Bridge-IC
plat_class.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <logging/log.h>
#include "libutil.h"
#include "plat_gpio.h"
#include "plat_i2c.h"
#include "plat_sensor_table.h"
#include "sensor.h"
#include "plat_class.h"
Include dependency graph for plat_class.c:

Classes

struct  ADC_INFO
 

Macros

#define NUMBER_OF_ADC_CHANNEL   16
 
#define AST1030_ADC_BASE_ADDR   0x7e6e9000
 

Enumerations

enum  ADC_REF_VOL_SELECTION {
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 ,
  REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40 , REF_VOL_2_5V = 0x0 , REF_VOL_1_2V = 0x40
}
 

Functions

 LOG_MODULE_REGISTER (plat_class)
 
bool get_adc_voltage (int channel, float *voltage)
 
GT_STAGE_REVISION_ID get_stage_by_rev_id ()
 
uint8_t get_hsc_type ()
 
uint8_t get_vr_type ()
 
uint8_t get_power_moniter_ic_type ()
 
void init_platform_hsc_config ()
 
void init_platform_vr_config ()
 
void init_platform_power_ic_config ()
 
void init_platform_config ()
 

Variables

struct ADC_INFO adc_info [NUMBER_OF_ADC_CHANNEL]
 

Macro Definition Documentation

◆ AST1030_ADC_BASE_ADDR

#define AST1030_ADC_BASE_ADDR   0x7e6e9000

◆ NUMBER_OF_ADC_CHANNEL

#define NUMBER_OF_ADC_CHANNEL   16

Enumeration Type Documentation

◆ ADC_REF_VOL_SELECTION

Enumerator
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 
REF_VOL_2_5V 
REF_VOL_1_2V 

Function Documentation

◆ get_adc_voltage()

bool get_adc_voltage ( int  channel,
float *  voltage 
)

◆ get_hsc_type()

uint8_t get_hsc_type ( )

◆ get_power_moniter_ic_type()

uint8_t get_power_moniter_ic_type ( )

◆ get_stage_by_rev_id()

GT_STAGE_REVISION_ID get_stage_by_rev_id ( )
Here is the call graph for this function:

◆ get_vr_type()

uint8_t get_vr_type ( )

◆ init_platform_config()

void init_platform_config ( )
Here is the call graph for this function:

◆ init_platform_hsc_config()

void init_platform_hsc_config ( )

Follow the schematic diagram, the HSC device can be distinguished by ADC11 (HSC_TYPE_ADC_R). 0.0V(+/- 15%), the hotswap model is MP5990. 1.0V(+/- 15%), the hotswap model is LTC4282. 1.5V(+/- 15%), the hotswap model is LTC4286.

Here is the call graph for this function:

◆ init_platform_power_ic_config()

void init_platform_power_ic_config ( )

Follow the schematic diagram, the power monitor ic can be distinguished by ADC13 (ADC_TYPE_ADC_R). 0.0V(+/- 15%), the power monitor ic is ISL28022. 0.5V(+/- 15%), the power monitor ic is INA230.

Here is the call graph for this function:

◆ init_platform_vr_config()

void init_platform_vr_config ( )

Follow the schematic diagram, the VR chip can be distinguished by ADC12 (VR_TYPE_ADC_R). 0.0V(+/- 15%), the VR chip is ISL69259. 0.5V(+/- 15%), the VR chip is XDPE12284.

Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_class  )

Variable Documentation

◆ adc_info

Initial value:
= {
{ 0x10, 0 }, { 0x10, 16 }, { 0x14, 0 }, { 0x14, 16 }, { 0x18, 0 }, { 0x18, 16 },
{ 0x1C, 0 }, { 0x1C, 16 }, { 0x110, 0 }, { 0x110, 16 }, { 0x114, 0 }, { 0x114, 16 },
{ 0x118, 0 }, { 0x118, 16 }, { 0x11C, 0 }, { 0x11C, 16 }
}