OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <stdlib.h>
#include "sensor.h"
#include "pmbus.h"
#include "libutil.h"
#include "hal_i2c.h"
#include "plat_dev.h"
#include "util_pmbus.h"
#include "plat_isr.h"
#include "plat_fru.h"
#include "ioexp_tca9555.h"
#include "common_i2c_mux.h"
#include "plat_sensor_table.h"
#include <logging/log.h>
#include "plat_def.h"
#include "pm8702.h"
#include "cci.h"
#include "plat_mctp.h"
#include "plat_hook.h"
#include "plat_class.h"
#include "hal_gpio.h"
#include "plat_gpio.h"
#include "power_status.h"
#include "plat_pldm_monitor.h"
#include "pldm_state_set.h"
Macros | |
#define | CXL_IOEXP_CONFIG_REG_DEFAULT_VAL 0xFF |
#define | CXL_IOEXP_U14_OUTPUT_0_REG_VAL 0xFF |
#define | CXL_IOEXP_U14_OUTPUT_1_REG_VAL 0xFF |
#define | CXL_IOEXP_U14_CONFIG_0_REG_VAL 0xFF |
#define | CXL_IOEXP_U14_CONFIG_1_REG_VAL 0xFF |
#define | CXL_IOEXP_U15_OUTPUT_0_REG_VAL 0x3B |
#define | CXL_IOEXP_U15_OUTPUT_1_REG_VAL 0xFF |
#define | CXL_IOEXP_U15_CONFIG_0_REG_VAL 0x21 |
#define | CXL_IOEXP_U15_CONFIG_1_REG_VAL 0xFE |
#define | CXL_IOEXP_U16_OUTPUT_0_REG_VAL 0xFF |
#define | CXL_IOEXP_U16_OUTPUT_1_REG_VAL 0xFF |
#define | CXL_IOEXP_U16_CONFIG_0_REG_VAL 0x00 |
#define | CXL_IOEXP_U16_CONFIG_1_REG_VAL 0x00 |
#define | CXL_IOEXP_U17_OUTPUT_0_REG_VAL 0xFF |
#define | CXL_IOEXP_U17_OUTPUT_1_REG_VAL 0xFF |
#define | CXL_IOEXP_U17_CONFIG_0_REG_VAL 0xFF |
#define | CXL_IOEXP_U17_CONFIG_1_REG_VAL 0xFF |
#define | PM8702_DEFAULT_SENSOR_NUM SENSOR_NUM_TEMP_CXL_DIMMA |
#define | CXL_CARD_VR_COUNT 3 |
#define | MONITOR_SSD_POWER_FAULT_STACK_SIZE 1536 |
#define | MONITOR_SSD_POWER_FAULT_DELAY_MS 2000 |
Functions | |
LOG_MODULE_REGISTER (plat_dev) | |
K_THREAD_STACK_DEFINE (monitor_ssd_power_fault_thread, MONITOR_SSD_POWER_FAULT_STACK_SIZE) | |
void | clear_ssd_power_fault_flag () |
void | clear_cxl_card_cache_value (uint8_t cxl_id) |
void | cxl_mb_status_init (uint8_t cxl_id) |
bool | cxl_single_ioexp_alert_reset (uint8_t ioexp_name, bool is_mutex) |
bool | cxl_single_ioexp_config_init (uint8_t ioexp_name) |
int | cxl_ioexp_init (uint8_t cxl_channel) |
void | init_cxl_card_ioexp (uint8_t cxl_id) |
uint8_t | pal_pm8702_read (uint8_t card_id, sensor_cfg *cfg, int *reading) |
bool | pal_init_pm8702_info (uint8_t cxl_id) |
bool | pal_get_pm8702_hbo_status (uint8_t cxl_id, uint8_t *resp_buf, uint8_t *resp_len) |
bool | pal_pm8702_transfer_fw (uint8_t cxl_id, uint8_t *req_buf, int req_len) |
bool | pal_set_pm8702_active_slot (uint8_t cxl_id, uint8_t *req_buf, int req_len) |
bool | pal_pm8702_command_handler (uint8_t cxl_id, uint16_t opcode, uint8_t *data_buf, int data_len, uint8_t *response, uint8_t *response_len) |
void | monitor_ssd_power_fault () |
void | init_ssd_power_fault_thread () |
void | abort_ssd_power_fault_thread () |
void | init_ssd_power_fault_work () |
Variables | |
struct k_thread | ssd_power_fault_thread_handler |
k_tid_t | ssd_power_fault_tid |
pm8702_dev_info | pm8702_table [] |
cxl_vr_fw_info | cxl_vr_info_table [] |
#define CXL_CARD_VR_COUNT 3 |
#define CXL_IOEXP_CONFIG_REG_DEFAULT_VAL 0xFF |
#define CXL_IOEXP_U14_CONFIG_0_REG_VAL 0xFF |
#define CXL_IOEXP_U14_CONFIG_1_REG_VAL 0xFF |
#define CXL_IOEXP_U14_OUTPUT_0_REG_VAL 0xFF |
#define CXL_IOEXP_U14_OUTPUT_1_REG_VAL 0xFF |
#define CXL_IOEXP_U15_CONFIG_0_REG_VAL 0x21 |
#define CXL_IOEXP_U15_CONFIG_1_REG_VAL 0xFE |
#define CXL_IOEXP_U15_OUTPUT_0_REG_VAL 0x3B |
#define CXL_IOEXP_U15_OUTPUT_1_REG_VAL 0xFF |
#define CXL_IOEXP_U16_CONFIG_0_REG_VAL 0x00 |
#define CXL_IOEXP_U16_CONFIG_1_REG_VAL 0x00 |
#define CXL_IOEXP_U16_OUTPUT_0_REG_VAL 0xFF |
#define CXL_IOEXP_U16_OUTPUT_1_REG_VAL 0xFF |
#define CXL_IOEXP_U17_CONFIG_0_REG_VAL 0xFF |
#define CXL_IOEXP_U17_CONFIG_1_REG_VAL 0xFF |
#define CXL_IOEXP_U17_OUTPUT_0_REG_VAL 0xFF |
#define CXL_IOEXP_U17_OUTPUT_1_REG_VAL 0xFF |
#define MONITOR_SSD_POWER_FAULT_DELAY_MS 2000 |
#define MONITOR_SSD_POWER_FAULT_STACK_SIZE 1536 |
#define PM8702_DEFAULT_SENSOR_NUM SENSOR_NUM_TEMP_CXL_DIMMA |
void abort_ssd_power_fault_thread | ( | ) |
void clear_cxl_card_cache_value | ( | uint8_t | cxl_id | ) |
void clear_ssd_power_fault_flag | ( | ) |
int cxl_ioexp_init | ( | uint8_t | cxl_channel | ) |
MEB mux for cxl channels
CXL mux for sensor channels
Mutex lock bus
Enable mux channel
ALL ioexp config register initial
ALL ioexp initial
mutex unlock bus
void cxl_mb_status_init | ( | uint8_t | cxl_id | ) |
Initial mb reset pin status by checking the IO expander on CXL module
MEB mux for cxl channels
CXL mux for sensor channels
Mutex lock bus
Enable mux channel
Read cxl U15 ioexp input port0 status
CXL mux for cxl channels
bool cxl_single_ioexp_alert_reset | ( | uint8_t | ioexp_name, |
bool | is_mutex | ||
) |
Read cxl ioexp input port 0 status
Read cxl ioexp input port 1 status
bool cxl_single_ioexp_config_init | ( | uint8_t | ioexp_name | ) |
Write cxl ioexp output 0 register
Write cxl ioexp output 1 register
Write cxl ioexp config 0 register
Write cxl ioexp config 1 register
void init_cxl_card_ioexp | ( | uint8_t | cxl_id | ) |
void init_ssd_power_fault_thread | ( | ) |
void init_ssd_power_fault_work | ( | ) |
K_THREAD_STACK_DEFINE | ( | monitor_ssd_power_fault_thread | , |
MONITOR_SSD_POWER_FAULT_STACK_SIZE | |||
) |
LOG_MODULE_REGISTER | ( | plat_dev | ) |
void monitor_ssd_power_fault | ( | ) |
bool pal_get_pm8702_hbo_status | ( | uint8_t | cxl_id, |
uint8_t * | resp_buf, | ||
uint8_t * | resp_len | ||
) |
bool pal_init_pm8702_info | ( | uint8_t | cxl_id | ) |
bool pal_pm8702_command_handler | ( | uint8_t | cxl_id, |
uint16_t | opcode, | ||
uint8_t * | data_buf, | ||
int | data_len, | ||
uint8_t * | response, | ||
uint8_t * | response_len | ||
) |
uint8_t pal_pm8702_read | ( | uint8_t | card_id, |
sensor_cfg * | cfg, | ||
int * | reading | ||
) |
bool pal_pm8702_transfer_fw | ( | uint8_t | cxl_id, |
uint8_t * | req_buf, | ||
int | req_len | ||
) |
bool pal_set_pm8702_active_slot | ( | uint8_t | cxl_id, |
uint8_t * | req_buf, | ||
int | req_len | ||
) |
cxl_vr_fw_info cxl_vr_info_table[] |
pm8702_dev_info pm8702_table[] |
struct k_thread ssd_power_fault_thread_handler |
k_tid_t ssd_power_fault_tid |