OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include <logging/log.h>
#include "libutil.h"
#include "sensor.h"
#include "pmbus.h"
#include "plat_hook.h"
#include "common_i2c_mux.h"
#include "i2c-mux-pca954x.h"
#include "i2c-mux-pca984x.h"
#include "plat_sensor_table.h"
#include "ltc2991.h"
#include "plat_i2c.h"
#include "plat_ipmi.h"
#include "plat_class.h"
#include "xdpe12284c.h"
#include "plat_dev.h"
#include "plat_mctp.h"
#include "util_sys.h"
Include dependency graph for plat_hook.c:

Macros

#define VR_A0V8_INIT_OFFSET   0
 
#define VR_D0V8_INIT_OFFSET   1
 
#define VR_VDDQCD_INIT_OFFSET   2
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool pre_nvme_read (sensor_cfg *cfg, void *args)
 
bool post_nvme_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_sq52205_read (sensor_cfg *cfg, void *args)
 
bool post_sq52205_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_cxl_switch_mux (uint8_t sensor_num, void *arg)
 
bool post_cxl_switch_mux (uint8_t sensor_num, void *arg)
 
bool pre_cxl_vr_read (sensor_cfg *cfg, void *args)
 
bool post_cxl_xdpe12284c_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_pm8702_read (sensor_cfg *cfg, void *args)
 

Variables

mp5990_init_arg mp5990_init_args []
 
adc_asd_init_arg adc_asd_init_args []
 
sq52205_init_arg sq52205_init_args []
 
ina233_init_arg mc_ina233_init_args []
 
ina233_init_arg ina233_init_args []
 
ltc2991_init_arg ltc2991_init_args []
 
uint8_t plat_monitor_table_arg []
 
mux_config bus_2_pca9548_configs []
 
mux_config bus_4_pca9548_configs []
 
mux_config bus_8_pca9548_configs []
 
mux_config cxl_mux_configs []
 
pwr_monitor_pre_proc_arg pwr_monitor_pre_proc_args []
 
uint8_t pm8702_pre_arg []
 
vr_pre_arg vr_pre_args []
 

Macro Definition Documentation

◆ VR_A0V8_INIT_OFFSET

#define VR_A0V8_INIT_OFFSET   0

◆ VR_D0V8_INIT_OFFSET

#define VR_D0V8_INIT_OFFSET   1

◆ VR_VDDQCD_INIT_OFFSET

#define VR_VDDQCD_INIT_OFFSET   2

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ post_cxl_switch_mux()

bool post_cxl_switch_mux ( uint8_t  sensor_num,
void *  arg 
)
Here is the call graph for this function:

◆ post_cxl_xdpe12284c_read()

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

◆ post_nvme_read()

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

◆ post_sq52205_read()

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

◆ pre_cxl_switch_mux()

bool pre_cxl_switch_mux ( uint8_t  sensor_num,
void *  arg 
)
Here is the call graph for this function:

◆ pre_cxl_vr_read()

bool pre_cxl_vr_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_pm8702_read()

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

◆ pre_sq52205_read()

bool pre_sq52205_read ( sensor_cfg cfg,
void *  args 
)

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 = 0x2D3 },
.deglitch[1] = { .deglitch_en = true,
.upper_bound = 0x20D },
.deglitch[2] = { .deglitch_en = true,
.upper_bound = 0x2AE },
} }

◆ bus_2_pca9548_configs

mux_config bus_2_pca9548_configs[]
Initial value:
= {
[0] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_6 },
[1] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_7 },
[2] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_4 },
[3] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_5 },
[4] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_3 },
[5] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_2 },
[6] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_1 },
[7] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_0 },
}
@ PCA9548A_CHANNEL_0
Definition: i2c-mux-pca954x.h:22
@ PCA9548A_CHANNEL_1
Definition: i2c-mux-pca954x.h:23
@ PCA9548A_CHANNEL_2
Definition: i2c-mux-pca954x.h:24
@ PCA9548A_CHANNEL_3
Definition: i2c-mux-pca954x.h:25
@ PCA9548A_CHANNEL_7
Definition: i2c-mux-pca954x.h:29
@ PCA9548A_CHANNEL_4
Definition: i2c-mux-pca954x.h:26
@ PCA9548A_CHANNEL_5
Definition: i2c-mux-pca954x.h:27
@ PCA9548A_CHANNEL_6
Definition: i2c-mux-pca954x.h:28

CXL ID mux config

◆ bus_4_pca9548_configs

mux_config bus_4_pca9548_configs[]
Initial value:
= {
[0] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_0 },
[1] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_1 },
[2] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_2 },
[3] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_3 },
[4] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_5 },
[5] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_4 },
[6] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_7 },
[7] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_6 },
}

◆ bus_8_pca9548_configs

mux_config bus_8_pca9548_configs[]
Initial value:
= {
[0] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_0 },
[1] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_1 },
[2] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_2 },
[3] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_3 },
[4] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_4 },
[5] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_5 },
[6] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_6 },
[7] = { .target_addr = 0x70, .channel = PCA9548A_CHANNEL_7 },
}

JCN 1~4, 9~12 E1.S 0 mux config

◆ cxl_mux_configs

mux_config cxl_mux_configs[]
Initial value:
= {
[0] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_0 },
[1] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_1 },
[2] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_2 },
[3] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_3 },
[4] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_4 },
[5] = { .target_addr = 0x71, .channel = PCA9848_CHANNEL_5 },
}
@ PCA9848_CHANNEL_0
Definition: i2c-mux-pca984x.h:31
@ PCA9848_CHANNEL_1
Definition: i2c-mux-pca984x.h:32
@ PCA9848_CHANNEL_4
Definition: i2c-mux-pca984x.h:35
@ PCA9848_CHANNEL_2
Definition: i2c-mux-pca984x.h:33
@ PCA9848_CHANNEL_3
Definition: i2c-mux-pca984x.h:34
@ PCA9848_CHANNEL_5
Definition: i2c-mux-pca984x.h:36

◆ ina233_init_args

ina233_init_arg ina233_init_args[]

◆ ltc2991_init_args

ltc2991_init_arg ltc2991_init_args[]

◆ mc_ina233_init_args

ina233_init_arg mc_ina233_init_args[]

◆ mp5990_init_args

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

◆ plat_monitor_table_arg

uint8_t plat_monitor_table_arg[]
Initial value:
@ CXL_CARD_5
Definition: plat_class.h:72
@ CXL_CARD_7
Definition: plat_class.h:74
@ CXL_CARD_2
Definition: plat_class.h:69
@ CXL_CARD_1
Definition: plat_class.h:68
@ CXL_CARD_8
Definition: plat_class.h:75
@ CXL_CARD_4
Definition: plat_class.h:71
@ CXL_CARD_6
Definition: plat_class.h:73
@ CXL_CARD_3
Definition: plat_class.h:70

◆ pm8702_pre_arg

uint8_t pm8702_pre_arg[]

◆ pwr_monitor_pre_proc_args

pwr_monitor_pre_proc_arg pwr_monitor_pre_proc_args[]
Initial value:
= {
[0] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_0 }, .jcn_number = 0 },
[1] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_0 }, .jcn_number = 1 },
[2] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_0 }, .jcn_number = 2 },
[3] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_0 }, .jcn_number = 3 },
[4] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_1 }, .jcn_number = 4 },
[5] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_1 }, .jcn_number = 5 },
[6] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_1 }, .jcn_number = 6 },
[7] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_1 }, .jcn_number = 7 },
[8] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_2 }, .jcn_number = 8 },
[9] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_2 }, .jcn_number = 9 },
[10] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_2 }, .jcn_number = 10 },
[11] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_2 }, .jcn_number = 11 },
[12] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_3 }, .jcn_number = 12 },
[13] = { { .target_addr = 0x70, .channel = PCA9546A_CHANNEL_3 }, .jcn_number = 13 },
}
@ PCA9546A_CHANNEL_0
Definition: i2c-mux-pca954x.h:34
@ PCA9546A_CHANNEL_3
Definition: i2c-mux-pca954x.h:37
@ PCA9546A_CHANNEL_2
Definition: i2c-mux-pca954x.h:36
@ PCA9546A_CHANNEL_1
Definition: i2c-mux-pca954x.h:35

◆ sq52205_init_args

sq52205_init_arg sq52205_init_args[]

◆ vr_pre_args

vr_pre_arg vr_pre_args[]
Initial value:
= {
[0] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_1 },
[1] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_1 },
[2] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_2 },
[3] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_2 },
[4] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_3 },
[5] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_3 },
[6] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_4 },
[7] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_4 },
[8] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_5 },
[9] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_5 },
[10] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_6 },
[11] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_6 },
[12] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_7 },
[13] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_7 },
[14] = { { .vr_page = PMBUS_PAGE_0 }, .cxl_id = CXL_CARD_8 },
[15] = { { .vr_page = PMBUS_PAGE_1 }, .cxl_id = CXL_CARD_8 },
}
@ PMBUS_PAGE_0
Definition: pmbus.h:23
@ PMBUS_PAGE_1
Definition: pmbus.h:24