|
OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>#include <zephyr.h>#include <logging/log.h>#include <drivers/sensor.h>#include <drivers/pwm.h>#include "libutil.h"#include "power_status.h"#include "plat_class.h"#include "plat_gpio.h"#include "plat_isr.h"#include "plat_power_seq.h"#include "plat_mctp.h"#include "plat_pldm_sensor.h"#include "util_sys.h"
Macros | |
| #define | CXL_READY_HANDLER_STACK_SIZE 1024 |
| #define | VR_EVENT_WAIT_BIC_RESET_DELAY_MS (30 * 1000) |
Enumerations | |
| enum | { HB_STATE_UNKNOWN = 0 , HB_STATE_OK , HB_STATE_LOW } |
Variables | |
| struct k_thread | cxl1_thread_data |
| struct k_thread | cxl2_thread_data |
| bool | is_cxl_power_on_success = false |
| uint8_t | cxl1_hb_state = HB_STATE_UNKNOWN |
| uint8_t | cxl2_hb_state = HB_STATE_UNKNOWN |
| struct k_work_q | plat_work_q |
| cxl_power_control_gpio | cxl_power_ctrl_pin [MAX_CXL_ID] |
| cxl_power_good_gpio | cxl_power_good_pin [MAX_CXL_ID] |
| add_sel_info | cxl_event_work_items [] |
| uint8_t | ioe_list [4] |
| #define CXL_READY_HANDLER_STACK_SIZE 1024 |
| #define VR_EVENT_WAIT_BIC_RESET_DELAY_MS (30 * 1000) |
| int check_powers_disabled | ( | int | cxl_id, |
| int | pwr_stage | ||
| ) |

| int check_powers_enabled | ( | int | cxl_id, |
| int | pwr_stage | ||
| ) |

| void clear_wf_ASIC1_vr_faults | ( | ) |

| void clear_wf_ASIC2_vr_faults | ( | ) |

| void create_check_cxl_ready_thread | ( | ) |
| void cxl1_heartbeat_monitor_handler | ( | ) |

| bool cxl1_ready_access | ( | uint8_t | sensor_num | ) |

| void cxl1_ready_handler | ( | ) |
| bool cxl1_vr_access | ( | uint8_t | sensor_num | ) |
| void cxl2_heartbeat_monitor_handler | ( | ) |

| bool cxl2_ready_access | ( | uint8_t | sensor_num | ) |

| void cxl2_ready_handler | ( | ) |
| bool cxl2_vr_access | ( | uint8_t | sensor_num | ) |
| void disable_powers | ( | int | cxl_id, |
| int | pwr_stage | ||
| ) |

| void enable_asic1_rst | ( | ) |

| void enable_asic2_rst | ( | ) |

| void enable_powers | ( | int | cxl_id, |
| int | pwr_stage | ||
| ) |

| void execute_power_off_sequence | ( | ) |

| void execute_power_on_sequence | ( | ) |

| bool get_cxl_heartbeat | ( | char * | label | ) |
| bool get_cxl_ready_status | ( | uint8_t | cxl_id | ) |
| bool get_cxl_vr_access_status | ( | uint8_t | cxl_id | ) |
| uint32_t get_uptime_secs | ( | void | ) |
| void init_cxl_heartbeat_monitor_work | ( | ) |

| bool is_power_controlled | ( | int | cxl_id, |
| int | power_pin, | ||
| uint8_t | check_power_status, | ||
| char * | power_name | ||
| ) |

| K_MUTEX_DEFINE | ( | switch_ioe_mux_mutex | ) |
| K_THREAD_STACK_DEFINE | ( | cxl1_stack_area | , |
| CXL_READY_HANDLER_STACK_SIZE | |||
| ) |
| K_THREAD_STACK_DEFINE | ( | cxl2_stack_area | , |
| CXL_READY_HANDLER_STACK_SIZE | |||
| ) |
| K_TIMER_DEFINE | ( | enable_asic1_rst_timer | , |
| enable_asic1_rst | , | ||
| NULL | |||
| ) |
| K_TIMER_DEFINE | ( | enable_asic2_rst_timer | , |
| enable_asic2_rst | , | ||
| NULL | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | cxl1_hb_monitor_work | , |
| cxl1_heartbeat_monitor_handler | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | cxl1_ready_thread | , |
| cxl1_ready_handler | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | cxl2_hb_monitor_work | , |
| cxl2_heartbeat_monitor_handler | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | cxl2_ready_thread | , |
| cxl2_ready_handler | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | set_cxl1_vr_ready_work | , |
| set_cxl1_vr_access_delayed_status | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | set_cxl2_vr_ready_work | , |
| set_cxl2_vr_access_delayed_status | |||
| ) |
| K_WORK_DELAYABLE_DEFINE | ( | set_dc_on_5s_work | , |
| set_DC_on_delayed_status | |||
| ) |
| LOG_MODULE_REGISTER | ( | plat_power_seq | ) |
| int power_off_handler | ( | int | cxl_id, |
| int | power_stage | ||
| ) |

| int power_on_handler | ( | int | cxl_id, |
| int | power_stage | ||
| ) |

| void set_cxl1_vr_access_delayed_status | ( | ) |

| void set_cxl2_vr_access_delayed_status | ( | ) |

| void set_cxl_ready_status | ( | uint8_t | cxl_id, |
| bool | value | ||
| ) |
| void set_cxl_vr_access | ( | uint8_t | cxl_id, |
| bool | value | ||
| ) |
| void set_mb_dc_status | ( | uint8_t | gpio_num | ) |

| void switch_mux_to_bic | ( | uint8_t | value_to_write | ) |

| uint8_t cxl1_hb_state = HB_STATE_UNKNOWN |
| struct k_thread cxl1_thread_data |
| uint8_t cxl2_hb_state = HB_STATE_UNKNOWN |
| struct k_thread cxl2_thread_data |
| add_sel_info cxl_event_work_items[] |
| cxl_power_control_gpio cxl_power_ctrl_pin[MAX_CXL_ID] |
| cxl_power_good_gpio cxl_power_good_pin[MAX_CXL_ID] |
|
extern |
| bool is_cxl_power_on_success = false |
|
extern |