OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include "libutil.h"
#include "sensor.h"
#include "ipmi.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_sensor_table.h"
#include "intel_peci.h"
#include "intel_dimm.h"
#include "power_status.h"
#include <logging/log.h>
#include "i2c-mux-tca9548.h"
#include "pmic.h"
Include dependency graph for plat_hook.c:

Macros

#define ADJUST_ADM1278_POWER(x)   (x * 0.98)
 
#define ADJUST_ADM1278_CURRENT(x)   ((x * 0.98) + 0.1)
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool pre_vr_read (sensor_cfg *cfg, void *args)
 
bool pre_vol_bat3v_read (sensor_cfg *cfg, void *args)
 
bool post_vol_bat3v_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_adm1278_power_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_adm1278_current_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_intel_peci_dimm_read (sensor_cfg *cfg, void *args)
 

Variables

adc_asd_init_arg adc_asd_init_args [] = { [0] = { .is_init = false } }
 
adm1278_init_arg adm1278_init_args []
 
mp5990_init_arg mp5990_init_args []
 
pmic_init_arg pmic_init_args []
 
ina230_init_arg ina230_init_args []
 
struct tca9548 mux_conf_addr_0xe2 [8]
 
vr_pre_proc_arg vr_pre_read_args []
 
dimm_pre_proc_arg dimm_pre_proc_args []
 

Macro Definition Documentation

◆ ADJUST_ADM1278_CURRENT

#define ADJUST_ADM1278_CURRENT (   x)    ((x * 0.98) + 0.1)

◆ ADJUST_ADM1278_POWER

#define ADJUST_ADM1278_POWER (   x)    (x * 0.98)

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ post_adm1278_current_read()

bool post_adm1278_current_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)

◆ post_adm1278_power_read()

bool post_adm1278_power_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)

◆ 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_intel_peci_dimm_read()

bool pre_intel_peci_dimm_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:

◆ pre_vr_read()

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

Variable Documentation

◆ adc_asd_init_args

adc_asd_init_arg adc_asd_init_args[] = { [0] = { .is_init = false } }

◆ adm1278_init_args

adm1278_init_arg adm1278_init_args[]
Initial value:
= {
[0] = { .is_init = false, .config = { 0x3F1C }, .r_sense = 0.25 }
}

◆ dimm_pre_proc_args

dimm_pre_proc_arg dimm_pre_proc_args[]
Initial value:
= {
[0] = { .is_present_checked = false },
[1] = { .is_present_checked = false },
[2] = { .is_present_checked = false },
[3] = { .is_present_checked = false },
}

◆ 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,
.POL = 1,
},
.r_shunt = 0.001,
.alert_value = 18.0,
.i_max = 16.384 },
}

◆ mp5990_init_args

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

◆ mux_conf_addr_0xe2

struct tca9548 mux_conf_addr_0xe2[8]
Initial value:
= {
[0] = { .addr = 0xe2, .chan = 0 }, [1] = { .addr = 0xe2, .chan = 1 },
[2] = { .addr = 0xe2, .chan = 2 }, [3] = { .addr = 0xe2, .chan = 3 },
[4] = { .addr = 0xe2, .chan = 4 }, [5] = { .addr = 0xe2, .chan = 5 },
[6] = { .addr = 0xe2, .chan = 6 }, [7] = { .addr = 0xe2, .chan = 7 },
}

◆ pmic_init_args

pmic_init_arg pmic_init_args[]
Initial value:
= {
[0] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x90 },
[1] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x92 },
[2] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x94 },
[3] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x96 },
[4] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x98 },
[5] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x9A },
[6] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x9C },
[7] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x9E },
[8] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x90 },
[9] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x92 },
[10] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x94 },
[11] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x96 },
[12] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x98 },
[13] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x9A },
[14] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x9C },
[15] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x9E },
}

◆ vr_pre_read_args

vr_pre_proc_arg vr_pre_read_args[]
Initial value:
= {
[0] = { 0x0 },
[1] = { 0x1 },
}