Merge branch 'dev_ck_v2.1_bug#1953#' into 'dev_ck_v2.1'

fix bug#1953 from dev_ck_v2.1_bug#1953# to dev_ck_v2.1

See merge request ucp/driver/ucp4008_platform_spu!108
This commit is contained in:
Weihua Li 2024-05-20 01:07:39 +00:00
commit ef1a7a95ba
10 changed files with 561 additions and 14 deletions

View File

@ -43,6 +43,6 @@ extern void osp_timer_unsync(int scsId); /* 删除定时点任务配置信息
extern void osp_timer_unsync_notask(int scs_id); /* 只清空定时点配置信息和设备,未删除任务 */
extern void osp_timer_call_task(); /* 顺序触发定时点任务 */
extern void osp_timer_call_task_spe(uint8_t u8slot, uint8_t u8taskidx); /* 指定触发某定时点任务 */
extern void osp_register_task_group_show(void);
#endif /* __OSP_TIMER_H__ */

View File

@ -233,6 +233,7 @@ void osp_init()
#ifdef OSP_DEBUG_TEST
debug_write(OSP_DEBUG_POT(g_ape_id, 0), ++flag); //0x4
#endif
spu_insert_cmd_ext("reg_ape", (OSP_FUNCPTR)osp_register_task_group_show, "gu8_register_task_group", 0);
#if 0
/* DDR二次管理 */

View File

@ -94,19 +94,28 @@ void osp_timer_sync(int scsId)
#endif
int i = 0;
int j = 0;
int stc_timer_index = 0;
ape_mtimer_sync(scsId); // scs id
int tmp_bitmap;
int tbl_index = 0;
int slot_id = 0;
int j,tmp_cnt = 0;
int tmp_bitmap = 0;
int tbl_index = 0;
int slot_id = 0;
int tmp_cnt = 0;
osp_timer_desc *ptr = g_osp_timer_desc;
for(i = 0; i < g_osp_timer_desc_idx; i++)
{
tmp_bitmap = ptr->slot_bitmap;
tbl_index = ptr->t_offset/10;
if (tbl_index > 99) /* g_task_off_tbl[10][100] */
{
UCP_PRINT_ERROR("t_offset[%d] overflow", ptr->t_offset);
return ;
}
while(tmp_bitmap != 0)
{
slot_id = find_lsb(tmp_bitmap);
@ -121,10 +130,10 @@ void osp_timer_sync(int scsId)
if (tmp_cnt > 0)
{
for(i = 0; i < 10;i++)
for(i = 0; i < 10; i++)
{
stc_timer_index = 0;
for(j = 0; j < 100;j++)
for(j = 0; j < 100; j++)
{
if (OSP_TIMER_TASK_MAX <= stc_timer_index)
{
@ -138,17 +147,35 @@ void osp_timer_sync(int scsId)
stc_timer_index++;
lastOffset = 0;
if ((0 == g_task_off_tbl[i][j].t_offset) && (0 != g_task_off_tbl[i][j].task_id))
{
gu8_register_task_group[i][stc_timer_index-1] = (uint8_t)(g_task_off_tbl[i][j].task_id);
g_reg_task_index++;
}
else
if (0 == g_task_off_tbl[i][j].task_id)
{
/* 第一个点无task id 或偏移非0需要加一个假的 */
gu8_register_task_group[i][stc_timer_index-1] = 0;
g_reg_task_index++;
}
else
{
if (0 == g_task_off_tbl[i][j].t_offset)
{
/* 第一个点有真实数据,用真实数据 */
gu8_register_task_group[i][stc_timer_index-1] = (uint8_t)(g_task_off_tbl[i][j].task_id);
g_reg_task_index++;
}
else
{
/* 第一个点无task id 或偏移非0需要加一个假的 */
gu8_register_task_group[i][stc_timer_index-1] = 0;
g_reg_task_index++;
g_stcTimerPoint[i*OSP_TIMER_TASK_MAX + stc_timer_index].pointVal = g_task_off_tbl[i][j].t_offset - lastOffset; //g_stcTimerPoint[i*50 + stc_timer_index-1].pointVal;
g_stcTimerPoint[i*OSP_TIMER_TASK_MAX + stc_timer_index].lastFlag = 0;
lastOffset = g_task_off_tbl[i][j].t_offset;
stc_timer_index++;
gu8_register_task_group[i][stc_timer_index-1] = (uint8_t)(g_task_off_tbl[i][j].task_id);
g_reg_task_index++;
}
}
}
else
{
@ -181,6 +208,18 @@ void osp_timer_sync(int scsId)
return ;
}
void osp_register_task_group_show(void)
{
for(int i=0;i<10 ;i++)
{
for(int j=0;j<20;j++)
{
UCP_PRINT_ERROR("taskid:%d[%d,%d]",gu8_register_task_group[i][j],i,j);
}
}
}
void osp_timer_unsync(int scsId)
{
ape_mtimer_unsync(scsId); // scs id
@ -280,7 +319,7 @@ void osp_timer_call_task_spe(uint8_t u8slot, uint8_t u8taskidx)
#ifdef UCP_OSP_DBG_ENABLE
g_timer_task++;
debug_write(OSP_DEBUG_POT(g_ape_id, 95), g_timer_task);
debug_write(OSP_DEBUG_POT(g_ape_id, 92), task_id);
debug_write(OSP_DEBUG_POT(g_ape_id, 92), task_id);//ape1 0xb7e02530
#endif
osp_post_timer_event_sem(task_id);
}
@ -288,6 +327,8 @@ void osp_timer_call_task_spe(uint8_t u8slot, uint8_t u8taskidx)
{
#ifdef UCP_OSP_DBG_ENABLE
g_timer_notask++;
debug_write(OSP_DEBUG_POT(g_ape_id, 97), task_id);
debug_write(OSP_DEBUG_POT(g_ape_id, 98), u8taskidx);
debug_write(OSP_DEBUG_POT(g_ape_id, 96), g_timer_notask);
#endif
}

View File

@ -0,0 +1,61 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : ape_test_case1.s.c
// Author :
// Created On : 2022-10-26
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "typedef.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "rfm1_drv.h"
/************************************************************************/
extern void cpri_init(uint32_t option,uint32_t MappingMode);
extern void jesd_init();
extern void ecpri_init(uint8_t nOption);
int32_t fh_data_init(void)
{
return 0;
}
int32_t fh_drv_init()
{
stFrontHaulDrvPara fhDrvPara;
memset_ucp(&fhDrvPara, 0, sizeof(stFrontHaulDrvPara));
fhDrvPara.protocolSel = PROTOCOL_CPRI;
fhDrvPara.rateOption = CPRI_OPTION_8;
fhDrvPara.mapOption = OTIC_MAP_FIGURE12;
fronthaul_drv_cfg(&fhDrvPara);
return 0;
}
int32_t fh_csu_test_init(void)
{
return 0;
}
void fh_test_case()
{
return;
}
void fh_data_check(uint32_t times)
{
return;
}

View File

@ -0,0 +1,3 @@
spu_case1_arm_case20
test timer

View File

@ -0,0 +1,87 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : ape_test_case1.s.c
// Author :
// Created On : 2022-10-26
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "typedef.h"
#include "osp_task.h"
#include "osp_timer.h"
#include "ucp_printf.h"
/************************************************************************/
void ape0_event_task(uint32_t addr, uint32_t size);
void ape0_event_task1(uint32_t addr, uint32_t size);
void ape0_test_task_reg(void)
{
osp_task_info_ex ape0_event_task_info = {50, (int8_t*)"ape0_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape0_event_task};
osp_task_info_ex ape0_event_task_del = {51, (int8_t*)"ape0_event_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape0_event_task1};
osp_task_create(&ape0_event_task_info);
osp_task_create(&ape0_event_task_del);
return ;
}
/************************************************************************/
void ape1_event_task(uint32_t addr, uint32_t size);
void ape1_event_task1(uint32_t addr, uint32_t size);
void ape1_test_task_reg(void)
{
osp_task_info_ex ape1_event_task_info = {50, (int8_t*)"ape1_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape1_event_task};
osp_task_info_ex ape1_event_task_del = {51, (int8_t*)"ape1_event_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape1_event_task1};
osp_task_create(&ape1_event_task_info);
osp_task_create(&ape1_event_task_del);
return ;
}
/************************************************************************/
void ape2_event_task(uint32_t addr, uint32_t size);
void ape2_event_task1(uint32_t addr, uint32_t size);
void ape2_test_task_reg(void)
{
osp_task_info_ex ape2_event_task_info = {50, (int8_t*)"ape2_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape2_event_task};
osp_task_info_ex ape2_event_task_del = {51, (int8_t*)"ape2_event_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape2_event_task1};
osp_task_create(&ape2_event_task_info);
osp_task_create(&ape2_event_task_del);
return ;
}
/************************************************************************/
void ape3_event_task(uint32_t addr, uint32_t size);
void ape3_event_task1(uint32_t addr, uint32_t size);
void ape3_test_task_reg(void)
{
osp_task_info_ex ape3_event_task_info = {50, (int8_t*)"ape3_event_task", 50, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape3_event_task};
osp_task_info_ex ape3_event_task_del = {51, (int8_t*)"ape3_event_del", 51, 2048, OSP_EVENT_TYPE, 0, 0, 0, NULL, (OSP_TASKENTRY_FUNC)ape3_event_task1};
osp_task_create(&ape3_event_task_info);
osp_task_create(&ape3_event_task_del);
return ;
}
void ape4_test_task_reg(void)
{
return ;
}
void ape5_test_task_reg(void)
{
return ;
}
void ape6_test_task_reg(void)
{
return ;
}
void ape7_test_task_reg(void)
{
return ;
}

View File

@ -0,0 +1,89 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : case20_ape0_task.s.c
// Author :
// Created On : 2023-01-05
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "ucp_utility.h"
#include "ucp_tick.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "osp_msg.h"
#include "ucp_testcase.h"
#include "msg_transfer_layer.h"
#include "ucp_port.h"
#include "ape_mtimer.h"
#include "osp_task.h"
#include "osp_timer.h"
/***************************************************************/
/* 定时时任务相关打点 */
static uint32_t g_u32_case1_ape0_timer1_cnt = 0; // 32 0xB7E00080
static uint32_t g_u32_case1_ape0_timer2_cnt = 0; // 33 0xB7E00084
static uint32_t g_u32_case1_ape0_timer3_cnt = 0; // 34 0xB7E00088
/* 定时点任务 */
void ape0_timer1_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 32), ++g_u32_case1_ape0_timer1_cnt);
return;
}
void ape0_timer2_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 33), ++g_u32_case1_ape0_timer2_cnt);
return ;
}
void ape0_timer3_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 34), ++g_u32_case1_ape0_timer3_cnt);
return ;
}
/*************************************************************************/
/* 收到消息后创建任务 */
void ape0_event_task(uint32_t addr, uint32_t size)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x01010101);
osp_task_info_ex ape0_task_timer1 = {43, (int8_t*)"ape0_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 5, NULL, (OSP_TASKENTRY_FUNC)ape0_timer1_task};
osp_task_info_ex ape0_task_timer2 = {44, (int8_t*)"ape0_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 120, NULL, (OSP_TASKENTRY_FUNC)ape0_timer2_task};
osp_task_info_ex ape0_task_timer3 = {45, (int8_t*)"ape0_task_timer3", 45, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 400, NULL, (OSP_TASKENTRY_FUNC)ape0_timer3_task};
osp_task_create(&ape0_task_timer1);
osp_task_create(&ape0_task_timer2);
osp_task_create(&ape0_task_timer3);
osp_timer_sync(NR_SCS_30K);
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x03030303);
return;
}
/* 收到消息后删除任务 */
uint32_t gu32_ape0_del_task_cnt = 0;
void ape0_event_task1(uint32_t addr, uint32_t size)
{
osp_del_task(43, 1);
osp_del_task(44, 1);
osp_del_task(45, 1);
osp_timer_unsync(NR_SCS_30K);
return ;
}

View File

@ -0,0 +1,88 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : case20_ape1_task.s.c
// Author :
// Created On : 2023-01-05
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "ucp_utility.h"
#include "ucp_tick.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "osp_msg.h"
#include "ucp_testcase.h"
#include "msg_transfer_layer.h"
#include "ucp_port.h"
#include "ape_mtimer.h"
#include "osp_task.h"
#include "osp_timer.h"
/***************************************************************/
/* 定时时任务相关打点 */
static uint32_t g_u32_case1_ape1_timer1_cnt = 0; // 32 0xB7E00280
static uint32_t g_u32_case1_ape1_timer2_cnt = 0; // 33 0xB7E00284
static uint32_t g_u32_case1_ape1_timer3_cnt = 0; // 34 0xB7E00288
/* 定时点任务 */
void ape1_timer1_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 32), ++g_u32_case1_ape1_timer1_cnt);
return;
}
void ape1_timer2_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 33), ++g_u32_case1_ape1_timer2_cnt);
return ;
}
void ape1_timer3_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 34), ++g_u32_case1_ape1_timer3_cnt);
return ;
}
/*************************************************************************/
/* 收到消息后创建任务 */
void ape1_event_task(uint32_t addr, uint32_t size)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x01010101);
osp_task_info_ex ape1_task_timer1 = {43, (int8_t*)"ape1_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 6, NULL, (OSP_TASKENTRY_FUNC)ape1_timer1_task};
osp_task_info_ex ape1_task_timer2 = {44, (int8_t*)"ape1_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 220, NULL, (OSP_TASKENTRY_FUNC)ape1_timer2_task};
osp_task_info_ex ape1_task_timer3 = {45, (int8_t*)"ape1_task_timer3", 45, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 410, NULL, (OSP_TASKENTRY_FUNC)ape1_timer3_task};
osp_task_create(&ape1_task_timer1);
osp_task_create(&ape1_task_timer2);
osp_task_create(&ape1_task_timer3);
osp_timer_sync(NR_SCS_30K);
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x03030303);
return;
}
/* 收到消息后删除任务 */
void ape1_event_task1(uint32_t addr, uint32_t size)
{
osp_del_task(43, 1);
osp_del_task(44, 1);
osp_del_task(45, 1);
osp_timer_unsync(NR_SCS_30K);
return ;
}

View File

@ -0,0 +1,89 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : case20_ape2_task.s.c
// Author :
// Created On : 2023-01-05
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "ucp_utility.h"
#include "ucp_tick.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "osp_msg.h"
#include "ucp_testcase.h"
#include "msg_transfer_layer.h"
#include "ucp_port.h"
#include "ape_mtimer.h"
#include "osp_task.h"
#include "osp_timer.h"
/***************************************************************/
/* 定时时任务相关打点 */
static uint32_t g_u32_case1_ape2_timer1_cnt = 0; // 32 0xB7E00480
static uint32_t g_u32_case1_ape2_timer2_cnt = 0; // 33 0xB7E00484
static uint32_t g_u32_case1_ape2_timer3_cnt = 0; // 34 0xB7E00488
/* 定时点任务 */
void ape2_timer1_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 32), ++g_u32_case1_ape2_timer1_cnt);
return;
}
void ape2_timer2_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 33), ++g_u32_case1_ape2_timer2_cnt);
return ;
}
void ape2_timer3_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 34), ++g_u32_case1_ape2_timer3_cnt);
return ;
}
/*************************************************************************/
/* 收到消息后创建任务 */
void ape2_event_task(uint32_t addr, uint32_t size)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x01010101);
osp_task_info_ex ape2_task_timer1 = {43, (int8_t*)"ape2_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 7, NULL, (OSP_TASKENTRY_FUNC)ape2_timer1_task};
osp_task_info_ex ape2_task_timer2 = {44, (int8_t*)"ape2_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 180, NULL, (OSP_TASKENTRY_FUNC)ape2_timer2_task};
osp_task_info_ex ape2_task_timer3 = {45, (int8_t*)"ape2_task_timer3", 45, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 430, NULL, (OSP_TASKENTRY_FUNC)ape2_timer3_task};
osp_task_create(&ape2_task_timer1);
osp_task_create(&ape2_task_timer2);
osp_task_create(&ape2_task_timer3);
osp_timer_sync(NR_SCS_30K);
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x03030303);
return;
}
/* 收到消息后删除任务 */
void ape2_event_task1(uint32_t addr, uint32_t size)
{
osp_del_task(43, 1);
osp_del_task(44, 1);
osp_del_task(45, 1);
osp_timer_unsync(NR_SCS_30K);
return ;
}

View File

@ -0,0 +1,88 @@
// +FHDR------------------------------------------------------------
// Copyright (c) 2022 SmartLogic.
// ALL RIGHTS RESERVED
// -----------------------------------------------------------------
// Filename : case20_ape3_task.s.c
// Author :
// Created On : 2023-01-05
// Last Modified :
// -----------------------------------------------------------------
// Description:
//
//
// -FHDR------------------------------------------------------------
#include "ucp_utility.h"
#include "ucp_tick.h"
#include "ucp_printf.h"
#include "phy_para.h"
#include "osp_msg.h"
#include "ucp_testcase.h"
#include "msg_transfer_layer.h"
#include "ucp_port.h"
#include "ape_mtimer.h"
#include "osp_task.h"
#include "osp_timer.h"
/***************************************************************/
/* 定时时任务相关打点 */
static uint32_t g_u32_case1_ape3_timer1_cnt = 0; // 32 0xB7E00680
static uint32_t g_u32_case1_ape3_timer2_cnt = 0; // 33 0xB7E00684
static uint32_t g_u32_case1_ape3_timer3_cnt = 0; // 34 0xB7E00688
/* 定时点任务 */
void ape3_timer1_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 32), ++g_u32_case1_ape3_timer1_cnt);
return;
}
void ape3_timer2_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 33), ++g_u32_case1_ape3_timer2_cnt);
return ;
}
void ape3_timer3_task(void)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 34), ++g_u32_case1_ape3_timer3_cnt);
return ;
}
/*************************************************************************/
/* 收到消息后创建任务 */
void ape3_event_task(uint32_t addr, uint32_t size)
{
uint32_t ape_id = get_core_id();
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x01010101);
osp_task_info_ex ape3_task_timer1 = {43, (int8_t*)"ape3_task_timer1", 43, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 3, NULL, (OSP_TASKENTRY_FUNC)ape3_timer1_task};
osp_task_info_ex ape3_task_timer2 = {44, (int8_t*)"ape3_task_timer2", 44, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 190, NULL, (OSP_TASKENTRY_FUNC)ape3_timer2_task};
osp_task_info_ex ape3_task_timer3 = {45, (int8_t*)"ape3_task_timer3", 45, 2048, OSP_TIMER_TYPE, 0, 0x3ff, 300, NULL, (OSP_TASKENTRY_FUNC)ape3_timer3_task};
osp_task_create(&ape3_task_timer1);
osp_task_create(&ape3_task_timer2);
osp_task_create(&ape3_task_timer3);
osp_timer_sync(NR_SCS_30K);
debug_write(DBG_DDR_COMMON_IDX(ape_id, 29), 0x03030303);
return;
}
/* 收到消息后删除任务 */
void ape3_event_task1(uint32_t addr, uint32_t size)
{
osp_del_task(43, 1);
osp_del_task(44, 1);
osp_del_task(45, 1);
osp_timer_unsync(NR_SCS_30K);
return ;
}