OpenBIC
OpenSource Bridge-IC
plat_isr.c File Reference
#include <zephyr.h>
#include <stdio.h>
#include <logging/log.h>
#include "libipmi.h"
#include "power_status.h"
#include "sensor.h"
#include "plat_m2.h"
#include "plat_gpio.h"
#include "plat_i2c.h"
#include "plat_class.h"
#include "plat_power_seq.h"
#include "plat_util.h"
#include "plat_isr.h"
#include "plat_hwmon.h"
Include dependency graph for plat_isr.c:

Macros

#define INA231_ALERT_HANDLER_M2(DEV)
 
#define DEV_PRSNT_HANDLER(idx)
 
#define DEV_FAULT_HANDLER(idx)
 
#define DEV_3V3_FAULT_HANDLER(idx)
 

Functions

uint8_t ina230_init (sensor_cfg *cfg)
 
 LOG_MODULE_REGISTER (plat_isr)
 
void dev_12v_fault_handler (void)
 
void pwrgd_p12v_aux_int_handler (void)
 
void power_en_int_handler (void)
 
void dev_rst (void)
 
uint8_t get_p12v_flt_status (uint8_t idx)
 
uint8_t check_12v_dev_pwrgd (void)
 
void aux_pwr_en_int_handler (void)
 
void rst_mb_n_int_handler (void)
 
void prsnt_int_handler (uint32_t idx, uint32_t arg1)
 
void irq_fault_sel (uint8_t idx, uint8_t type, uint8_t is_check)
 
void check_irq_fault (void)
 
bool plat_gpio_immediate_int_cb (uint8_t gpio_num)
 
void p12v_edge_fault_sel (void)
 
 DEV_PRSNT_HANDLER (0)
 
 DEV_PRSNT_HANDLER (1)
 
 DEV_PRSNT_HANDLER (2)
 
 DEV_PRSNT_HANDLER (3)
 
 DEV_FAULT_HANDLER (0)
 
 DEV_FAULT_HANDLER (1)
 
 DEV_FAULT_HANDLER (2)
 
 DEV_FAULT_HANDLER (3)
 
 DEV_3V3_FAULT_HANDLER (0)
 
 DEV_3V3_FAULT_HANDLER (1)
 
 DEV_3V3_FAULT_HANDLER (2)
 
 DEV_3V3_FAULT_HANDLER (3)
 
 INA231_ALERT_HANDLER_M2 (0)
 
 INA231_ALERT_HANDLER_M2 (1)
 
 INA231_ALERT_HANDLER_M2 (2)
 
 INA231_ALERT_HANDLER_M2 (3)
 

Macro Definition Documentation

◆ DEV_3V3_FAULT_HANDLER

#define DEV_3V3_FAULT_HANDLER (   idx)
Value:
void dev_3v3_fault_handler_dev##idx(void) \
{ \
static int64_t pre_time[M2_IDX_E_MAX]; \
int64_t current_time = k_uptime_get(); \
if ((current_time - pre_time[idx]) < 10) { \
return; \
} \
pre_time[idx] = current_time; \
irq_fault_sel(idx, P3V3_E1S, 0); \
}
uint8_t idx
Definition: plat_util.c:39
@ M2_IDX_E_MAX
Definition: plat_m2.h:39
@ P3V3_E1S
Definition: plat_isr.h:22

◆ DEV_FAULT_HANDLER

#define DEV_FAULT_HANDLER (   idx)
Value:
void dev_12v_fault_handler_dev##idx(void) \
{ \
static int64_t pre_time[M2_IDX_E_MAX]; \
int64_t current_time = k_uptime_get(); \
if ((current_time - pre_time[idx]) < 10) { \
return; \
} \
pre_time[idx] = current_time; \
if (gpio_get(IRQ_P12V_E1S_##idx##_FLT_N) == 0) { \
rst_edsff(idx, 0); \
clkbuf_oe_en(idx, 0); \
} \
dev_12v_fault_handler(); \
irq_fault_sel(idx, P12V_E1S, 0); \
}
int gpio_get(uint8_t gpio_num)
Definition: hal_gpio.c:261
@ P12V_E1S
Definition: plat_isr.h:21

◆ DEV_PRSNT_HANDLER

#define DEV_PRSNT_HANDLER (   idx)
Value:
void prsnt_int_handler_dev##idx(void) \
{ \
static int64_t pre_time; \
int64_t current_time = k_uptime_get(); \
if ((current_time - pre_time) < 10) { \
return; \
} \
pre_time = current_time; \
delay_function(10, prsnt_int_handler, idx, 0); \
}
void prsnt_int_handler(uint32_t idx, uint32_t arg1)
Definition: plat_isr.c:152

◆ INA231_ALERT_HANDLER_M2

#define INA231_ALERT_HANDLER_M2 (   DEV)
Value:
void ina231_alert_handler_m2_dev##DEV(void) \
{ \
if (m2_prsnt(DEV) && get_fm_p12v_sw_en(DEV)) \
assert_func(DEASSERT_CHK_TYPE_E_INA231_ALERT_##DEV); \
}
uint8_t m2_prsnt(uint8_t idx)
Definition: plat_m2.c:129
uint8_t get_fm_p12v_sw_en(uint8_t idx)
Definition: plat_power_seq.c:105

Function Documentation

◆ aux_pwr_en_int_handler()

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

◆ check_12v_dev_pwrgd()

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

◆ check_irq_fault()

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

◆ dev_12v_fault_handler()

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

◆ DEV_3V3_FAULT_HANDLER() [1/4]

DEV_3V3_FAULT_HANDLER ( )

◆ DEV_3V3_FAULT_HANDLER() [2/4]

DEV_3V3_FAULT_HANDLER ( )

◆ DEV_3V3_FAULT_HANDLER() [3/4]

DEV_3V3_FAULT_HANDLER ( )

◆ DEV_3V3_FAULT_HANDLER() [4/4]

DEV_3V3_FAULT_HANDLER ( )

◆ DEV_FAULT_HANDLER() [1/4]

DEV_FAULT_HANDLER ( )

◆ DEV_FAULT_HANDLER() [2/4]

DEV_FAULT_HANDLER ( )

◆ DEV_FAULT_HANDLER() [3/4]

DEV_FAULT_HANDLER ( )

◆ DEV_FAULT_HANDLER() [4/4]

DEV_FAULT_HANDLER ( )

◆ DEV_PRSNT_HANDLER() [1/4]

DEV_PRSNT_HANDLER ( )

◆ DEV_PRSNT_HANDLER() [2/4]

DEV_PRSNT_HANDLER ( )

◆ DEV_PRSNT_HANDLER() [3/4]

DEV_PRSNT_HANDLER ( )

◆ DEV_PRSNT_HANDLER() [4/4]

DEV_PRSNT_HANDLER ( )

◆ dev_rst()

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

◆ get_p12v_flt_status()

uint8_t get_p12v_flt_status ( uint8_t  idx)
Here is the call graph for this function:

◆ ina230_init()

uint8_t ina230_init ( sensor_cfg cfg)
Here is the call graph for this function:

◆ INA231_ALERT_HANDLER_M2() [1/4]

INA231_ALERT_HANDLER_M2 ( )

◆ INA231_ALERT_HANDLER_M2() [2/4]

INA231_ALERT_HANDLER_M2 ( )

◆ INA231_ALERT_HANDLER_M2() [3/4]

INA231_ALERT_HANDLER_M2 ( )

◆ INA231_ALERT_HANDLER_M2() [4/4]

INA231_ALERT_HANDLER_M2 ( )

◆ irq_fault_sel()

void irq_fault_sel ( uint8_t  idx,
uint8_t  type,
uint8_t  is_check 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_isr  )

◆ p12v_edge_fault_sel()

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

◆ plat_gpio_immediate_int_cb()

bool plat_gpio_immediate_int_cb ( uint8_t  gpio_num)

◆ power_en_int_handler()

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

◆ prsnt_int_handler()

void prsnt_int_handler ( uint32_t  idx,
uint32_t  arg1 
)
Here is the call graph for this function:

◆ pwrgd_p12v_aux_int_handler()

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

◆ rst_mb_n_int_handler()

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