OpenBIC
OpenSource Bridge-IC
plat_event.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <logging/log.h>
#include "libutil.h"
#include "plat_i2c.h"
#include "plat_class.h"
#include "plat_pldm_sensor.h"
#include "plat_gpio.h"
#include "plat_log.h"
#include "plat_event.h"
#include "plat_hook.h"
Include dependency graph for plat_event.c:

Classes

struct  _vr_error_callback_info_
 

Macros

#define CPLD_POLLING_INTERVAL_MS   1000
 

Typedefs

typedef struct _vr_error_callback_info_ vr_error_callback_info
 

Functions

 LOG_MODULE_REGISTER (plat_event)
 
 K_THREAD_STACK_DEFINE (cpld_polling_stack, POLLING_CPLD_STACK_SIZE)
 
bool vr_error_callback (aegis_cpld_info *cpld_info, uint8_t *current_cpld_value)
 
void set_dc_status_changing_status (bool status)
 
void check_ubc_delayed (struct k_timer *timer)
 
void poll_cpld_registers ()
 
void init_cpld_polling (void)
 

Variables

struct k_thread cpld_polling_thread
 
k_tid_t cpld_polling_tid
 
aegis_cpld_info aegis_cpld_info_table []
 
bool ubc_enabled_delayed_status = false
 
bool is_dc_status_changing = false
 

Macro Definition Documentation

◆ CPLD_POLLING_INTERVAL_MS

#define CPLD_POLLING_INTERVAL_MS   1000

Typedef Documentation

◆ vr_error_callback_info

Function Documentation

◆ check_ubc_delayed()

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

◆ init_cpld_polling()

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

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( cpld_polling_stack  ,
POLLING_CPLD_STACK_SIZE   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_event  )

◆ poll_cpld_registers()

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

◆ set_dc_status_changing_status()

void set_dc_status_changing_status ( bool  status)

◆ vr_error_callback()

bool vr_error_callback ( aegis_cpld_info cpld_info,
uint8_t *  current_cpld_value 
)
Here is the call graph for this function:

Variable Documentation

◆ aegis_cpld_info_table

aegis_cpld_info aegis_cpld_info_table[]
Initial value:
= {
{ VR_POWER_FAULT_1_REG, 0x00, 0x00, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_FAULT_2_REG, 0x00, 0x00, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_FAULT_3_REG, 0x00, 0x00, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_FAULT_4_REG, 0x00, 0x00, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_FAULT_5_REG, 0x00, 0x00, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_SMBUS_ALERT_1_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_SMBUS_ALERT_2_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ ASIC_OC_WARN_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ SYSTEM_ALERT_FAULT_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_HOT_FAULT_1_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_HOT_FAULT_2_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ TEMPERATURE_IC_OVERT_FAULT_REG, 0xBF, 0xBF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_INPUT_FAULT_1_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_POWER_INPUT_FAULT_2_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ LEAK_DETCTION_REG, 0xDF, 0xDF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
}
bool vr_error_callback(aegis_cpld_info *cpld_info, uint8_t *current_cpld_value)
Definition: plat_event.c:86
#define VR_POWER_FAULT_5_REG
Definition: plat_event.h:39
#define VR_POWER_INPUT_FAULT_1_REG
Definition: plat_event.h:66
#define VR_POWER_FAULT_4_REG
Definition: plat_event.h:38
#define VR_POWER_FAULT_1_REG
Definition: plat_event.h:35
#define VR_POWER_INPUT_FAULT_2_REG
Definition: plat_event.h:67
#define VR_SMBUS_ALERT_2_REG
Definition: plat_event.h:59
#define VR_POWER_FAULT_2_REG
Definition: plat_event.h:36
#define VR_SMBUS_ALERT_1_REG
Definition: plat_event.h:58
#define SYSTEM_ALERT_FAULT_REG
Definition: plat_event.h:62
#define VR_HOT_FAULT_1_REG
Definition: plat_event.h:63
#define ASIC_OC_WARN_REG
Definition: plat_event.h:61
#define VR_POWER_FAULT_3_REG
Definition: plat_event.h:37
#define VR_HOT_FAULT_2_REG
Definition: plat_event.h:64
#define LEAK_DETCTION_REG
Definition: plat_event.h:68
#define TEMPERATURE_IC_OVERT_FAULT_REG
Definition: plat_event.h:65

◆ cpld_polling_thread

struct k_thread cpld_polling_thread

◆ cpld_polling_tid

k_tid_t cpld_polling_tid

◆ is_dc_status_changing

bool is_dc_status_changing = false

◆ ubc_enabled_delayed_status

bool ubc_enabled_delayed_status = false