OpenBIC
OpenSource Bridge-IC
plat_isr.c File Reference
#include <logging/log.h>
#include "ipmi.h"
#include "ipmb.h"
#include "pldm.h"
#include "libipmi.h"
#include "plat_isr.h"
#include "plat_gpio.h"
#include "plat_mctp.h"
#include "plat_ipmi.h"
#include "plat_class.h"
#include "util_worker.h"
#include "plat_sensor_table.h"
#include "plat_dev.h"
#include "plat_pldm_monitor.h"
#include "xdpe15284.h"
#include "q50sn120a1.h"
#include "pmbus.h"
Include dependency graph for plat_isr.c:

Classes

struct  _alert_sensor_info
 
struct  _alert_event_cfg
 

Macros

#define VR_WRITE_RETRY_MAX_COUNT   5
 
#define ALERT_EVENT_DEFAULT_DELAY_MS   0
 
#define POWER_BRICK_ALERT_DELAY_MS   400
 
#define NORMAL_POWER_GOOD_CHECK_DELAY_MS   5000
 
#define ISR_SENSOR_ALERT(device, gpio_pin_name, board_id)
 

Typedefs

typedef struct _alert_sensor_info alert_sensor_info
 
typedef struct _alert_event_cfg alert_event_cfg
 

Functions

 LOG_MODULE_REGISTER (plat_isr)
 
void check_accl_card_pwr_good_work_handler ()
 
add_sel_infoget_addsel_work (uint8_t gpio_num)
 
 K_WORK_DELAYABLE_DEFINE (fio_power_button_work, fio_power_button_work_handler)
 
void fio_power_button_work_handler ()
 
void vr_alert_addsel (uint8_t sensor_num, uint8_t device_type, uint8_t board_info, uint8_t event_type, uint8_t status)
 
void parse_vr_alert_event (add_sel_info *work_info)
 
void parse_power_brick_alert_event (add_sel_info *work_info)
 
void add_sel_work_handler (struct k_work *work_item)
 
 K_WORK_DELAYABLE_DEFINE (check_accl_card_pwr_good_work, check_accl_card_pwr_good_work_handler)
 
void ISR_FIO_BUTTON ()
 
void ISR_POWER_STATUS_CHANGE ()
 

Variables

alert_sensor_info vr_info []
 
alert_sensor_info power_brick_info []
 
add_sel_info add_sel_work_item []
 

Macro Definition Documentation

◆ ALERT_EVENT_DEFAULT_DELAY_MS

#define ALERT_EVENT_DEFAULT_DELAY_MS   0

◆ ISR_SENSOR_ALERT

#define ISR_SENSOR_ALERT (   device,
  gpio_pin_name,
  board_id 
)
Value:
void ISR_##device##_ALERT() \
{ \
add_sel_info *work = get_addsel_work(gpio_pin_name); \
if (work == NULL) { \
LOG_ERR("Fail to find addsel work, gpio num: %d", gpio_pin_name); \
return; \
} \
if (work->is_init != true) { \
k_work_init_delayable(&(work->add_sel_work), add_sel_work_handler); \
work->is_init = true; \
} \
work->board_info = gpio_get(board_id); \
if (gpio_get(work->gpio_num) == LOW_ACTIVE) { \
work->event_type |= PLDM_ADDSEL_ASSERT_MASK; \
} else { \
work->event_type = work->event_type & PLDM_ADDSEL_DEASSERT_MASK; \
} \
if (work->delay_ms != ALERT_EVENT_DEFAULT_DELAY_MS) { \
k_work_schedule_for_queue(&plat_work_q, &work->add_sel_work, \
K_MSEC(work->delay_ms)); \
} else { \
k_work_schedule_for_queue(&plat_work_q, &work->add_sel_work, K_NO_WAIT); \
} \
}
void add_sel_work_handler(struct k_work *work_item)
Definition: plat_isr.c:391
add_sel_info * get_addsel_work(uint8_t gpio_num)
Definition: plat_isr.c:142
#define ALERT_EVENT_DEFAULT_DELAY_MS
Definition: plat_isr.c:38
int gpio_get(uint8_t gpio_num)
Definition: hal_gpio.c:261
@ LOW_ACTIVE
Definition: hal_gpio.h:128
#define PLDM_ADDSEL_ASSERT_MASK
Definition: pldm_monitor.h:71
#define PLDM_ADDSEL_DEASSERT_MASK
Definition: pldm_monitor.h:72
struct k_work_q plat_work_q
Definition: util_worker.c:41

◆ NORMAL_POWER_GOOD_CHECK_DELAY_MS

#define NORMAL_POWER_GOOD_CHECK_DELAY_MS   5000

◆ POWER_BRICK_ALERT_DELAY_MS

#define POWER_BRICK_ALERT_DELAY_MS   400

◆ VR_WRITE_RETRY_MAX_COUNT

#define VR_WRITE_RETRY_MAX_COUNT   5

Typedef Documentation

◆ alert_event_cfg

◆ alert_sensor_info

Function Documentation

◆ add_sel_work_handler()

void add_sel_work_handler ( struct k_work *  work_item)
Here is the call graph for this function:

◆ check_accl_card_pwr_good_work_handler()

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

◆ fio_power_button_work_handler()

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

◆ get_addsel_work()

add_sel_info * get_addsel_work ( uint8_t  gpio_num)

◆ ISR_FIO_BUTTON()

void ISR_FIO_BUTTON ( )

◆ ISR_POWER_STATUS_CHANGE()

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

◆ K_WORK_DELAYABLE_DEFINE() [1/2]

K_WORK_DELAYABLE_DEFINE ( check_accl_card_pwr_good_work  ,
check_accl_card_pwr_good_work_handler   
)

◆ K_WORK_DELAYABLE_DEFINE() [2/2]

K_WORK_DELAYABLE_DEFINE ( fio_power_button_work  ,
fio_power_button_work_handler   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_isr  )

◆ parse_power_brick_alert_event()

void parse_power_brick_alert_event ( add_sel_info work_info)
Here is the call graph for this function:

◆ parse_vr_alert_event()

void parse_vr_alert_event ( add_sel_info work_info)
Here is the call graph for this function:

◆ vr_alert_addsel()

void vr_alert_addsel ( uint8_t  sensor_num,
uint8_t  device_type,
uint8_t  board_info,
uint8_t  event_type,
uint8_t  status 
)
Here is the call graph for this function:

Variable Documentation

◆ add_sel_work_item

add_sel_info add_sel_work_item[]

◆ power_brick_info

alert_sensor_info power_brick_info[]
Initial value:
= {
{ .sensor_num = SENSOR_NUM_TEMP_POWER_BRICK_1, .last_status = 0 },
{ .sensor_num = SENSOR_NUM_TEMP_POWER_BRICK_2, .last_status = 0 },
}
#define SENSOR_NUM_TEMP_POWER_BRICK_2
Definition: plat_sensor_table.h:64
#define SENSOR_NUM_TEMP_POWER_BRICK_1
Definition: plat_sensor_table.h:63

◆ vr_info

alert_sensor_info vr_info[]
Initial value:
= {
{ .sensor_num = SENSOR_NUM_TEMP_P0V8_VDD_1, .last_status = 0 },
{ .sensor_num = SENSOR_NUM_TEMP_P0V8_VDD_2, .last_status = 0 },
}
#define SENSOR_NUM_TEMP_P0V8_VDD_1
Definition: plat_sensor_table.h:65
#define SENSOR_NUM_TEMP_P0V8_VDD_2
Definition: plat_sensor_table.h:66