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

Classes

struct  ADC_INFO
 
struct  _SLOT_EID_MAPPING_TABLE
 

Macros

#define BOARD_REVISION_PRSNT_BITS   0x07
 

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
}
 
enum  CONDITION {
  LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 ,
  HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 ,
  RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 ,
  LOWER = 0x0 , HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 ,
  HIGHER = 0x01 , RANGE = 0x02 , LOWER = 0x0 , HIGHER = 0x01 ,
  RANGE = 0x02
}
 

Functions

 LOG_MODULE_REGISTER (plat_class)
 
uint8_t get_slot_eid ()
 
uint8_t get_slot_id ()
 
bool pal_get_slot_pid (uint16_t *pid)
 
bool get_blade_config (uint8_t *blade_config)
 
bool get_board_rev (uint8_t *board_rev)
 
bool get_adc_voltage (int channel, float *voltage)
 
void init_platform_config ()
 
uint8_t get_retimer_type ()
 
void init_retimer_type ()
 

Variables

struct ADC_INFO adc_info [NUMBER_OF_ADC_CHANNEL]
 
struct _SLOT_EID_MAPPING_TABLE _slot_eid_mapping_table []
 
uint8_t slot_eid = 0
 
uint8_t slot_id = 0
 
uint16_t slot_pid = 0
 

Macro Definition Documentation

◆ BOARD_REVISION_PRSNT_BITS

#define BOARD_REVISION_PRSNT_BITS   0x07

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 

◆ CONDITION

enum CONDITION
Enumerator
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 
LOWER 
HIGHER 
RANGE 

Function Documentation

◆ get_adc_voltage()

bool get_adc_voltage ( int  channel,
float *  voltage 
)

◆ get_blade_config()

bool get_blade_config ( uint8_t *  blade_config)
Here is the call graph for this function:

◆ get_board_rev()

bool get_board_rev ( uint8_t *  board_rev)
Here is the call graph for this function:

◆ get_retimer_type()

uint8_t get_retimer_type ( )

◆ get_slot_eid()

uint8_t get_slot_eid ( )

◆ get_slot_id()

uint8_t get_slot_id ( )

◆ init_platform_config()

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

◆ init_retimer_type()

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

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_class  )

◆ pal_get_slot_pid()

bool pal_get_slot_pid ( uint16_t *  pid)

Variable Documentation

◆ _slot_eid_mapping_table

struct _SLOT_EID_MAPPING_TABLE _slot_eid_mapping_table[]
Initial value:
= {
{ 0, 0.15, LOWER, SLOT1_EID, SLOT1_PID }, { 0.15, 0.45, RANGE, SLOT2_EID, SLOT2_PID },
{ 0.45, 0.75, RANGE, SLOT3_EID, SLOT3_PID }, { 0.75, 1.05, RANGE, SLOT4_EID, SLOT4_PID },
{ 1.05, 1.35, RANGE, SLOT5_EID, SLOT5_PID }, { 1.35, 1.625, RANGE, SLOT6_EID, SLOT6_PID },
{ 1.625, 1.875, RANGE, SLOT7_EID, SLOT7_PID }, { 1.875, 2.5, HIGHER, SLOT8_EID, SLOT8_PID },
}
@ RANGE
Definition: plat_class.c:76
@ LOWER
Definition: plat_class.c:74
@ HIGHER
Definition: plat_class.c:75
@ SLOT8_EID
Definition: plat_class.h:17
@ SLOT3_EID
Definition: plat_class.h:12
@ SLOT1_EID
Definition: plat_class.h:10
@ SLOT6_EID
Definition: plat_class.h:15
@ SLOT7_EID
Definition: plat_class.h:16
@ SLOT5_EID
Definition: plat_class.h:14
@ SLOT4_EID
Definition: plat_class.h:13
@ SLOT2_EID
Definition: plat_class.h:11
@ SLOT4_PID
Definition: plat_class.h:24
@ SLOT2_PID
Definition: plat_class.h:22
@ SLOT5_PID
Definition: plat_class.h:25
@ SLOT8_PID
Definition: plat_class.h:28
@ SLOT1_PID
Definition: plat_class.h:21
@ SLOT6_PID
Definition: plat_class.h:26
@ SLOT7_PID
Definition: plat_class.h:27
@ SLOT3_PID
Definition: plat_class.h:23

◆ 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 }
}

◆ slot_eid

uint8_t slot_eid = 0

◆ slot_id

uint8_t slot_id = 0

◆ slot_pid

uint16_t slot_pid = 0