OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include "sensor.h"
#include "plat_def.h"
#include "plat_class.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_sensor_table.h"
#include "i2c-mux-tca9548.h"
#include "logging/log.h"
#include "libipmi.h"
#include "ipmi.h"
#include "power_status.h"
#include "nvidia.h"
#include "plat_mctp.h"
Include dependency graph for plat_hook.c:

Macros

#define ADJUST_MP5990_CURRENT(x)   (x * 1)
 
#define ADJUST_MP5990_POWER(x)   (x * 1)
 
#define ADJUST_RS31380R_CURRENT(x)   (x * 1)
 
#define ADJUST_RS31380R_POWER(x)   (x * 1)
 
#define RETIMER_INIT_RETRY_COUNT   3
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool pre_vol_bat3v_read (sensor_cfg *cfg, void *args)
 
bool post_vol_bat3v_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_mp5990_cur_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_mp5990_pwr_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_rs31380r_cur_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_rs31380r_pwr_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_tmp451_read (sensor_cfg *cfg, void *args)
 
bool pre_tmp75_read (sensor_cfg *cfg, void *args)
 
bool pre_pt4080l_read (sensor_cfg *cfg, void *args)
 
bool pre_ds160pt801_read (sensor_cfg *cfg, void *args)
 

Variables

adc_asd_init_arg ast_adc_init_args []
 
mp5990_init_arg mp5990_init_args []
 
rs31380r_init_arg rs31380r_init_args []
 
ina230_init_arg ina230_init_args []
 
pt5161l_init_arg pt5161l_init_args []
 
nv_satmc_init_arg satmc_init_args []
 
struct tca9548 mux_conf_addr_0xe0 [4]
 
struct tca9548 mux_conf_addr_0xe2 [2]
 

Macro Definition Documentation

◆ ADJUST_MP5990_CURRENT

#define ADJUST_MP5990_CURRENT (   x)    (x * 1)

◆ ADJUST_MP5990_POWER

#define ADJUST_MP5990_POWER (   x)    (x * 1)

◆ ADJUST_RS31380R_CURRENT

#define ADJUST_RS31380R_CURRENT (   x)    (x * 1)

◆ ADJUST_RS31380R_POWER

#define ADJUST_RS31380R_POWER (   x)    (x * 1)

◆ RETIMER_INIT_RETRY_COUNT

#define RETIMER_INIT_RETRY_COUNT   3

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ post_mp5990_cur_read()

bool post_mp5990_cur_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_mp5990_pwr_read()

bool post_mp5990_pwr_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_rs31380r_cur_read()

bool post_rs31380r_cur_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_rs31380r_pwr_read()

bool post_rs31380r_pwr_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_vol_bat3v_read()

bool post_vol_bat3v_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ pre_ds160pt801_read()

bool pre_ds160pt801_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

◆ pre_pt4080l_read()

bool pre_pt4080l_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

◆ pre_tmp451_read()

bool pre_tmp451_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

◆ pre_tmp75_read()

bool pre_tmp75_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

◆ pre_vol_bat3v_read()

bool pre_vol_bat3v_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

Variable Documentation

◆ ast_adc_init_args

adc_asd_init_arg ast_adc_init_args[]
Initial value:
= {
[0] = {
.is_init = false,
.deglitch[0] = { .deglitch_en = true, .upper_bound = 0x333, .lower_bound = 0x29F },
.deglitch[1] = { .deglitch_en = true, .upper_bound = 0x32B, .lower_bound = 0x290 },
.deglitch[2] = { .deglitch_en = true, .upper_bound = 0x2BC, .lower_bound = 0x27F },
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x1DB, .lower_bound = 0x138 },
.deglitch[4] = { .deglitch_en = true, .upper_bound = 0x1E9, .lower_bound = 0x170 },
.deglitch[5] = { .deglitch_en = true, .upper_bound = 0x204, .lower_bound = 0x127 },
.deglitch[7] = { .deglitch_en = true, .upper_bound = 0x208, .lower_bound = 0x1CF },
},
[1] = {
.is_init = false,
.deglitch[1] = { .deglitch_en = true, .upper_bound = 0x2BC, .lower_bound = 0x27F },
.deglitch[2] = { .deglitch_en = true, .upper_bound = 0x208, .lower_bound = 0x1CF },
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x0ED, .lower_bound = 0x0BD },
.deglitch[4] = { .deglitch_en = true, .upper_bound = 0x1CE, .lower_bound = 0x19A },
.deglitch[5] = { .deglitch_en = true, .upper_bound = 0x322, .lower_bound = 0x2B5 },
.deglitch[6] = { .deglitch_en = true, .upper_bound = 0x25C, .lower_bound = 0x224 },
.deglitch[7] = { .deglitch_en = true, .upper_bound = 0x189, .lower_bound = 0x159 },
}
}

◆ ina230_init_args

ina230_init_arg ina230_init_args[]
Initial value:
= {
[0] = { .is_init = false,
.config =
{
.MODE = 0b111,
.VSH_CT = 0b100,
.VBUS_CT = 0b100,
.AVG = 0b000,
},
.alt_cfg =
{
.LEN = 1,
.BOL = 1,
},
.r_shunt = 0.01,
.alert_value = 13.2,
.i_max = 16.384 },
}

◆ mp5990_init_args

mp5990_init_arg mp5990_init_args[]
Initial value:
= {
[0] = { .is_init = false,
.iout_cal_gain = 0xFFFF,
.iout_oc_fault_limit = 0xFFFF,
.ocw_sc_ref = 0xFFFF },
}

◆ mux_conf_addr_0xe0

struct tca9548 mux_conf_addr_0xe0[4]
Initial value:
= {
[0] = { .addr = 0xe0, .chan = 0 },
[1] = { .addr = 0xe0, .chan = 1 },
[2] = { .addr = 0xe0, .chan = 2 },
[3] = { .addr = 0xe0, .chan = 3 },
}

◆ mux_conf_addr_0xe2

struct tca9548 mux_conf_addr_0xe2[2]
Initial value:
= {
[0] = { .addr = 0xe2, .chan = 0 },
[1] = { .addr = 0xe2, .chan = 1 },
}

◆ pt5161l_init_args

pt5161l_init_arg pt5161l_init_args[]
Initial value:
= { [0] = { .is_init = false,
.temp_cal_code_pma_a = { 0, 0, 0, 0 },
.temp_cal_code_pma_b = { 0, 0, 0, 0 },
.temp_cal_code_avg = 0 } }

◆ rs31380r_init_args

rs31380r_init_arg rs31380r_init_args[]
Initial value:
= {
[0] = { .is_init = false,
.iout_cal_gain = 0xFFFF,
.iout_oc_fault_limit = 0xFFFF,
.ocw_sc_ref = 0xFFFF },
}

◆ satmc_init_args

nv_satmc_init_arg satmc_init_args[]