OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 "plat_isr.h"
Include dependency graph for plat_event.c:

Classes

struct  _vr_error_callback_info_
 

Macros

#define CPLD_POLLING_INTERVAL_MS   1000
 
#define AEGIS_CPLD_ADDR   (0x4C >> 1)
 

Typedefs

typedef struct _vr_error_callback_info_ vr_error_callback_info
 

Functions

 LOG_MODULE_REGISTER (plat_event)
 
void check_cpld_handler ()
 
 K_WORK_DELAYABLE_DEFINE (check_cpld_work, check_cpld_handler)
 
 K_TIMER_DEFINE (init_ubc_delayed_timer, check_ubc_delayed_timer_handler, NULL)
 
 K_WORK_DEFINE (check_ubc_delayed_work, check_ubc_delayed)
 
void check_ubc_delayed_timer_handler (struct k_timer *timer)
 
 K_THREAD_STACK_DEFINE (cpld_polling_stack, POLLING_CPLD_STACK_SIZE)
 
void get_vr_vout_handler (struct k_work *work)
 
 K_WORK_DEFINE (vr_vout_work, get_vr_vout_handler)
 
bool vr_error_callback (aegis_cpld_info *cpld_info, uint8_t *current_cpld_value)
 
const char * get_cpld_reg_name (uint8_t cpld_offset)
 
const char * get_cpld_bit_name (uint8_t cpld_offset, uint8_t bit_pos)
 
void check_cpld_polling_alert_status (void)
 
void set_cpld_polling_enable_flag (bool status)
 
bool get_cpld_polling_enable_flag (void)
 
void check_ubc_delayed (struct k_work *work)
 
bool is_ubc_enabled_delayed_enabled (void)
 
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 []
 
const cpld_bit_name_table_t cpld_bit_name_table []
 
bool cpld_polling_alert_status = false
 
bool cpld_polling_enable_flag = true
 
bool ubc_enabled_delayed_status = false
 

Macro Definition Documentation

◆ AEGIS_CPLD_ADDR

#define AEGIS_CPLD_ADDR   (0x4C >> 1)

◆ CPLD_POLLING_INTERVAL_MS

#define CPLD_POLLING_INTERVAL_MS   1000

Typedef Documentation

◆ vr_error_callback_info

Function Documentation

◆ check_cpld_handler()

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

◆ check_cpld_polling_alert_status()

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

◆ check_ubc_delayed()

void check_ubc_delayed ( struct k_work *  work)
Here is the call graph for this function:

◆ check_ubc_delayed_timer_handler()

void check_ubc_delayed_timer_handler ( struct k_timer *  timer)

◆ get_cpld_bit_name()

const char * get_cpld_bit_name ( uint8_t  cpld_offset,
uint8_t  bit_pos 
)

◆ get_cpld_polling_enable_flag()

bool get_cpld_polling_enable_flag ( void  )

◆ get_cpld_reg_name()

const char * get_cpld_reg_name ( uint8_t  cpld_offset)

◆ get_vr_vout_handler()

void get_vr_vout_handler ( struct k_work *  work)
Here is the call graph for this function:

◆ init_cpld_polling()

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

◆ is_ubc_enabled_delayed_enabled()

bool is_ubc_enabled_delayed_enabled ( void  )

◆ K_THREAD_STACK_DEFINE()

K_THREAD_STACK_DEFINE ( cpld_polling_stack  ,
POLLING_CPLD_STACK_SIZE   
)

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( init_ubc_delayed_timer  ,
check_ubc_delayed_timer_handler  ,
NULL   
)

◆ K_WORK_DEFINE() [1/2]

K_WORK_DEFINE ( check_ubc_delayed_work  ,
check_ubc_delayed   
)

◆ K_WORK_DEFINE() [2/2]

K_WORK_DEFINE ( vr_vout_work  ,
get_vr_vout_handler   
)

◆ K_WORK_DELAYABLE_DEFINE()

K_WORK_DELAYABLE_DEFINE ( check_cpld_work  ,
check_cpld_handler   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_event  )

◆ poll_cpld_registers()

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

◆ set_cpld_polling_enable_flag()

void set_cpld_polling_enable_flag ( 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 },
{ TEMPERATURE_IC_OVERT_FAULT_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 },
{ TEMPERATURE_IC_OVERT_FAULT_2_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ ASIC_OC_WARN_2_REG, 0xDF, 0xDF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ SYSTEM_ALERT_FAULT_2_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_SMBUS_ALERT_3_REG, 0xFF, 0xFF, true, 0x00, false, false, 0x00, .status_changed_cb = vr_error_callback },
{ VR_SMBUS_ALERT_4_REG, 0xFF, 0xFF, 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:364
#define VR_POWER_FAULT_5_REG
Definition: plat_event.h:122
#define VR_POWER_FAULT_4_REG
Definition: plat_event.h:121
#define TEMPERATURE_IC_OVERT_FAULT_2_REG
Definition: plat_event.h:175
#define VR_SMBUS_ALERT_3_REG
Definition: plat_event.h:178
#define VR_POWER_FAULT_1_REG
Definition: plat_event.h:118
#define VR_SMBUS_ALERT_2_REG
Definition: plat_event.h:142
#define VR_POWER_FAULT_2_REG
Definition: plat_event.h:119
#define ASIC_OC_WARN_2_REG
Definition: plat_event.h:176
#define VR_SMBUS_ALERT_1_REG
Definition: plat_event.h:141
#define SYSTEM_ALERT_FAULT_REG
Definition: plat_event.h:145
#define ASIC_OC_WARN_REG
Definition: plat_event.h:144
#define VR_POWER_FAULT_3_REG
Definition: plat_event.h:120
#define LEAK_DETCTION_REG
Definition: plat_event.h:151
#define SYSTEM_ALERT_FAULT_2_REG
Definition: plat_event.h:177
#define VR_SMBUS_ALERT_4_REG
Definition: plat_event.h:179
#define TEMPERATURE_IC_OVERT_FAULT_REG
Definition: plat_event.h:148

◆ cpld_bit_name_table

const cpld_bit_name_table_t cpld_bit_name_table[]

◆ cpld_polling_alert_status

bool cpld_polling_alert_status = false

◆ cpld_polling_enable_flag

bool cpld_polling_enable_flag = true

◆ cpld_polling_thread

struct k_thread cpld_polling_thread

◆ cpld_polling_tid

k_tid_t cpld_polling_tid

◆ ubc_enabled_delayed_status

bool ubc_enabled_delayed_status = false