OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include "libutil.h"
#include <logging/log.h>
#include "plat_hook.h"
#include "pmbus.h"
#include "plat_gpio.h"
#include "plat_pldm_sensor.h"
#include "mp2971.h"
#include "mp29816a.h"
#include "raa228249.h"
#include "plat_user_setting.h"
#include "plat_fru.h"
#include "plat_class.h"
#include "plat_i2c_target.h"
#include "shell_plat_average_power.h"
#include "plat_ioexp.h"
Include dependency graph for plat_hook.c:

Macros

#define EEPROM_MAX_WRITE_TIME   5
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool post_sensor_reading_hook_func (uint8_t sensor_number)
 
void * vr_mutex_get (enum VR_INDEX_E vr_index)
 
bool pre_vr_read (sensor_cfg *cfg, void *args)
 
bool post_common_sensor_read (sensor_cfg *cfg, void *args, int *const reading)
 
bool is_mb_dc_on ()
 
void vr_mutex_init (void)
 
bool vr_rail_name_get (uint8_t rail, uint8_t **name)
 
bool vr_status_name_get (uint8_t rail, uint8_t **name)
 
bool vr_rail_enum_get (uint8_t *name, uint8_t *num)
 
bool vr_status_enum_get (uint8_t *name, uint8_t *num)
 
bool plat_get_vr_status (uint8_t rail, uint8_t vr_status_rail, uint16_t *vr_status)
 
bool plat_clear_vr_status (uint8_t rail)
 
bool plat_get_vout_command (uint8_t rail, uint16_t *millivolt)
 
bool vr_vout_user_settings_set (void *user_settings_value)
 
bool plat_set_vout_command (uint8_t rail, uint16_t *millivolt, bool is_default, bool is_perm)
 
bool vr_rail_voltage_peak_get (uint8_t *name, int *peak_value)
 
bool vr_rail_voltage_peak_clear (uint8_t rail_index)
 
bool plat_set_vout_range_min (uint8_t rail, uint16_t *millivolt)
 
bool plat_set_vout_range_max (uint8_t rail, uint16_t *millivolt)
 
bool vr_vout_default_settings_init (void)
 
bool vr_vout_user_settings_init (void)
 
bool plat_get_vout_range (uint8_t rail, uint16_t *vout_max_millivolt, uint16_t *vout_min_millivolt)
 
bool vr_vout_user_settings_get (void *user_settings)
 
bool vr_vout_range_user_settings_init (void)
 
bool temp_threshold_user_settings_get (void *temp_threshold_user_settings)
 
bool set_bootstrap_table_val_to_ioexp (void)
 
bool set_ioexp_val_to_bootstrap_table (void)
 
bool bootstrap_default_settings_init (void)
 
bool bootstrap_user_settings_get (void *bootstrap_user_settings)
 
bool bootstrap_user_settings_set (void *bootstrap_user_settings)
 
bool check_is_bootstrap_setting_value_valid (uint8_t rail, uint8_t value)
 
bool find_bootstrap_by_rail (uint8_t rail, bootstrap_mapping_register *result)
 
bool get_bootstrap_change_drive_level (int rail, int *drive_level)
 
bool strap_enum_get (uint8_t *name, uint8_t *num)
 
bool set_bootstrap_table_and_user_settings (uint8_t rail, uint8_t *change_setting_value, uint8_t drive_index_level, bool is_perm, bool is_default)
 
bool set_bootstrap_val_to_device (uint8_t strap, uint8_t val)
 
bool bootstrap_user_settings_init (void)
 
bool strap_name_get (uint8_t rail, uint8_t **name)
 
void plat_pldm_sensor_post_load_init (int thread_id)
 
bool voltage_command_setting_get (uint8_t rail, uint16_t *vout)
 
uint8_t get_strap_index_max ()
 

Variables

vr_pre_proc_arg vr_pre_read_args []
 
mp2971_init_arg mp2971_init_args []
 
mpc12109_init_arg mpc12109_init_args []
 
vr_mapping_sensor vr_rail_table []
 
vr_mapping_status vr_status_table []
 
bootstrap_mapping_register bootstrap_table []
 
vr_vout_user_settings user_settings = { 0 }
 
struct vr_vout_user_settings default_settings = { 0 }
 
struct vr_vout_user_settings voltage_command_get = { 0 }
 
vr_vout_range_user_settings_struct vout_range_user_settings = { 0 }
 
bootstrap_user_settings_struct bootstrap_user_settings = { 0 }
 

Macro Definition Documentation

◆ EEPROM_MAX_WRITE_TIME

#define EEPROM_MAX_WRITE_TIME   5

Function Documentation

◆ bootstrap_default_settings_init()

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

◆ bootstrap_user_settings_get()

bool bootstrap_user_settings_get ( void *  bootstrap_user_settings)
Here is the call graph for this function:

◆ bootstrap_user_settings_init()

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

◆ bootstrap_user_settings_set()

bool bootstrap_user_settings_set ( void *  bootstrap_user_settings)
Here is the call graph for this function:

◆ check_is_bootstrap_setting_value_valid()

bool check_is_bootstrap_setting_value_valid ( uint8_t  rail,
uint8_t  value 
)

◆ find_bootstrap_by_rail()

bool find_bootstrap_by_rail ( uint8_t  rail,
bootstrap_mapping_register result 
)
Here is the call graph for this function:

◆ get_bootstrap_change_drive_level()

bool get_bootstrap_change_drive_level ( int  rail,
int *  drive_level 
)
Here is the call graph for this function:

◆ get_strap_index_max()

uint8_t get_strap_index_max ( )
Here is the call graph for this function:

◆ is_mb_dc_on()

bool is_mb_dc_on ( )
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ plat_clear_vr_status()

bool plat_clear_vr_status ( uint8_t  rail)
Here is the call graph for this function:

◆ plat_get_vout_command()

bool plat_get_vout_command ( uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ plat_get_vout_range()

bool plat_get_vout_range ( uint8_t  rail,
uint16_t *  vout_max_millivolt,
uint16_t *  vout_min_millivolt 
)
Here is the call graph for this function:

◆ plat_get_vr_status()

bool plat_get_vr_status ( uint8_t  rail,
uint8_t  vr_status_rail,
uint16_t *  vr_status 
)
Here is the call graph for this function:

◆ plat_pldm_sensor_post_load_init()

void plat_pldm_sensor_post_load_init ( int  thread_id)

◆ plat_set_vout_command()

bool plat_set_vout_command ( uint8_t  rail,
uint16_t *  millivolt,
bool  is_default,
bool  is_perm 
)
Here is the call graph for this function:

◆ plat_set_vout_range_max()

bool plat_set_vout_range_max ( uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ plat_set_vout_range_min()

bool plat_set_vout_range_min ( uint8_t  rail,
uint16_t *  millivolt 
)
Here is the call graph for this function:

◆ post_common_sensor_read()

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

◆ post_sensor_reading_hook_func()

bool post_sensor_reading_hook_func ( uint8_t  sensor_number)
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:

◆ set_bootstrap_table_and_user_settings()

bool set_bootstrap_table_and_user_settings ( uint8_t  rail,
uint8_t *  change_setting_value,
uint8_t  drive_index_level,
bool  is_perm,
bool  is_default 
)
Here is the call graph for this function:

◆ set_bootstrap_table_val_to_ioexp()

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

◆ set_bootstrap_val_to_device()

bool set_bootstrap_val_to_device ( uint8_t  strap,
uint8_t  val 
)
Here is the call graph for this function:

◆ set_ioexp_val_to_bootstrap_table()

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

◆ strap_enum_get()

bool strap_enum_get ( uint8_t *  name,
uint8_t *  num 
)
Here is the call graph for this function:

◆ strap_name_get()

bool strap_name_get ( uint8_t  rail,
uint8_t **  name 
)
Here is the call graph for this function:

◆ temp_threshold_user_settings_get()

bool temp_threshold_user_settings_get ( void *  temp_threshold_user_settings)
Here is the call graph for this function:

◆ voltage_command_setting_get()

bool voltage_command_setting_get ( uint8_t  rail,
uint16_t *  vout 
)

◆ vr_mutex_get()

void * vr_mutex_get ( enum VR_INDEX_E  vr_index)

◆ vr_mutex_init()

void vr_mutex_init ( void  )

◆ vr_rail_enum_get()

bool vr_rail_enum_get ( uint8_t *  name,
uint8_t *  num 
)

◆ vr_rail_name_get()

bool vr_rail_name_get ( uint8_t  rail,
uint8_t **  name 
)

◆ vr_rail_voltage_peak_clear()

bool vr_rail_voltage_peak_clear ( uint8_t  rail_index)

◆ vr_rail_voltage_peak_get()

bool vr_rail_voltage_peak_get ( uint8_t *  name,
int *  peak_value 
)

◆ vr_status_enum_get()

bool vr_status_enum_get ( uint8_t *  name,
uint8_t *  num 
)

◆ vr_status_name_get()

bool vr_status_name_get ( uint8_t  rail,
uint8_t **  name 
)

◆ vr_vout_default_settings_init()

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

◆ vr_vout_range_user_settings_init()

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

◆ vr_vout_user_settings_get()

bool vr_vout_user_settings_get ( void *  user_settings)
Here is the call graph for this function:

◆ vr_vout_user_settings_init()

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

◆ vr_vout_user_settings_set()

bool vr_vout_user_settings_set ( void *  user_settings_value)
Here is the call graph for this function:

Variable Documentation

◆ bootstrap_table

bootstrap_mapping_register bootstrap_table[]

◆ bootstrap_user_settings

bootstrap_user_settings_struct bootstrap_user_settings = { 0 }

◆ default_settings

struct vr_vout_user_settings default_settings = { 0 }

◆ mp2971_init_args

Initial value:
= {
[0] = { .vout_scale_enable = true },
}

◆ mpc12109_init_args

Initial value:
= {
[0] = { .iout_lsb = 0.5, .pout_lsb = 2 },
}

◆ user_settings

vr_vout_user_settings user_settings = { 0 }

◆ voltage_command_get

struct vr_vout_user_settings voltage_command_get = { 0 }

◆ vout_range_user_settings

vr_vout_range_user_settings_struct vout_range_user_settings = { 0 }

◆ vr_pre_read_args

vr_pre_proc_arg vr_pre_read_args[]
Initial value:
= {
{ .mutex = vr_mutex + 0, .vr_page = 0x0 }, { .mutex = vr_mutex + 0, .vr_page = 0x1 },
{ .mutex = vr_mutex + 1, .vr_page = 0x0 }, { .mutex = vr_mutex + 1, .vr_page = 0x1 },
{ .mutex = vr_mutex + 2, .vr_page = 0x0 }, { .mutex = vr_mutex + 2, .vr_page = 0x1 },
{ .mutex = vr_mutex + 3, .vr_page = 0x0 }, { .mutex = vr_mutex + 3, .vr_page = 0x1 },
{ .mutex = vr_mutex + 4, .vr_page = 0x0 }, { .mutex = vr_mutex + 4, .vr_page = 0x1 },
{ .mutex = vr_mutex + 5, .vr_page = 0x0 }, { .mutex = vr_mutex + 5, .vr_page = 0x1 },
{ .mutex = vr_mutex + 6, .vr_page = 0x0 }, { .mutex = vr_mutex + 6, .vr_page = 0x1 },
{ .mutex = vr_mutex + 7, .vr_page = 0x0 }, { .mutex = vr_mutex + 7, .vr_page = 0x1 },
{ .mutex = vr_mutex + 8, .vr_page = 0x0 }, { .mutex = vr_mutex + 8, .vr_page = 0x1 },
{ .mutex = vr_mutex + 9, .vr_page = 0x0 }, { .mutex = vr_mutex + 9, .vr_page = 0x1 },
{ .mutex = vr_mutex + 10, .vr_page = 0x0 }, { .mutex = vr_mutex + 10, .vr_page = 0x1 },
{ .mutex = vr_mutex + 11, .vr_page = 0x0 }, { .mutex = vr_mutex + 11, .vr_page = 0x1 },
{ .mutex = vr_mutex + 12, .vr_page = 0x0 }, { .mutex = vr_mutex + 12, .vr_page = 0x1 },
}

◆ vr_rail_table

vr_mapping_sensor vr_rail_table[]

◆ vr_status_table

vr_mapping_status vr_status_table[]
Initial value:
= {
{ VR_STAUS_E_STATUS_CML, PMBUS_STATUS_CML, "STATUS_CML_PMBUS" },
}
@ VR_STAUS_E_STATUS_INPUT
Definition: plat_hook.h:81
@ VR_STAUS_E_STATUS_IOUT
Definition: plat_hook.h:80
@ VR_STAUS_E_STATUS_CML
Definition: plat_hook.h:83
@ VR_STAUS_E_STATUS_BYTE
Definition: plat_hook.h:77
@ VR_STAUS_E_STATUS_TEMPERATURE
Definition: plat_hook.h:82
@ VR_STAUS_E_STATUS_VOUT
Definition: plat_hook.h:79
@ VR_STAUS_E_STATUS_WORD
Definition: plat_hook.h:78
@ PMBUS_STATUS_WORD
Definition: pmbus.h:102
@ PMBUS_STATUS_IOUT
Definition: pmbus.h:104
@ PMBUS_STATUS_BYTE
Definition: pmbus.h:101
@ PMBUS_STATUS_CML
Definition: pmbus.h:107
@ PMBUS_STATUS_TEMPERATURE
Definition: pmbus.h:106
@ PMBUS_STATUS_VOUT
Definition: pmbus.h:103
@ PMBUS_STATUS_INPUT
Definition: pmbus.h:105