OpenBIC
OpenSource Bridge-IC
plat_event.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#ifndef PLAT_EVENT_H
18#define PLAT_EVENT_H
19
20#define POLLING_CPLD_STACK_SIZE 1024
21
22#define POWER_AND_RESET_BUTTON_REG 0x00
23#define VR_AND_CLK_ENABLE_PIN_READING_REG 0x01
24#define VR_ENABLE_PIN_READING_1_REG 0x02
25#define VR_ENABLE_PIN_READING_2_REG 0x03
26#define VR_ENABLE_PIN_READING_3_REG 0x04
27#define VR_ENABLE_PIN_READING_4_REG 0x05
28#define MB_POWER_GOOD_AND_PERST_PIN_READING_REG 0x06
29#define VR_POWER_GOOD_PIN_READING_1_REG 0x07
30#define VR_POWER_GOOD_PIN_READING_2_REG 0x08
31#define VR_POWER_GOOD_PIN_READING_3_REG 0x09
32#define VR_POWER_GOOD_PIN_READING_4_REG 0x0A
33#define VR_POWER_GOOD_PIN_READING_5_REG 0x0B
34#define RSVD_1_REG 0x0C
35#define VR_POWER_FAULT_1_REG 0x0D
36#define VR_POWER_FAULT_2_REG 0x0E
37#define VR_POWER_FAULT_3_REG 0x0F
38#define VR_POWER_FAULT_4_REG 0x10
39#define VR_POWER_FAULT_5_REG 0x11
40#define RSVD_2_REG 0x12
41#define RSVD_3_REG 0x13
42#define OSFP_PRSNT_PIN_READING_1_REG 0x14
43#define OSFP_PRSNT_PIN_READING_2_REG 0x15
44#define OSFP_POWER_ENABLE_PIN_READING_1_REG 0x16
45#define OSFP_POWER_ENABLE_PIN_READING_2_REG 0x17
46#define OSFP_POWER_ENABLE_PIN_READING_3_REG 0x18
47#define OSFP_POWER_ENABLE_PIN_READING_4_REG 0x19
48#define BOARD_TYPE_REG 0x1A
49#define BOARD_REV_ID_REG 0x1B
50#define VR_VENDOR_TYPE_REG 0x1C
51#define OWL_JTAG_SEL_MUX_REG 0x1D
52#define ATH_JTAG_SEL_MUX_REG 0x1E
53#define OWL_UART_SEL_MUX_REG 0x1F
54#define AEGIS_JTAG_SWITCH_REG 0x20
55#define ATH_BOOT_SOURCE_REG 0x21
56#define S_OWL_BOOT_SOURCE_REG 0x22
57#define N_OWL_BOOT_SOURCE_REG 0x23
58#define VR_SMBUS_ALERT_1_REG 0x24
59#define VR_SMBUS_ALERT_2_REG 0x25
60#define RSVD_4_REG 0x26
61#define ASIC_OC_WARN_REG 0x27
62#define SYSTEM_ALERT_FAULT_REG 0x28
63#define VR_HOT_FAULT_1_REG 0x29
64#define VR_HOT_FAULT_2_REG 0x2A
65#define TEMPERATURE_IC_OVERT_FAULT_REG 0x2B
66#define VR_POWER_INPUT_FAULT_1_REG 0x2C
67#define VR_POWER_INPUT_FAULT_2_REG 0x2D
68#define LEAK_DETCTION_REG 0x2E
69#define RESET_PIN_TO_ICS_STATUS_REG 0x2F
70#define CRD_STATUS_REG 0x30
71#define CMN_STATUS_REG 0x31
72#define RSVD_GPIO_STATUS_REG 0x32
73#define UART_IC_STATUS_REG 0x33
74#define UBC_MODULE_OC_WARNING_REG 0x34
75#define CPLD_EEPROM_STATUS_REG 0x35
76#define MTIA_N_OWL_TEST_PIN_STATUS_REG 0x36
77#define MTIA_S_OWL_TEST_PIN_STATUS_REG 0x37
78#define MTIA_ATH_TEST_PIN_STATUS_REG 0x38
79#define MTIA_VQPS_TO_EFUSE_PROGRAMMING_REG 0x39
80#define BUFFER_100M_CLK_LOSE_OF_INPUT_SIGNAL_REG 0x3A
81#define MTIA_QSPI_BOOT_DISABLE_REG 0x3B
82#define ATH_RSVD_GPIO_REG 0x3C
83
84void check_ubc_delayed(struct k_timer *timer);
86void init_cpld_polling(void);
87
89
90typedef struct _aegis_cpld_info_ {
91 uint8_t cpld_offset;
93 uint8_t dc_on_defaut;
94 bool is_fault_log; // if true, check the value is defaut or not
95 uint8_t is_fault_bit_map; //flag for fault
96
97 //flag for 1st polling
99
100 //flag for 1st polling after changing DC status
102
103 //temp data for last polling
105
106 bool (*status_changed_cb)(aegis_cpld_info *, uint8_t *);
107
109
110#endif
uint8_t status
Definition: mctp_ctrl.h:1
void check_ubc_delayed(struct k_timer *timer)
Definition: plat_event.c:74
struct _aegis_cpld_info_ aegis_cpld_info
Definition: plat_event.h:88
void init_cpld_polling(void)
Definition: plat_event.c:175
void set_dc_status_changing_status(bool status)
Definition: plat_event.c:69
Definition: plat_event.h:90
uint8_t dc_on_defaut
Definition: plat_event.h:93
bool(* status_changed_cb)(aegis_cpld_info *, uint8_t *)
Definition: plat_event.h:106
uint8_t cpld_offset
Definition: plat_event.h:91
uint8_t last_polling_value
Definition: plat_event.h:104
uint8_t dc_off_defaut
Definition: plat_event.h:92
uint8_t is_fault_bit_map
Definition: plat_event.h:95
bool is_first_polling
Definition: plat_event.h:98
bool is_first_polling_after_dc_change
Definition: plat_event.h:101
bool is_fault_log
Definition: plat_event.h:94