YB_Platform/inc/osp_rfm.h
lishuang.xie 8c59de6c96 1. update New Feature#945 to dev_ck_v2.1
2. update New Feature#1347 to dev_ck_v2.1
3. add new interface for ecs rfm1 and ape: spu_get_oam_handle_id for get oam handle_id by inst_id
4. Move Mem_init() from ape to ecs rfm1
5. TEST:
   5.1 spu(case0)+arm(case0):  pass
   5.2 spu(case14)+arm(case20):pass
   5.3 spu(case20)+arm(case20):pass
   5.4 spu(case21)+arm(case21):pass
   5.5 spu(case34)+arm(case5): pass
   5.6 spu(case44)+arm(case5): pass
2023-12-06 17:43:42 +08:00

111 lines
4.1 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __OSP_RFM_INTERFACE_H__
#define __OSP_RFM_INTERFACE_H__
/************************************************************************************/
/* shell相关接口定义 */
/************************************************************************************/
/* 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);
/************************************************************************************/
/* 消息通信相关接口 */
/************************************************************************************/
/* calback function type */
typedef void(*ECS_HWQUE_IRQ_FUNC)();
/*
函数名称osp_alloc_msg
函数入参size消息大小
函数功能申请核间消息内存空间DDR
*/
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
函数功能:将消息通过硬件队列发给到指定硬件队列中
*/
int32_t 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);
/* hw queue callback function */
/*
函数名称ecs_hw_que_irq_callback
函数入参func回调函数
函数功能:当指定硬件队列收到消息时,调用回调函数进行后续处理
*/
void ecs_hw_que_irq_callback(ECS_HWQUE_IRQ_FUNC func);
/*
函数名称spu_get_oam_handle_id
函数入参inst_id小区编号0/1
函数功能根据小区编号返回对应的OAM队列的handle_id
*/
int32_t spu_get_oam_handle_id(uint8_t inst_id);
/************************************************************************************/
/* 其他相关接口 */
/************************************************************************************/
/*
函数名称osp_heap_malloc
函数功能从DDR里分配内存
函数参数size :需要分配的内存空间
函数返回值分配到的DDR内存地址
*/
extern char *osp_heap_malloc(uint32_t size);
/*
函数名称osp_heap_free
函数功能释放DDR里分配内存
函数参数:需要释放的内存空间
函数返回值:无
*/
extern void osp_heap_free(char *p);
#endif