OpenBIC
OpenSource Bridge-IC
util_spi.c File Reference
#include <zephyr.h>
#include <logging/log.h>
#include <shell/shell.h>
#include <drivers/flash.h>
#include <device.h>
#include <soc.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/util.h>
#include "cmsis_os2.h"
#include "util_spi.h"
#include "util_sys.h"
#include "libutil.h"
#include "ipmi.h"
#include <crypto/hash.h>
#include "plat_def.h"
Include dependency graph for util_spi.c:

Macros

#define FW_UPDATE_RETRY_MAX_COUNT   0
 
#define IS25WP256D_ID   0x9D7019
 

Functions

 LOG_MODULE_REGISTER (util_spi)
 
int ckeck_flash_device_isinit (const struct device *flash_device, uint8_t flash_position)
 
char * get_flash_device_string_by_index (uint8_t flash_index)
 
int do_update (const struct device *flash_device, off_t offset, uint8_t *buf, size_t len)
 
uint8_t fw_update (uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, uint8_t flag, uint8_t flash_position)
 
int read_fw_image (uint32_t offset, uint8_t msg_len, uint8_t *msg_buf, uint8_t flash_position)
 
void set_default_retry_count (int count)
 
__weak uint8_t fw_update_cxl (uint32_t offset, uint16_t msg_len, uint8_t *msg_buf, bool sector_end)
 
__weak int pal_get_bios_flash_position ()
 
__weak int pal_get_prot_flash_position ()
 
__weak bool pal_switch_bios_spi_mux (int gpio_status)
 

Macro Definition Documentation

◆ FW_UPDATE_RETRY_MAX_COUNT

#define FW_UPDATE_RETRY_MAX_COUNT   0

◆ IS25WP256D_ID

#define IS25WP256D_ID   0x9D7019

Function Documentation

◆ ckeck_flash_device_isinit()

int ckeck_flash_device_isinit ( const struct device *  flash_device,
uint8_t  flash_position 
)

◆ do_update()

int do_update ( const struct device *  flash_device,
off_t  offset,
uint8_t *  buf,
size_t  len 
)

◆ fw_update()

uint8_t fw_update ( uint32_t  offset,
uint16_t  msg_len,
uint8_t *  msg_buf,
uint8_t  flag,
uint8_t  flash_position 
)

◆ fw_update_cxl()

__weak uint8_t fw_update_cxl ( uint32_t  offset,
uint16_t  msg_len,
uint8_t *  msg_buf,
bool  sector_end 
)

◆ get_flash_device_string_by_index()

char * get_flash_device_string_by_index ( uint8_t  flash_index)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( util_spi  )

◆ pal_get_bios_flash_position()

__weak int pal_get_bios_flash_position ( )

◆ pal_get_prot_flash_position()

__weak int pal_get_prot_flash_position ( )

◆ pal_switch_bios_spi_mux()

__weak bool pal_switch_bios_spi_mux ( int  gpio_status)

◆ read_fw_image()

int read_fw_image ( uint32_t  offset,
uint8_t  msg_len,
uint8_t *  msg_buf,
uint8_t  flash_position 
)

◆ set_default_retry_count()

void set_default_retry_count ( int  count)

Variable Documentation

◆ isinit

bool isinit

◆ name

char* name