OpenBIC
OpenSource Bridge-IC
pldm_firmware_update.c File Reference
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <logging/log.h>
#include "util_spi.h"
#include "util_sys.h"
#include "libutil.h"
#include "pldm_firmware_update.h"
#include "xdpe12284c.h"
#include "isl69259.h"
#include "mp2971.h"
#include "lattice.h"
#include "plat_version.h"
#include "xdpe15284.h"
#include "pt5161l.h"
#include "mp2985.h"
#include "raa229621.h"
#include "mpq8746.h"
#include "mp289x.h"
#include "tps53689.h"
#include "plat_def.h"
#include "ds160pt801.h"
#include "tda38741.h"
#include "mp2988.h"
#include "mp29816a.h"
#include "raa228249.h"
Include dependency graph for pldm_firmware_update.c:

Macros

#define PLDM_FW_UPDATE_STACK_SIZE   4096
 
#define UPDATE_THREAD_DELAY_SECOND   1
 
#define MIN_FW_UPDATE_BASELINE_TRANS_SIZE   32
 
#define PLDM_NO_SUPPORT_PROGRESS_PERCENT   0x65
 
#define PLDM_FW_UPDATE_MODE_TIMEOUT   60
 
#define GET_EEPROM_SLAVE_MASK(offset)   (((offset) >> 16) & 0xF)
 
#define GET_EERPOM_OFFSET(offset)   ((offset) & 0xFFFF)
 

Functions

 LOG_MODULE_DECLARE (pldm)
 
 K_KERNEL_STACK_MEMBER (pldm_fw_update_stack, PLDM_FW_UPDATE_STACK_SIZE)
 
 K_TIMER_DEFINE (update_mode_timer, NULL, NULL)
 
__weak void load_pldmupdate_comp_config (void)
 
__weak uint16_t plat_find_update_info_work (uint16_t comp_id)
 
int get_descriptor_type_length (uint16_t type)
 
int get_device_single_descriptor_length (struct pldm_descriptor_string data)
 
int get_device_descriptor_total_length (struct pldm_descriptor_string *table, uint8_t table_count)
 
uint8_t pldm_fw_update (void *fw_update_param, const int flash_position)
 
uint8_t pldm_bic_update (void *fw_update_param)
 
uint8_t pldm_bios_update (void *fw_update_param)
 
uint8_t pldm_vr_update (void *fw_update_param)
 
uint8_t pldm_cpld_update (void *fw_update_param)
 
uint8_t pldm_retimer_update (void *fw_update_param)
 
uint8_t pldm_retimer_recovery (void *fw_update_param)
 
uint8_t fw_recovery_eeprom (I2C_MSG *msg, uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, uint8_t flag)
 
 K_WORK_DELAYABLE_DEFINE (submit_warm_reset_work, submit_bic_warm_reset)
 
uint8_t pldm_bic_activate (void *arg)
 
uint16_t pldm_fw_update_read (void *mctp_p, enum pldm_firmware_update_commands cmd, uint8_t *req, uint16_t req_len, uint8_t *rbuf, uint16_t rbuf_len, void *ext_params)
 
void req_fw_update_handler (void *mctp_p, void *ext_params, void *arg)
 
__weak uint8_t plat_pldm_query_device_identifiers (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len)
 
__weak uint8_t plat_pldm_query_downstream_devices (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len)
 
__weak uint8_t plat_pldm_query_downstream_identifiers (const uint8_t *buf, uint16_t len, uint8_t *resp, uint16_t *resp_len)
 
uint8_t pldm_fw_update_handler_query (uint8_t code, void **ret_fn)
 
uint8_t fill_descriptor_into_buf (struct pldm_descriptor_string *descriptor, uint8_t *buf, uint8_t *fill_length, uint16_t current_length)
 

Variables

pldm_fw_update_info_tcomp_config = NULL
 
uint8_t comp_config_count = 0
 
k_tid_t fw_update_tid
 
struct k_thread pldm_fw_update_thread
 
struct pldm_fw_update_cfg fw_update_cfg
 

Macro Definition Documentation

◆ GET_EEPROM_SLAVE_MASK

#define GET_EEPROM_SLAVE_MASK (   offset)    (((offset) >> 16) & 0xF)

◆ GET_EERPOM_OFFSET

#define GET_EERPOM_OFFSET (   offset)    ((offset) & 0xFFFF)

◆ MIN_FW_UPDATE_BASELINE_TRANS_SIZE

#define MIN_FW_UPDATE_BASELINE_TRANS_SIZE   32

◆ PLDM_FW_UPDATE_MODE_TIMEOUT

#define PLDM_FW_UPDATE_MODE_TIMEOUT   60

◆ PLDM_FW_UPDATE_STACK_SIZE

#define PLDM_FW_UPDATE_STACK_SIZE   4096

◆ PLDM_NO_SUPPORT_PROGRESS_PERCENT

#define PLDM_NO_SUPPORT_PROGRESS_PERCENT   0x65

◆ UPDATE_THREAD_DELAY_SECOND

#define UPDATE_THREAD_DELAY_SECOND   1

Function Documentation

◆ fill_descriptor_into_buf()

uint8_t fill_descriptor_into_buf ( struct pldm_descriptor_string descriptor,
uint8_t *  buf,
uint8_t *  fill_length,
uint16_t  current_length 
)
Here is the call graph for this function:

◆ fw_recovery_eeprom()

uint8_t fw_recovery_eeprom ( I2C_MSG msg,
uint32_t  offset,
uint16_t  msg_len,
uint8_t *  msg_buf,
uint8_t  flag 
)
Here is the call graph for this function:

◆ get_descriptor_type_length()

int get_descriptor_type_length ( uint16_t  type)

◆ get_device_descriptor_total_length()

int get_device_descriptor_total_length ( struct pldm_descriptor_string table,
uint8_t  table_count 
)
Here is the call graph for this function:

◆ get_device_single_descriptor_length()

int get_device_single_descriptor_length ( struct pldm_descriptor_string  data)

◆ K_KERNEL_STACK_MEMBER()

K_KERNEL_STACK_MEMBER ( pldm_fw_update_stack  ,
PLDM_FW_UPDATE_STACK_SIZE   
)

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( update_mode_timer  ,
NULL  ,
NULL   
)

◆ K_WORK_DELAYABLE_DEFINE()

K_WORK_DELAYABLE_DEFINE ( submit_warm_reset_work  ,
submit_bic_warm_reset   
)

◆ load_pldmupdate_comp_config()

__weak void load_pldmupdate_comp_config ( void  )

◆ LOG_MODULE_DECLARE()

LOG_MODULE_DECLARE ( pldm  )

◆ plat_find_update_info_work()

__weak uint16_t plat_find_update_info_work ( uint16_t  comp_id)

◆ plat_pldm_query_device_identifiers()

__weak uint8_t plat_pldm_query_device_identifiers ( const uint8_t *  buf,
uint16_t  len,
uint8_t *  resp,
uint16_t *  resp_len 
)

◆ plat_pldm_query_downstream_devices()

__weak uint8_t plat_pldm_query_downstream_devices ( const uint8_t *  buf,
uint16_t  len,
uint8_t *  resp,
uint16_t *  resp_len 
)

◆ plat_pldm_query_downstream_identifiers()

__weak uint8_t plat_pldm_query_downstream_identifiers ( const uint8_t *  buf,
uint16_t  len,
uint8_t *  resp,
uint16_t *  resp_len 
)

◆ pldm_bic_activate()

uint8_t pldm_bic_activate ( void *  arg)

◆ pldm_bic_update()

uint8_t pldm_bic_update ( void *  fw_update_param)
Here is the call graph for this function:

◆ pldm_bios_update()

uint8_t pldm_bios_update ( void *  fw_update_param)
Here is the call graph for this function:

◆ pldm_cpld_update()

uint8_t pldm_cpld_update ( void *  fw_update_param)
Here is the call graph for this function:

◆ pldm_fw_update()

uint8_t pldm_fw_update ( void *  fw_update_param,
const int  flash_position 
)
Here is the call graph for this function:

◆ pldm_fw_update_handler_query()

uint8_t pldm_fw_update_handler_query ( uint8_t  code,
void **  ret_fn 
)
Here is the call graph for this function:

◆ pldm_fw_update_read()

uint16_t pldm_fw_update_read ( void *  mctp_p,
enum pldm_firmware_update_commands  cmd,
uint8_t *  req,
uint16_t  req_len,
uint8_t *  rbuf,
uint16_t  rbuf_len,
void *  ext_params 
)
Here is the call graph for this function:

◆ pldm_retimer_recovery()

uint8_t pldm_retimer_recovery ( void *  fw_update_param)
Here is the call graph for this function:

◆ pldm_retimer_update()

uint8_t pldm_retimer_update ( void *  fw_update_param)
Here is the call graph for this function:

◆ pldm_vr_update()

uint8_t pldm_vr_update ( void *  fw_update_param)
Here is the call graph for this function:

◆ req_fw_update_handler()

void req_fw_update_handler ( void *  mctp_p,
void *  ext_params,
void *  arg 
)

Variable Documentation

◆ comp_config

pldm_fw_update_info_t* comp_config = NULL

◆ comp_config_count

uint8_t comp_config_count = 0

◆ fw_update_cfg

struct pldm_fw_update_cfg fw_update_cfg
Initial value:
= { .image_size = 0,
#define MIN_FW_UPDATE_BASELINE_TRANS_SIZE
Definition: pldm_firmware_update.c:48

◆ fw_update_tid

k_tid_t fw_update_tid

◆ pldm_fw_update_thread

struct k_thread pldm_fw_update_thread