OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plat_hwmon.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "plat_i2c.h"
#include "sensor.h"
#include <logging/log.h>
#include <sys/util.h>
#include "plat_sensor_table.h"
#include "plat_modbus.h"
#include "modbus_server.h"
#include "plat_hwmon.h"
#include "adm1272.h"
#include "plat_log.h"
#include "plat_hook.h"
#include "plat_pwm.h"
#include "plat_status.h"
#include "plat_isr.h"
#include "plat_fru.h"
#include "plat_fsc.h"
Include dependency graph for plat_hwmon.c:

Macros

#define PUMP_RESET_FUNCTIONS(num)
 
#define TURN_OFF_HSC_OUTPUT   0
 
#define TURN_ON_HSC_OUTPUT   1
 
#define FAN_BORAD_COUNT_NUM   14
 
#define PUMP_BORAD_COUNT_NUM   17
 
#define BACKPLANE_BORAD_COUNT_NUM   18
 
#define BRIDGE_BORAD_COUNT_NUM   19
 

Functions

 LOG_MODULE_REGISTER (plat_hwmon)
 
bool modbus_pump_setting_unsupport_function (pump_reset_struct *data, uint8_t bit_val)
 
 K_WORK_DEFINE (clear_log_work, modbus_clear_log)
 
bool clear_log_for_modbus_pump_setting (pump_reset_struct *data, uint8_t bit_val)
 
bool close_pump (pump_reset_struct *data, uint8_t bit_val)
 
bool pump_setting_set_manual_flag (pump_reset_struct *data, uint8_t bit_val)
 
bool pump_setting_set_auto_tune_flag (pump_reset_struct *data, uint8_t bit_val)
 
bool pump_setting_set_pump_redundant (pump_reset_struct *data, uint8_t bit_val)
 
bool set_all_pump_power (bool switch_val)
 
void hsc_adm1272_pwr_ctrl (sensor_cfg *cfg, uint8_t adm1272_reg, uint8_t state)
 
void hsc_xdp710_pwr_ctrl (sensor_cfg *cfg, uint8_t xdp710_reg, uint8_t state)
 
void rpu_remote_power_cycle ()
 
 K_WORK_DEFINE (rpu_pwr_cycle_work, rpu_remote_power_cycle)
 
bool rpu_remote_power_cycle_function (pump_reset_struct *data, uint8_t bit_val)
 
void pump_redundant_handler (struct k_timer *timer)
 
void pump_redundant_handler_disable (struct k_timer *timer)
 
 K_TIMER_DEFINE (pump_redundant_timer, pump_redundant_handler, pump_redundant_handler_disable)
 
uint8_t get_pump_redundant_switch_time ()
 
void set_pump_redundant_switch_time (uint8_t time)
 
void set_pump_redundant_switch_time_type (uint8_t type)
 
void pump_redundant_enable (uint8_t onoff)
 
uint8_t pwm_control (uint8_t group, uint8_t duty)
 
bool get_pump_last_switch_time (uint8_t pump_num, uint32_t *return_uptime)
 
bool get_pump_current_boot_unrunning_time (uint8_t pump_num, uint32_t *return_uptime)
 
bool read_pump_running_time_data_from_eeprom (uint8_t pump_num, uint32_t *return_data)
 
bool get_pump_uptime_secs (uint8_t pump_num, uint32_t *return_uptime)
 
bool set_pump_uptime_secs (uint8_t pump_1_set, uint8_t pump_2_set, uint8_t pump_3_set)
 
bool modbus_clear_pump_running_time_function (pump_reset_struct *data, uint8_t bit_val)
 

Variables

uint8_t hsc_pwe_cycle_tbl []
 
pump_running_time pump_running_time_info []
 

Macro Definition Documentation

◆ BACKPLANE_BORAD_COUNT_NUM

#define BACKPLANE_BORAD_COUNT_NUM   18

◆ BRIDGE_BORAD_COUNT_NUM

#define BRIDGE_BORAD_COUNT_NUM   19

◆ FAN_BORAD_COUNT_NUM

#define FAN_BORAD_COUNT_NUM   14

◆ PUMP_BORAD_COUNT_NUM

#define PUMP_BORAD_COUNT_NUM   17

◆ PUMP_RESET_FUNCTIONS

#define PUMP_RESET_FUNCTIONS (   num)
Value:
static void pump##num##_reset() \
{ \
hsc_reset(SENSOR_NUM_PB_##num##_HSC_P48V_PIN_PWR_W); \
} \
K_WORK_DEFINE(pump##num##_reset_work, pump##num##_reset); \
bool pump_setting_pump##num##_reset(pump_reset_struct *data, uint8_t bit_val) \
{ \
CHECK_NULL_ARG_WITH_RETURN(data, false); \
if (bit_val == 0) \
return true; \
k_work_submit(&pump##num##_reset_work); \
return true; \
}
uint8_t data[]
Definition: isl69259.c:2
Definition: plat_hwmon.h:33

◆ TURN_OFF_HSC_OUTPUT

#define TURN_OFF_HSC_OUTPUT   0

◆ TURN_ON_HSC_OUTPUT

#define TURN_ON_HSC_OUTPUT   1

Function Documentation

◆ clear_log_for_modbus_pump_setting()

bool clear_log_for_modbus_pump_setting ( pump_reset_struct data,
uint8_t  bit_val 
)

◆ close_pump()

bool close_pump ( pump_reset_struct data,
uint8_t  bit_val 
)
Here is the call graph for this function:

◆ get_pump_current_boot_unrunning_time()

bool get_pump_current_boot_unrunning_time ( uint8_t  pump_num,
uint32_t *  return_uptime 
)

◆ get_pump_last_switch_time()

bool get_pump_last_switch_time ( uint8_t  pump_num,
uint32_t *  return_uptime 
)

◆ get_pump_redundant_switch_time()

uint8_t get_pump_redundant_switch_time ( )

◆ get_pump_uptime_secs()

bool get_pump_uptime_secs ( uint8_t  pump_num,
uint32_t *  return_uptime 
)
Here is the call graph for this function:

◆ hsc_adm1272_pwr_ctrl()

void hsc_adm1272_pwr_ctrl ( sensor_cfg cfg,
uint8_t  adm1272_reg,
uint8_t  state 
)
Here is the call graph for this function:

◆ hsc_xdp710_pwr_ctrl()

void hsc_xdp710_pwr_ctrl ( sensor_cfg cfg,
uint8_t  xdp710_reg,
uint8_t  state 
)
Here is the call graph for this function:

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( pump_redundant_timer  ,
pump_redundant_handler  ,
pump_redundant_handler_disable   
)

◆ K_WORK_DEFINE() [1/2]

K_WORK_DEFINE ( clear_log_work  ,
modbus_clear_log   
)

◆ K_WORK_DEFINE() [2/2]

K_WORK_DEFINE ( rpu_pwr_cycle_work  ,
rpu_remote_power_cycle   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hwmon  )

◆ modbus_clear_pump_running_time_function()

bool modbus_clear_pump_running_time_function ( pump_reset_struct data,
uint8_t  bit_val 
)
Here is the call graph for this function:

◆ modbus_pump_setting_unsupport_function()

bool modbus_pump_setting_unsupport_function ( pump_reset_struct data,
uint8_t  bit_val 
)

◆ pump_redundant_enable()

void pump_redundant_enable ( uint8_t  onoff)
Here is the call graph for this function:

◆ pump_redundant_handler()

void pump_redundant_handler ( struct k_timer *  timer)

◆ pump_redundant_handler_disable()

void pump_redundant_handler_disable ( struct k_timer *  timer)
Here is the call graph for this function:

◆ pump_setting_set_auto_tune_flag()

bool pump_setting_set_auto_tune_flag ( pump_reset_struct data,
uint8_t  bit_val 
)
Here is the call graph for this function:

◆ pump_setting_set_manual_flag()

bool pump_setting_set_manual_flag ( pump_reset_struct data,
uint8_t  bit_val 
)
Here is the call graph for this function:

◆ pump_setting_set_pump_redundant()

bool pump_setting_set_pump_redundant ( pump_reset_struct data,
uint8_t  bit_val 
)
Here is the call graph for this function:

◆ pwm_control()

uint8_t pwm_control ( uint8_t  group,
uint8_t  duty 
)
Here is the call graph for this function:

◆ read_pump_running_time_data_from_eeprom()

bool read_pump_running_time_data_from_eeprom ( uint8_t  pump_num,
uint32_t *  return_data 
)
Here is the call graph for this function:

◆ rpu_remote_power_cycle()

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

◆ rpu_remote_power_cycle_function()

bool rpu_remote_power_cycle_function ( pump_reset_struct data,
uint8_t  bit_val 
)

◆ set_all_pump_power()

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

◆ set_pump_redundant_switch_time()

void set_pump_redundant_switch_time ( uint8_t  time)

◆ set_pump_redundant_switch_time_type()

void set_pump_redundant_switch_time_type ( uint8_t  type)

◆ set_pump_uptime_secs()

bool set_pump_uptime_secs ( uint8_t  pump_1_set,
uint8_t  pump_2_set,
uint8_t  pump_3_set 
)
Here is the call graph for this function:

Variable Documentation

◆ hsc_pwe_cycle_tbl

uint8_t hsc_pwe_cycle_tbl[]
Initial value:
= {
}
#define SENSOR_NUM_FB_4_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:85
#define SENSOR_NUM_FB_1_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:73
#define SENSOR_NUM_PB_3_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:137
#define SENSOR_NUM_BPB_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:145
#define SENSOR_NUM_FB_8_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:101
#define SENSOR_NUM_FB_12_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:117
#define SENSOR_NUM_FB_3_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:81
#define SENSOR_NUM_FB_14_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:125
#define SENSOR_NUM_FB_11_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:113
#define SENSOR_NUM_FB_10_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:109
#define SENSOR_NUM_PB_2_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:133
#define SENSOR_NUM_FB_5_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:89
#define SENSOR_NUM_FB_13_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:121
#define SENSOR_NUM_FB_9_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:105
#define SENSOR_NUM_FB_2_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:77
#define SENSOR_NUM_FB_6_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:93
#define SENSOR_NUM_BB_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:141
#define SENSOR_NUM_FB_7_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:97
#define SENSOR_NUM_PB_1_HSC_P48V_VIN_VOLT_V
Definition: plat_sensor_table.h:129

◆ pump_running_time_info

pump_running_time pump_running_time_info[]
Initial value:
= {
}
#define EEPROM_PUMP1_UPTIME_OFFSET
Definition: plat_fru.h:83
#define EEPROM_PUMP2_UPTIME_OFFSET
Definition: plat_fru.h:86
#define EEPROM_PUMP3_UPTIME_OFFSET
Definition: plat_fru.h:89
#define EEPROM_PUMP2_UPTIME_SIZE
Definition: plat_fru.h:87
#define EEPROM_PUMP3_UPTIME_SIZE
Definition: plat_fru.h:90
#define EEPROM_PUMP1_UPTIME_SIZE
Definition: plat_fru.h:84
@ PUMP_1_UPTIME
Definition: plat_hwmon.h:40
@ PUMP_3_UPTIME
Definition: plat_hwmon.h:42
@ PUMP_2_UPTIME
Definition: plat_hwmon.h:41