OpenBIC
OpenSource Bridge-IC
plat_util.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/* platform Event */
18#define SENSOR_NUM_SYSTEM_STATUS 0x10
19#define SENSOR_NUM_SYS_STA 0x46
20
21#define IPMI_EVENT_OFFSET_SYS_M2PRESENT 0x80
22#define IPMI_EVENT_OFFSET_SYS_INA231_PWR_ALERT 0x81
23#define IPMI_EVENT_OFFSET_SYS_HSC_PWR_ALERT 0x82
24#define IPMI_EVENT_OFFSET_SYS_IRQ_P12V_E1S_FLT 0x83
25#define IPMI_EVENT_OFFSET_SYS_IRQ_P3V3_E1S_FLT 0x84
26#define IPMI_EVENT_OFFSET_SYS_IRQ_P12V_EDGE_FLT 0x85
27
28#define E1S_BOARD_TYPE 0x07
29
30typedef enum {
36} NOSIE_E;
37
38typedef enum {
39 DEASSERT_CHK_TYPE_E_INA231_ALERT_0, // INA231 device alert
45
46void delay_function(uint32_t delay_time, void *func, uint32_t arg1, uint32_t arg2);
47uint8_t ignore_noise(uint8_t idx, uint32_t m_sec);
48void add_sel(uint8_t sensor_type, uint8_t event_type, uint8_t sensor_number, uint8_t event_data1,
49 uint8_t event_data2, uint8_t event_data3);
50void add_sel_work(uint32_t sel_msg_addr);
53void init_sel_sensor_num(void);
54uint8_t get_sel_sensor_num(void);
uint8_t idx
Definition: plat_util.c:39
uint8_t assert_type
Definition: pldm_oem.h:1
uint8_t sensor_type
Definition: storage_handler.h:5
uint8_t event_type
Definition: storage_handler.h:10
NOSIE_E
Definition: plat_util.h:30
@ NOSIE_E_M2PRSNT_MAX
Definition: plat_util.h:35
@ NOSIE_E_M2PRSNT_A
Definition: plat_util.h:31
@ NOSIE_E_M2PRSNT_D
Definition: plat_util.h:34
@ NOSIE_E_M2PRSNT_C
Definition: plat_util.h:33
@ NOSIE_E_M2PRSNT_B
Definition: plat_util.h:32
void init_sel_sensor_num(void)
Definition: plat_util.c:314
void deassert_func_handler(DEASSERT_CHK_TYPE_E idx)
uint8_t assert_func(DEASSERT_CHK_TYPE_E assert_type)
Definition: plat_util.c:279
void delay_function(uint32_t delay_time, void *func, uint32_t arg1, uint32_t arg2)
Definition: plat_util.c:92
void add_sel(uint8_t sensor_type, uint8_t event_type, uint8_t sensor_number, uint8_t event_data1, uint8_t event_data2, uint8_t event_data3)
Definition: plat_util.c:195
uint8_t ignore_noise(uint8_t idx, uint32_t m_sec)
Definition: plat_util.c:178
DEASSERT_CHK_TYPE_E
Definition: plat_util.h:38
@ DEASSERT_CHK_TYPE_E_INA231_ALERT_1
Definition: plat_util.h:40
@ DEASSERT_CHK_TYPE_E_INA231_ALERT_3
Definition: plat_util.h:42
@ DEASSERT_CHK_TYPE_E_INA231_ALERT_0
Definition: plat_util.h:39
@ DEASSERT_CHK_TYPE_E_MAX
Definition: plat_util.h:43
@ DEASSERT_CHK_TYPE_E_INA231_ALERT_2
Definition: plat_util.h:41
void add_sel_work(uint32_t sel_msg_addr)
Definition: plat_util.c:226
uint8_t get_sel_sensor_num(void)
Definition: plat_util.c:343