OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include <drivers/peci.h>
#include <logging/log.h>
#include "pmic.h"
#include "ipmi.h"
#include "sensor.h"
#include "libutil.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_sensor_table.h"
#include "plat_dimm.h"
#include "pmbus.h"
#include "intel_peci.h"
#include "intel_dimm.h"
#include "hal_peci.h"
#include "power_status.h"
#include "xdpe15284.h"
#include "util_sys.h"
#include "i2c-mux-tca9548.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)
 
#define ADJUST_LTC4286_POWER(x)   ((x * 0.99) + 1.5)
 
#define ADJUST_LTC4286_CURRENT(x)   ((x * 0.99) + 0.3)
 
#define ADJUST_LTC4282_POWER(x)   (x * 0.99)
 
#define ADJUST_LTC4282_CURRENT(x)   (x * 0.99)
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool pre_isl69259_read (sensor_cfg *cfg, void *args)
 
bool pre_nvme_read (sensor_cfg *cfg, void *args)
 
bool pre_vol_bat3v_read (sensor_cfg *cfg, void *args)
 
bool pre_intel_peci_dimm_read (sensor_cfg *cfg, void *args)
 
bool post_vol_bat3v_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_cpu_margin_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 post_ltc4286_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_ltc4282_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_intel_dimm_i3c_read (sensor_cfg *cfg, void *args)
 
bool post_intel_dimm_i3c_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_ifx_vr_cache_crc (sensor_cfg *cfg, uint8_t index)
 

Variables

adc_asd_init_arg adc_asd_init_args []
 
adm1278_init_arg adm1278_init_args []
 
mp5990_init_arg mp5990_init_args []
 
ltc4286_init_arg ltc4286_init_args []
 
ltc4282_init_arg ltc4282_init_args []
 
pmic_init_arg pmic_init_args []
 
max16550a_init_arg max16550a_init_args [] = { [0] = { .r_load = 14000 } }
 
ifx_vr_fw_info ifx_vr_fw_info_table []
 
struct tca9548 mux_conf_addr_0xe2 [8]
 
isl69259_pre_proc_arg isl69259_pre_read_args []
 
dimm_pre_proc_arg dimm_pre_proc_args []
 
dimm_post_proc_arg dimm_post_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)

◆ ADJUST_LTC4282_CURRENT

#define ADJUST_LTC4282_CURRENT (   x)    (x * 0.99)

◆ ADJUST_LTC4282_POWER

#define ADJUST_LTC4282_POWER (   x)    (x * 0.99)

◆ ADJUST_LTC4286_CURRENT

#define ADJUST_LTC4286_CURRENT (   x)    ((x * 0.99) + 0.3)

◆ ADJUST_LTC4286_POWER

#define ADJUST_LTC4286_POWER (   x)    ((x * 0.99) + 1.5)

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 
)
Here is the call graph for this function:

◆ post_adm1278_power_read()

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

◆ post_cpu_margin_read()

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

◆ post_intel_dimm_i3c_read()

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

◆ post_ltc4282_read()

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

◆ post_ltc4286_read()

bool post_ltc4286_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_ifx_vr_cache_crc()

bool pre_ifx_vr_cache_crc ( sensor_cfg cfg,
uint8_t  index 
)
Here is the call graph for this function:

◆ pre_intel_dimm_i3c_read()

bool pre_intel_dimm_i3c_read ( sensor_cfg cfg,
void *  args 
)
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_isl69259_read()

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

◆ pre_nvme_read()

bool pre_nvme_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

◆ adc_asd_init_args

adc_asd_init_arg adc_asd_init_args[]
Initial value:
= {
[0] = { .is_init = false,
.deglitch[0] = { .deglitch_en = true, .upper_bound = 0x33C },
.deglitch[2] = { .deglitch_en = true, .upper_bound = 0x2DA },
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x1C8 },
.deglitch[4] = { .deglitch_en = true, .upper_bound = 0x1DE },
},
[1] = {
.is_init = false,
.deglitch[1] = { .deglitch_en = true, .upper_bound = 0x26F },
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x372 },
.deglitch[5] = { .deglitch_en = true, .upper_bound = 0x213 },
.deglitch[6] = { .deglitch_en = true, .upper_bound = 0x2F6 },
.deglitch[7] = { .deglitch_en = true, .upper_bound = 0x311 },
}
}

◆ adm1278_init_args

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

◆ dimm_post_proc_args

dimm_post_proc_arg dimm_post_proc_args[]
Initial value:
= {
[0] = { .dimm_channel = DIMM_CHANNEL_NUM_0, .dimm_number = DIMM_NUMBER_0 },
[1] = { .dimm_channel = DIMM_CHANNEL_NUM_2, .dimm_number = DIMM_NUMBER_0 },
[2] = { .dimm_channel = DIMM_CHANNEL_NUM_3, .dimm_number = DIMM_NUMBER_0 },
[3] = { .dimm_channel = DIMM_CHANNEL_NUM_4, .dimm_number = DIMM_NUMBER_0 },
[4] = { .dimm_channel = DIMM_CHANNEL_NUM_6, .dimm_number = DIMM_NUMBER_0 },
[5] = { .dimm_channel = DIMM_CHANNEL_NUM_7, .dimm_number = DIMM_NUMBER_0 },
}
@ DIMM_CHANNEL_NUM_3
Definition: intel_dimm.h:49
@ DIMM_CHANNEL_NUM_0
Definition: intel_dimm.h:46
@ DIMM_CHANNEL_NUM_6
Definition: intel_dimm.h:52
@ DIMM_CHANNEL_NUM_7
Definition: intel_dimm.h:53
@ DIMM_CHANNEL_NUM_4
Definition: intel_dimm.h:50
@ DIMM_CHANNEL_NUM_2
Definition: intel_dimm.h:48
@ DIMM_NUMBER_0
Definition: intel_dimm.h:57

◆ 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 },
[4] = { .is_present_checked = false }, [5] = { .is_present_checked = false }
}

◆ ifx_vr_fw_info_table

ifx_vr_fw_info ifx_vr_fw_info_table[]
Initial value:
= { { .is_init = false },
{ .is_init = false },
{ .is_init = false } }

◆ isl69259_pre_read_args

isl69259_pre_proc_arg isl69259_pre_read_args[]
Initial value:
= {
[0] = { 0x0 },
[1] = { 0x1 },
}

◆ ltc4282_init_args

ltc4282_init_arg ltc4282_init_args[]
Initial value:
= { [0] = { .is_init = false,
.r_sense_mohm = 0.25,
.is_register_setting_needed = 0x01,
.ilim_adjust = { 0x13 } },
[1] = { .is_init = false,
.r_sense_mohm = 0.25,
.is_register_setting_needed = 0x01,
.ilim_adjust = { 0x53 } } }

◆ ltc4286_init_args

ltc4286_init_arg ltc4286_init_args[]
Initial value:
= {
[0] = { .is_init = false, .r_sense_mohm = 0.25, .mfr_config_1 = { 0x1570 } },
[1] = { .is_init = false, .r_sense_mohm = 0.25, .mfr_config_1 = { 0x3570 } }
}

◆ max16550a_init_args

max16550a_init_arg max16550a_init_args[] = { [0] = { .r_load = 14000 } }

◆ mp5990_init_args

mp5990_init_arg mp5990_init_args[]
Initial value:
= { [0] = { .is_init = false,
.iout_cal_gain = 0x0104,
.iout_oc_fault_limit = 0x0028,
.ocw_sc_ref = 0xFFFF },
[1] = { .is_init = false,
.iout_cal_gain = 0x01BF,
.iout_oc_fault_limit = 0x0046,
.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 = 0x98 },
[2] = { .is_init = false, .smbus_bus_identifier = 0x00, .smbus_addr = 0x9C },
[3] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x90 },
[4] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x98 },
[5] = { .is_init = false, .smbus_bus_identifier = 0x01, .smbus_addr = 0x9C }
}