OpenBIC
OpenSource Bridge-IC
plat_dev.h File Reference
#include <stdint.h>
#include "sensor.h"
Include dependency graph for plat_dev.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _freya_fw_info
 
struct  _freya_info
 
struct  _vr_fw_info
 
struct  _switch_error_check_info
 
struct  _wait_fw_update_status_info
 

Macros

#define CLOCK_GEN_ADDR   (0xD0 >> 1)
 
#define FREYA_STATUS_BLOCK_OFFSET   0x00
 
#define FREYA_STATUS_BLOCK_LENGTH   0x08
 
#define FREYA_READY_STATUS_BIT   BIT(6)
 
#define FREYA_READY_STATUS_OFFSET   0x01
 
#define FREYA_READY_STATUS_LENGTH   1
 
#define NVME_TEMPERATURE_INDEX   3
 
#define FREYA_MODULE_IDENTIFIER_BLOCK_OFFSET   0x20
 
#define FREYA_MODULE_IDENTIFIER_BLOCK_LENGTH   0x37
 
#define IS_FREYA_MODULE_IDENTIFIER_SUPPORT   0x01
 
#define FREYA_MODULE_IDENTIFIER_OFFSET   0x01
 
#define FREYA_MODULE_IDENTIFIER_LENGTH   1
 
#define FREYA_FFI_OFFSET   0x2B
 
#define FREYA_FFI_LENGTH   1
 
#define FREYA_FIRMWARE_VERSION_BLOCK_OFFSET   0x68
 
#define FREYA_FIRMWARE_VERSION_BLOCK_LENGTH   0x08
 
#define FREYA_FIRMWARE_VERSION_OFFSET   0x02
 
#define FREYA_FIRMWARE_VERSION_LENGTH   5
 
#define FREYA_NOT_READY_RET_CODE   -2
 
#define FREYA_NOT_SUPPORT_MODULE_IDENTIFIER_RET_CODE   -3
 
#define WAIT_FIRMWARE_READY_DELAY_S   1
 
#define UNKNOWN_TYPE   0xFF
 

Typedefs

typedef struct _freya_fw_info freya_fw_info
 
typedef struct _freya_info freya_info
 
typedef struct _vr_fw_info vr_fw_info
 
typedef struct _switch_error_check_info switch_error_check_info
 
typedef struct _wait_fw_update_status_info wait_fw_update_status_info
 

Enumerations

enum  FREYA_ID { FREYA_ID1 , FREYA_ID2 }
 
enum  ATM_EXEC_STATUS {
  EXEC_STATUS_IDLE , EXEC_STATUS_RUNNING , EXEC_STATUS_COMPLETE , EXEC_STATUS_TIMEOUT ,
  EXEC_STATUS_DEFAULT = 0xFF
}
 
enum  ATM_EXEC_RESULT { EXEC_RESULT_PASS , EXEC_RESULT_ABORTED , EXEC_RESULT_FAIL , EXEC_RESULT_DEFAULT = 0xFF }
 

Functions

int get_boot1_complete_bit (uint8_t bus, uint8_t addr, uint8_t *bit)
 
void clear_freya_cache_flag (uint8_t card_id)
 
void clear_accl_cable_power_fault_flag ()
 
int get_freya_fw_info (uint8_t bus, uint8_t addr, freya_fw_info *fw_info)
 
bool is_sw_ready (uint8_t sensor_num)
 
void init_sw_heartbeat_work ()
 
void clear_sw_error_check_flag ()
 
void get_switch_error_status (uint8_t sensor_num, uint8_t bus, uint8_t addr, uint8_t index)
 
bool init_vr_write_protect (uint8_t bus, uint8_t addr, uint8_t default_val)
 
int atm_fw_update (uint8_t bus, uint8_t addr, uint32_t offset, uint8_t *msg_buf, uint16_t buf_len, uint32_t image_size, bool is_end_package)
 
void init_clk_gen_spread_spectrum_control_register ()
 

Variables

freya_info accl_freya_info []
 
vr_fw_info cb_vr_fw_info
 
switch_error_check_info sw_error_check_info []
 
wait_fw_update_status_info atm_wait_fw_info
 

Macro Definition Documentation

◆ CLOCK_GEN_ADDR

#define CLOCK_GEN_ADDR   (0xD0 >> 1)

◆ FREYA_FFI_LENGTH

#define FREYA_FFI_LENGTH   1

◆ FREYA_FFI_OFFSET

#define FREYA_FFI_OFFSET   0x2B

◆ FREYA_FIRMWARE_VERSION_BLOCK_LENGTH

#define FREYA_FIRMWARE_VERSION_BLOCK_LENGTH   0x08

◆ FREYA_FIRMWARE_VERSION_BLOCK_OFFSET

#define FREYA_FIRMWARE_VERSION_BLOCK_OFFSET   0x68

◆ FREYA_FIRMWARE_VERSION_LENGTH

#define FREYA_FIRMWARE_VERSION_LENGTH   5

◆ FREYA_FIRMWARE_VERSION_OFFSET

#define FREYA_FIRMWARE_VERSION_OFFSET   0x02

◆ FREYA_MODULE_IDENTIFIER_BLOCK_LENGTH

#define FREYA_MODULE_IDENTIFIER_BLOCK_LENGTH   0x37

◆ FREYA_MODULE_IDENTIFIER_BLOCK_OFFSET

#define FREYA_MODULE_IDENTIFIER_BLOCK_OFFSET   0x20

◆ FREYA_MODULE_IDENTIFIER_LENGTH

#define FREYA_MODULE_IDENTIFIER_LENGTH   1

◆ FREYA_MODULE_IDENTIFIER_OFFSET

#define FREYA_MODULE_IDENTIFIER_OFFSET   0x01

◆ FREYA_NOT_READY_RET_CODE

#define FREYA_NOT_READY_RET_CODE   -2

◆ FREYA_NOT_SUPPORT_MODULE_IDENTIFIER_RET_CODE

#define FREYA_NOT_SUPPORT_MODULE_IDENTIFIER_RET_CODE   -3

◆ FREYA_READY_STATUS_BIT

#define FREYA_READY_STATUS_BIT   BIT(6)

◆ FREYA_READY_STATUS_LENGTH

#define FREYA_READY_STATUS_LENGTH   1

◆ FREYA_READY_STATUS_OFFSET

#define FREYA_READY_STATUS_OFFSET   0x01

◆ FREYA_STATUS_BLOCK_LENGTH

#define FREYA_STATUS_BLOCK_LENGTH   0x08

◆ FREYA_STATUS_BLOCK_OFFSET

#define FREYA_STATUS_BLOCK_OFFSET   0x00

◆ IS_FREYA_MODULE_IDENTIFIER_SUPPORT

#define IS_FREYA_MODULE_IDENTIFIER_SUPPORT   0x01

◆ NVME_TEMPERATURE_INDEX

#define NVME_TEMPERATURE_INDEX   3

◆ UNKNOWN_TYPE

#define UNKNOWN_TYPE   0xFF

◆ WAIT_FIRMWARE_READY_DELAY_S

#define WAIT_FIRMWARE_READY_DELAY_S   1

Typedef Documentation

◆ freya_fw_info

typedef struct _freya_fw_info freya_fw_info

◆ freya_info

typedef struct _freya_info freya_info

◆ switch_error_check_info

◆ vr_fw_info

typedef struct _vr_fw_info vr_fw_info

◆ wait_fw_update_status_info

Enumeration Type Documentation

◆ ATM_EXEC_RESULT

Enumerator
EXEC_RESULT_PASS 
EXEC_RESULT_ABORTED 
EXEC_RESULT_FAIL 
EXEC_RESULT_DEFAULT 

◆ ATM_EXEC_STATUS

Enumerator
EXEC_STATUS_IDLE 
EXEC_STATUS_RUNNING 
EXEC_STATUS_COMPLETE 
EXEC_STATUS_TIMEOUT 
EXEC_STATUS_DEFAULT 

◆ FREYA_ID

enum FREYA_ID
Enumerator
FREYA_ID1 
FREYA_ID2 

Function Documentation

◆ atm_fw_update()

int atm_fw_update ( uint8_t  bus,
uint8_t  addr,
uint32_t  offset,
uint8_t *  msg_buf,
uint16_t  buf_len,
uint32_t  image_size,
bool  is_end_package 
)
Here is the call graph for this function:

◆ clear_accl_cable_power_fault_flag()

void clear_accl_cable_power_fault_flag ( )

◆ clear_freya_cache_flag()

void clear_freya_cache_flag ( uint8_t  card_id)
Here is the call graph for this function:

◆ clear_sw_error_check_flag()

void clear_sw_error_check_flag ( )

◆ get_boot1_complete_bit()

int get_boot1_complete_bit ( uint8_t  bus,
uint8_t  addr,
uint8_t *  bit 
)
Here is the call graph for this function:

◆ get_freya_fw_info()

int get_freya_fw_info ( uint8_t  bus,
uint8_t  addr,
freya_fw_info fw_info 
)
Here is the call graph for this function:

◆ get_switch_error_status()

void get_switch_error_status ( uint8_t  sensor_num,
uint8_t  bus,
uint8_t  addr,
uint8_t  index 
)
Here is the call graph for this function:

◆ init_clk_gen_spread_spectrum_control_register()

void init_clk_gen_spread_spectrum_control_register ( )
Here is the call graph for this function:

◆ init_sw_heartbeat_work()

void init_sw_heartbeat_work ( )
Here is the call graph for this function:

◆ init_vr_write_protect()

bool init_vr_write_protect ( uint8_t  bus,
uint8_t  addr,
uint8_t  default_val 
)
Here is the call graph for this function:

◆ is_sw_ready()

bool is_sw_ready ( uint8_t  sensor_num)

Variable Documentation

◆ accl_freya_info

freya_info accl_freya_info[]
extern

◆ atm_wait_fw_info

wait_fw_update_status_info atm_wait_fw_info
extern

◆ cb_vr_fw_info

vr_fw_info cb_vr_fw_info
extern

◆ sw_error_check_info

switch_error_check_info sw_error_check_info[]
extern