OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <string.h>
#include "libutil.h"
#include "ast_adc.h"
#include "sensor.h"
#include "hal_i2c.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_sensor_table.h"
#include "plat_hook.h"
#include "plat_event.h"
#include "plat_isr.h"
#include <logging/log.h>
#include "mp2971.h"
#include "isl69259.h"
#include "raa228249.h"
#include "tmp75.h"
#include "tmp431.h"
#include "emc1413.h"
#include "mp29816a.h"
#include "plat_pldm_sensor.h"
#include "plat_class.h"
#include "pmbus.h"
#include "plat_i2c_target.h"
#include "pldm_sensor.h"
Macros | |
#define | ALERT_LEVEL_USER_SETTINGS_OFFSET 0x8200 |
#define | EEPROM_MAX_WRITE_TIME 5 |
#define | AEGIS_CPLD_ADDR (0x4C >> 1) |
#define | VR_PRE_READ_ARG(idx) |
#define | TEMP_THRESHOLD_USER_SETTINGS_OFFSET 0x8100 |
#define | VR_VOUT_USER_SETTINGS_OFFSET 0x8000 |
#define | SOC_PCIE_PERST_USER_SETTINGS_OFFSET 0x8300 |
#define | BOOTSTRAP_USER_SETTINGS_OFFSET 0x8400 |
#define | THERMALTRIP_USER_SETTINGS_OFFSET 0x8500 |
#define | THROTTLE_USER_SETTINGS_OFFSET 0x8600 |
#define | POWER_CAPPING_USER_SETTINGS_OFFSET 0x8650 |
#define | CPLD_THERMALTRIP_SWITCH_ADDR 0x3D |
#define | CPLD_THROTTLE_SWITCH_ADDR 0x32 |
#define | PLAT_TMP432_THERM_HYSTERESIS_VAL 0x5A |
#define | PLAT_EMC1413_THERM_HYSTERESIS_VAL 0x5A |
#define | CPLD_MTIA_HC_LC_SETTING_ADDR 0x26 |
#define | MTIA_HC_LC_ENABLE 1 |
#define | MTIA_HC_LC_DISENABLE 0 |
#define AEGIS_CPLD_ADDR (0x4C >> 1) |
#define ALERT_LEVEL_USER_SETTINGS_OFFSET 0x8200 |
#define BOOTSTRAP_USER_SETTINGS_OFFSET 0x8400 |
#define CPLD_MTIA_HC_LC_SETTING_ADDR 0x26 |
#define CPLD_THERMALTRIP_SWITCH_ADDR 0x3D |
#define CPLD_THROTTLE_SWITCH_ADDR 0x32 |
#define EEPROM_MAX_WRITE_TIME 5 |
#define MTIA_HC_LC_DISENABLE 0 |
#define MTIA_HC_LC_ENABLE 1 |
#define PLAT_EMC1413_THERM_HYSTERESIS_VAL 0x5A |
#define PLAT_TMP432_THERM_HYSTERESIS_VAL 0x5A |
#define POWER_CAPPING_USER_SETTINGS_OFFSET 0x8650 |
#define SOC_PCIE_PERST_USER_SETTINGS_OFFSET 0x8300 |
#define TEMP_THRESHOLD_USER_SETTINGS_OFFSET 0x8100 |
#define THERMALTRIP_USER_SETTINGS_OFFSET 0x8500 |
#define THROTTLE_USER_SETTINGS_OFFSET 0x8600 |
#define VR_PRE_READ_ARG | ( | idx | ) |
#define VR_VOUT_USER_SETTINGS_OFFSET 0x8000 |
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 | ||
) |
void check_power_capping_status | ( | void | ) |
void check_power_capping_user_setting_status | ( | void | ) |
bool find_bootstrap_by_rail | ( | uint8_t | rail, |
bootstrap_mapping_register * | result | ||
) |
int get_alert_level_info | ( | bool * | is_assert, |
int32_t * | default_value, | ||
int32_t * | setting_value | ||
) |
bool get_average_power | ( | uint8_t | rail, |
uint32_t * | milliwatt | ||
) |
bool get_bootstrap_change_drive_level | ( | int | rail, |
int * | drive_level | ||
) |
bool get_temp_index_threshold_type | ( | uint8_t | temp_threshold_type, |
uint8_t | sensor_id, | ||
uint8_t * | temp_index_threshold_type | ||
) |
int get_user_settings_alert_level_from_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
bool get_user_settings_power_capping_from_eeprom | ( | void * | user_settings | ) |
bool get_user_settings_soc_pcie_perst_from_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
bool get_user_settings_thermaltrip_from_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
bool get_user_settings_throttle_from_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
void init_temp_alert_mode | ( | void | ) |
void init_temp_limit | ( | void | ) |
bool is_mb_dc_on | ( | ) |
LOG_MODULE_REGISTER | ( | plat_hook | ) |
bool perm_config_clear | ( | void | ) |
bool plat_clear_temp_status | ( | uint8_t | rail | ) |
bool plat_clear_vr_status | ( | uint8_t | rail | ) |
bool plat_get_power_capping_command | ( | uint8_t | rail, |
uint16_t * | set_value | ||
) |
bool plat_get_temp_status | ( | uint8_t | rail, |
uint8_t * | temp_status | ||
) |
bool plat_get_temp_threshold | ( | uint8_t | temp_index_threshold_type, |
uint32_t * | millidegree_celsius | ||
) |
bool plat_get_vout_command | ( | uint8_t | rail, |
uint16_t * | millivolt | ||
) |
bool plat_get_vout_range | ( | uint8_t | rail, |
uint16_t * | vout_max_millivolt, | ||
uint16_t * | vout_min_millivolt | ||
) |
bool plat_get_vr_status | ( | uint8_t | rail, |
uint8_t | vr_status_rail, | ||
uint16_t * | vr_status | ||
) |
void plat_pldm_sensor_post_load_init | ( | int | thread_id | ) |
bool plat_set_power_capping_command | ( | uint8_t | rail, |
uint16_t * | set_value, | ||
bool | is_perm | ||
) |
bool plat_set_temp_threshold | ( | uint8_t | temp_index_threshold_type, |
uint32_t * | millidegree_celsius, | ||
bool | is_default, | ||
bool | is_perm | ||
) |
bool plat_set_vout_command | ( | uint8_t | rail, |
uint16_t * | millivolt, | ||
bool | is_default, | ||
bool | is_perm | ||
) |
bool plat_set_vout_range_max | ( | uint8_t | rail, |
uint16_t * | millivolt | ||
) |
bool plat_set_vout_range_min | ( | uint8_t | rail, |
uint16_t * | millivolt | ||
) |
bool post_all_sensor_read | ( | sensor_cfg * | cfg, |
void * | args, | ||
int * | reading | ||
) |
bool post_ubc_read | ( | sensor_cfg * | cfg, |
void * | args, | ||
int * | reading | ||
) |
bool post_vr_read | ( | sensor_cfg * | cfg, |
void * | args, | ||
int *const | reading | ||
) |
void power_capping_comparator_handler | ( | ) |
bool power_capping_default_settings_init | ( | void | ) |
bool power_capping_rail_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool power_capping_rail_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
bool power_capping_user_settings_init | ( | void | ) |
int power_level_send_event | ( | bool | is_assert, |
int | ubc1_current, | ||
int | ubc2_current | ||
) |
bool pre_vr_read | ( | sensor_cfg * | cfg, |
void * | args | ||
) |
void pwr_level_mutex_init | ( | void | ) |
void set_alert_level_to_default_or_user_setting | ( | bool | is_default, |
int32_t | user_setting | ||
) |
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_HC_LC_enable_flag | ( | bool | hc_status, |
bool | lc_status | ||
) |
bool set_thermaltrip_user_settings | ( | bool | thermaltrip_enable, |
bool | is_perm | ||
) |
bool set_throttle_user_settings | ( | uint8_t * | throttle_status_reg, |
bool | is_perm | ||
) |
void set_uart_power_event_is_enable | ( | bool | is_enable | ) |
int set_user_settings_alert_level_to_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
bool set_user_settings_power_capping_to_eeprom | ( | void * | power_capping_user_settings | ) |
bool set_user_settings_soc_pcie_perst_to_eeprom | ( | void * | user_settings, |
uint8_t | data_length | ||
) |
bool set_user_settings_thermaltrip_to_eeprom | ( | void * | thermaltrip_user_settings, |
uint8_t | data_length | ||
) |
bool set_user_settings_throttle_to_eeprom | ( | void * | throttle_user_settings, |
uint8_t | data_length | ||
) |
bool strap_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool strap_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
bool temp_index_threshold_type_name_get | ( | uint8_t | type, |
uint8_t ** | name | ||
) |
bool temp_sensor_rail_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool temp_sensor_rail_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
bool temp_threshold_type_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool temp_threshold_user_settings_get | ( | void * | temp_threshold_user_settings | ) |
bool temp_threshold_user_settings_set | ( | void * | temp_threshold_user_settings | ) |
bool ubc_vr_rail_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool ubc_vr_rail_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
void update_comparator_counter_max | ( | void | ) |
void user_settings_init | ( | void | ) |
bool voltage_command_setting_get | ( | uint8_t | rail, |
uint16_t * | vout | ||
) |
void * vr_mutex_get | ( | enum VR_INDEX_E | vr_index | ) |
void vr_mutex_init | ( | void | ) |
bool vr_rail_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool vr_rail_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
bool vr_rail_voltage_peak_clear | ( | uint8_t | rail_index | ) |
bool vr_rail_voltage_peak_get | ( | uint8_t * | name, |
int * | peak_value | ||
) |
bool vr_status_enum_get | ( | uint8_t * | name, |
uint8_t * | num | ||
) |
bool vr_status_name_get | ( | uint8_t | rail, |
uint8_t ** | name | ||
) |
bool vr_vout_default_settings_init | ( | void | ) |
bool vr_vout_user_settings_get | ( | void * | user_settings | ) |
bool vr_vout_user_settings_init | ( | void | ) |
bool vr_vout_user_settings_set | ( | void * | user_settings | ) |
bool alert_level_is_assert = false |
int32_t alert_level_mA_default = 110000 |
int32_t alert_level_mA_user_setting = 110000 |
int ath_vdd_polling_counter = 0 |
uint16_t ath_vdd_power = 0 |
bootstrap_mapping_register bootstrap_table[] |
bootstrap_user_settings_struct bootstrap_user_settings = { 0 } |
int comparator_counter_max = 0 |
struct vr_vout_user_settings default_settings = { 0 } |
bool power_capping_enable_flag = false |
power_capping_mapping_sensor power_capping_rail_table[] |
bool power_capping_user_setting_flag = false |
power_capping_user_settings_struct power_capping_user_settings = { 0 } |
power_sequence power_sequence_off_table[] |
size_t power_sequence_off_table_size = ARRAY_SIZE(power_sequence_off_table) |
power_sequence power_sequence_on_table[] |
size_t power_sequence_on_table_size = ARRAY_SIZE(power_sequence_on_table) |
temp_mapping_sensor temp_index_table[] |
temp_threshold_mapping_sensor temp_index_threshold_type_table[] |
struct temp_threshold_user_settings_struct temp_threshold_default_settings = { 0 } |
temp_threshold_user_settings_struct temp_threshold_user_settings = { 0 } |
thermaltrip_user_settings_struct thermaltrip_user_settings = { 0xFF } |
throttle_user_settings_struct throttle_user_settings = { 0xFF } |
ubc_vr_power_mapping_sensor ubc_vr_power_table[] |
vr_vout_user_settings user_settings = { 0 } |
struct vr_vout_user_settings voltage_command_get = { 0 } |
vr_vout_range_user_settings_struct vout_range_user_settings = { 0 } |
vr_pre_proc_arg vr_pre_read_args[] |
vr_mapping_sensor vr_rail_table[] |
vr_mapping_status vr_status_table[] |