yb_arm/interface/arm_interface.h

144 lines
3.8 KiB
C
Raw Permalink Normal View History

2023-07-12 14:14:31 +08:00
#ifndef __ARM_INTERFACE_H__
#define __ARM_INTERFACE_H__
typedef int OSP_STATUS;
/********************** header files **********************/
#include "msg_transfer_layer.h"
#include "ospHeap.h"
typedef enum
{
ZERO_FLAG = 0, /*0标志*/
TRUE_FLAG /*1 标志*/
}clk_flag_e;
typedef enum
{
CLK_DISABLE = 0, /* clock unuseable status */
CLK_WARM_UP = 1, /* warm up status */
CLK_TRACKING, /* tracking status */
CLK_HOLD_OVER /* hold over status */
}clk_sync_state_e;
typedef struct
{
uint32_t common_alarm;
uint32_t hold_over_time;
clk_sync_state_e status;
}clock_module_status_s;
/****************** Msg_transfer function *****************/
/*
name: msg_transfer_mem_init
para: null
brief: msg_transfer memory init(before call msg_transfer_init)
*/
void msg_transfer_mem_init(void);
/*
name: ucp_handshake
para: null
brief: handshake with host(after call msg_transfer_init)
*/
void ucp_handshake(void);
/*
name: rx_callback_oam
para: Input: buf: the address of the data
para: Input: payloadSize: the length of the data
brief: ape/rfm log receive callback
*/
uint32_t rx_callback_oam(const char* buf,uint32_t payloadSize);
/********************** Init function *********************/
/*
name: osp_init
para: null
brief: osp function init
*/
OSP_STATUS osp_init();
/********************** set task function *********************/
/*
name: osp_set_taskcpu
para: uint8_t cpu :0-7
para: uint8_t pri :1-99
brief: osp function init
return value:0:success
*/
int32_t osp_set_taskcpu(uint8_t cpu, uint8_t pri);
2023-07-12 14:14:31 +08:00
uint32_t read_stc_local_timer(void);
/*
name: drv_init
para: null
brief: drv function init
*/
int32_t drv_init(void);
/*
name: get_heartbeat_status
para: null
brief: get the status of spu cores
return value: 0:success other:bitmap for all cores(1:missing heartbeat)
*/
uint32_t get_heartbeat_status(void);
2023-07-12 14:14:31 +08:00
/**********************************************************************************************/
/* testmac interface */
/********************** Init function *********************/
/*
name: osp_arm_log_proc
para: Input: pbuf: the log's address
para: Input: len: the log's length
para: Input: logid: the log's id
para: Input: msg_type: the log's type
brief: arm log output
*/
OSP_STATUS osp_arm_log_proc(char *pbuf, uint32_t len ,uint32_t logid, uint32_t msg_type);
/********************** Osp function *********************/
/*
name: osp_read_spe_cfg_file
para: Input: path: the config file's path
brief: load the spe config file by the path
*/
2025-05-20 01:51:25 +08:00
int32_t osp_read_spe_cfg_file(char* path);
2023-07-12 14:14:31 +08:00
/*
name: osp_get_cfg_file
para: Input: name: the config file's name
para: Output: paddr: the config file's address
para: Output: psize: the config file's size
brief: get a config file's address and size
*/
2025-05-20 01:51:25 +08:00
int32_t osp_get_cfg_file(char* name, uint64_t *paddr, uint32_t *psize);
2023-07-12 14:14:31 +08:00
int32_t get_clock_module_status(volatile clock_module_status_s* clk_module_status_ptr);
int32_t set_clk_mode(clk_flag_e pseudo_flag);
/* arm csu function */
int arm_csu_dma_1D_transfer(uint64_t addrSrc, uint64_t addrDst, uint32_t dataLen);
int arm_csu_wait_done(uint8_t tag);
2023-07-12 14:14:31 +08:00
2024-01-09 14:11:50 +08:00
/*
osp_insert_cmd
name : shell命令11
pfunc : shell命令的回调函数
desc : shell命令的描述
argnum : shell命令的参数个数,6
shell命令
return value:0:success -1:error
使USHELL_PRINT
USHELL_PRINT("arg1:%d arg2:%d arg3:%d\n", arg1, arg2, arg3);
*/
int32_t osp_insert_cmd(char *name, OSP_FUNCPTR pfunc, char *desc, uint32_t argnum);
void osp_ushell_output(const char *fmt, ...);
#define USHELL_PRINT(fmt, args...) osp_ushell_output(fmt "\n", ##args)
2023-07-12 14:14:31 +08:00
#endif /* __ARM_INTERFACE_H__ */