2023-07-13 11:27:03 +08:00
|
|
|
|
#ifndef __OSP_APE_INTERFACE_H__
|
|
|
|
|
#define __OSP_APE_INTERFACE_H__
|
|
|
|
|
|
|
|
|
|
/****************************UCP2.0 Platform start***********************************/
|
2024-05-17 13:58:40 +08:00
|
|
|
|
|
|
|
|
|
#define MAX_BUF_VERSION_LEN (128)
|
|
|
|
|
|
|
|
|
|
typedef struct SpuVersionInfo {
|
|
|
|
|
char platform_commit[MAX_BUF_VERSION_LEN];
|
|
|
|
|
char platform_tag[MAX_BUF_VERSION_LEN];
|
|
|
|
|
char platform_build_date[MAX_BUF_VERSION_LEN/2];
|
|
|
|
|
} SpuVersionInfo_t;
|
|
|
|
|
|
2023-07-13 11:27:03 +08:00
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* shell相关接口定义 */
|
|
|
|
|
/************************************************************************************/
|
2024-05-17 13:58:40 +08:00
|
|
|
|
/*
|
|
|
|
|
* 函数名称: spu_show_version
|
|
|
|
|
* 函数入参: void
|
|
|
|
|
* 函数功能:输出SPU侧的版本信息
|
|
|
|
|
* ret: void
|
|
|
|
|
*/
|
|
|
|
|
void spu_show_version(void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 函数名称: 获取SPU侧的版本信息
|
|
|
|
|
* 函数入参: pVersion [out]: 版本信息结构体指针
|
|
|
|
|
* 函数功能:返回SPU侧版本信息
|
|
|
|
|
* ret: 0-success, 1-error
|
|
|
|
|
*/
|
|
|
|
|
int32_t spu_version_get(SpuVersionInfo_t *pVersion);
|
|
|
|
|
|
|
|
|
|
|
2023-07-13 11:27:03 +08:00
|
|
|
|
/* shell命令回调函数类型 */
|
|
|
|
|
typedef unsigned long (*OSP_FUNCPTR)();
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:spu_insert_cmd_ext
|
|
|
|
|
函数入参:name : shell命令,命令字格式:命令_ape,比如显示任务信息:i_ape,命令字不要超过7个字节
|
|
|
|
|
函数入参:pfunc : 对应shell命令的回调函数
|
|
|
|
|
函数入参:desc : 对应shell命令的描述
|
|
|
|
|
函数入参:argnum : 对应shell命令的参考个数
|
|
|
|
|
函数功能:动态注册shell命令
|
|
|
|
|
*/
|
|
|
|
|
void spu_insert_cmd_ext(char *name, OSP_FUNCPTR pfunc, char *desc, uint32_t argnum);
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 调试信息输出相关 */
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_sendLog
|
|
|
|
|
函数入参:level,固定传1
|
|
|
|
|
函数入参:pbuf,申请的buf地址,osp_msg_head预留
|
|
|
|
|
函数入参:size,消息大小
|
|
|
|
|
函数入参:cell_id,小区标识
|
|
|
|
|
函数功能:调试信息输出(字符串型接口)
|
|
|
|
|
*/
|
|
|
|
|
void osp_sendLog(int level, char* pbuf, int size, int cell_id);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_sendLog_print
|
|
|
|
|
函数入参:level,固定传1
|
|
|
|
|
函数入参:pbuf,申请的buf地址,osp_msg_head预留
|
|
|
|
|
函数入参:size,消息大小
|
|
|
|
|
函数入参:cell_id,小区标识
|
|
|
|
|
函数功能:调试信息输出(二进制型接口)
|
|
|
|
|
*/
|
|
|
|
|
void osp_sendLog_print(int level,char* pbuf, int size, int cell_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 任务相关接口定义 */
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 任务类型 */
|
|
|
|
|
typedef enum OSP_TASK_TYPE
|
|
|
|
|
{
|
|
|
|
|
OSP_NORMAL_TYPE, /* 周期性任务(普通任务),经测试1 tick是200ms */
|
|
|
|
|
OSP_TIMER_TYPE, /* 定时点触发任务 */
|
|
|
|
|
OSP_EVENT_TYPE, /* 事件触发任务 */
|
|
|
|
|
OSP_DRIVER_TYPE, /* 驱动任务 */
|
|
|
|
|
OSP_OSP_TYPE, /* 平台任务 */
|
|
|
|
|
}task_type;
|
|
|
|
|
|
|
|
|
|
/* 函数类型*/
|
|
|
|
|
typedef void(*OSP_TASKENTRY_FUNC)();
|
2024-01-29 09:54:23 +08:00
|
|
|
|
typedef int(*OSP_TASKINIT_FUNC)(void);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
|
|
|
|
|
/* 任务信息结构体 */
|
|
|
|
|
typedef struct OSP_TASK_INFO_EX
|
|
|
|
|
{
|
|
|
|
|
uint32_t task_id; /* 任务Id(物理层用:1-55) */
|
|
|
|
|
char *task_name; /* 任务名称(要求长度不能增加31字节) */
|
|
|
|
|
uint32_t task_prio; /* 任务优先级(物理层用:1-55,数字越小优先级越高) */
|
|
|
|
|
uint32_t stack_size; /* 堆栈大小 */
|
|
|
|
|
uint32_t task_type; /* 任务类型 : 当OSP_TIMER_TYPE时,s_bitmap和t_off才有效 */
|
|
|
|
|
uint32_t delay_value; /* 是否需要延时 0:不延时 ; n: 延时n个tick */
|
|
|
|
|
uint32_t s_bitmap; /* slot bit map : 最多支持10个时隙,每个时隙最多50个点 */
|
|
|
|
|
uint32_t t_off; /* 偏移时间 */
|
|
|
|
|
OSP_TASKINIT_FUNC task_init; /* 任务初始化 */
|
|
|
|
|
OSP_TASKENTRY_FUNC task_entry; /* 任务循环体 */
|
|
|
|
|
}osp_task_info_ex;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_task_create
|
|
|
|
|
函数入参:task_st_info *
|
|
|
|
|
函数功能:任务登记注册接口
|
|
|
|
|
*/
|
|
|
|
|
extern int osp_task_create(osp_task_info_ex *);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_del_task
|
|
|
|
|
函数入参:prio : 待删除的任务的优先级
|
2023-09-05 11:10:46 +08:00
|
|
|
|
函数入参:scsId: scs id
|
2023-07-13 11:27:03 +08:00
|
|
|
|
函数功能:任务删除接口
|
|
|
|
|
*/
|
2023-09-15 14:59:25 +08:00
|
|
|
|
extern void osp_del_task(int prio, int scsId);
|
2023-09-05 11:10:46 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_var_init
|
|
|
|
|
函数入参:无
|
|
|
|
|
函数功能:设置配置文件标识位
|
|
|
|
|
*/
|
2023-09-25 09:46:27 +08:00
|
|
|
|
extern void osp_var_init(void);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:smart_int_disable
|
|
|
|
|
函数功能:关中断
|
|
|
|
|
*/
|
|
|
|
|
extern void smart_int_disable(void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:smart_int_enable
|
|
|
|
|
函数功能:开中断
|
|
|
|
|
*/
|
|
|
|
|
extern void smart_int_enable(void);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
该接口目前无人维护,强烈建议不再使用
|
|
|
|
|
|
|
|
|
|
函数名称:osp_strlen
|
|
|
|
|
函数入参:str : 字符串
|
|
|
|
|
函数功能:获取字符串长度
|
|
|
|
|
*/
|
|
|
|
|
extern int osp_strlen(const char * str); /* 该接口目前无人维护,强烈建议不再使用 */
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 消息通信相关接口 */
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 消息类型 */
|
|
|
|
|
typedef enum OSP_MSG_TYPE
|
|
|
|
|
{
|
|
|
|
|
UCP4008_KERNEL_INTER = 0, /* 核间通信 */
|
|
|
|
|
UCP4008_OSP_HANDSHAKE = 7, /* 握手消息 */
|
|
|
|
|
UCP4008_OSP_CFG_FILE, /* 微码配置文件消息 */
|
|
|
|
|
UCP4008_OSP_DDR_INIT, /* DDR初始化配置消息 */
|
|
|
|
|
UCP4008_OSP_DUMP, /* DUMP消息 */
|
|
|
|
|
UCP4008_OSP_LOG, /* LOG消息 */
|
|
|
|
|
UCP4008_OSP_SHELL, /* Shell消息 */
|
|
|
|
|
UCP4008_OSP_SHELL_ECHO, /* Shell回显消息 */
|
|
|
|
|
UCP4008_KERNEL_INNER = 0xFF,/* 核内通信 */
|
|
|
|
|
}osp_msg_type;
|
|
|
|
|
|
|
|
|
|
#define OSP_MSG_HEAD_LEN (12) /* OSP消息头的长度(消息头的具体定义在osp_msg.h中) */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_alloc_msg
|
|
|
|
|
函数功能:申请消息通信的内存空间(根据约定均在DDR上)采用循环覆盖的方式,故接收放不需要释放
|
|
|
|
|
函数参数:size:真实消息的大小(单位:字节)
|
|
|
|
|
函数返回值:
|
|
|
|
|
非0: 申请到的消息首地址
|
|
|
|
|
-NULLPTR:申请失败
|
|
|
|
|
*/
|
|
|
|
|
extern char *osp_alloc_msg(int size);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_send_msg
|
|
|
|
|
函数功能:发送消息用于核间或者核内通信
|
|
|
|
|
函数参数:msg_addr:消息体的地址
|
|
|
|
|
msg_len:消息体的长度(单位:字节)
|
|
|
|
|
msg_type:消息类型
|
|
|
|
|
src_core_id:源核ID
|
|
|
|
|
dst_core_id:目的核ID
|
|
|
|
|
src_task_id:源任务ID
|
|
|
|
|
dst_task_id:目的任务ID
|
|
|
|
|
函数返回值:
|
|
|
|
|
0: 成功返回
|
|
|
|
|
-2: 入参错误
|
|
|
|
|
-1: 错误返回
|
|
|
|
|
*/
|
|
|
|
|
extern int osp_send_msg(uint32_t msg_addr,
|
|
|
|
|
uint32_t msg_len,
|
|
|
|
|
uint8_t msg_type,
|
|
|
|
|
uint8_t src_core_id,
|
|
|
|
|
uint8_t dst_core_id,
|
|
|
|
|
uint8_t src_task_id,
|
|
|
|
|
uint8_t dst_task_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 配置文件相关接口 */
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_get_cfgfile
|
|
|
|
|
函数功能:获取微码配置文件的DDR地址及长度
|
|
|
|
|
函数参数:name:微码配置文件名称(约定长度不能超过64字节)
|
|
|
|
|
pbuf:DDR中的地址
|
|
|
|
|
psize:DDR中配置文件的长度
|
|
|
|
|
函数返回值:
|
|
|
|
|
0: 成功返回
|
|
|
|
|
-1: 错误返回
|
|
|
|
|
-2: 入参错误
|
|
|
|
|
*/
|
|
|
|
|
extern int osp_get_cfgfile(char* name, uint32_t *pbuf, int* psize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/* 定时点相关接口 */
|
|
|
|
|
/************************************************************************************/
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_timer_sync
|
|
|
|
|
函数功能:使能定时点任务
|
|
|
|
|
函数参数:int scsId:子载波ID号
|
|
|
|
|
typedef enum _tagScsID
|
|
|
|
|
{
|
|
|
|
|
LTE_SCS_ID = 0,
|
|
|
|
|
NR_SCS_30K,
|
|
|
|
|
NR_SCS_60K,
|
|
|
|
|
NR_SCS_120K,
|
|
|
|
|
SCS_NULL = 0xFFFF
|
|
|
|
|
}numScsID;
|
|
|
|
|
|
|
|
|
|
函数返回值:无
|
|
|
|
|
*/
|
2023-09-22 19:47:02 +08:00
|
|
|
|
extern void osp_timer_sync(int scsId); /* 使能任务定时点 */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
函数名称:osp_timer_unsync
|
|
|
|
|
函数功能:删小区时,用于定时点中断、任务及时隙中断
|
|
|
|
|
函数参数:int scsId:子载波ID号
|
|
|
|
|
typedef enum _tagScsID
|
|
|
|
|
{
|
|
|
|
|
LTE_SCS_ID = 0,
|
|
|
|
|
NR_SCS_30K,
|
|
|
|
|
NR_SCS_60K,
|
|
|
|
|
NR_SCS_120K,
|
|
|
|
|
SCS_NULL = 0xFFFF
|
|
|
|
|
}numScsID;
|
|
|
|
|
|
|
|
|
|
函数返回值:无
|
|
|
|
|
*/
|
|
|
|
|
extern void osp_timer_unsync(int scsId);
|
2023-07-13 11:27:03 +08:00
|
|
|
|
|
2023-12-06 17:43:42 +08:00
|
|
|
|
/*
|
|
|
|
|
函数名称:spu_get_oam_handle_id
|
|
|
|
|
函数入参:inst_id,小区编号(0/1)
|
|
|
|
|
函数功能:根据小区编号,返回对应的OAM队列的handle_id
|
|
|
|
|
*/
|
|
|
|
|
extern int32_t spu_get_oam_handle_id(uint8_t inst_id);
|
|
|
|
|
|
|
|
|
|
|
2023-07-13 11:27:03 +08:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|