From 430c98b59a2e39ddba52692d9bee5baecd3911c9 Mon Sep 17 00:00:00 2001 From: "xinxin.li" Date: Tue, 5 Sep 2023 11:10:46 +0800 Subject: [PATCH] 1.delete the test code for cell build/delete in ECS_RFM1 main function; 2.move check_phy_cell to mtimer_init4phy function; 3.delete jesd rx1 timer init; 4.delete some test code in the cpri/jesd timer isr function; 5.add some necessary function declaration in the interface folder; 6.test case: case21(cpri and jesd), case34, case44. --- inc/drv_rfm.h | 98 +++---------------- inc/osp_ape.h | 10 +- .../ecs_rfm_spu1/driver/src/cpri_driver.s.c | 4 +- public/ecs_rfm_spu1/driver/src/cpri_timer.s.c | 2 +- public/ecs_rfm_spu1/driver/src/jesd_timer.s.c | 4 +- .../ecs_rfm_spu1/driver/src/mtimer_cell.s.c | 22 +++++ public/ecs_rfm_spu1/top/src/main.s.c | 4 +- 7 files changed, 51 insertions(+), 93 deletions(-) diff --git a/inc/drv_rfm.h b/inc/drv_rfm.h index 3a6620f..29d7b31 100644 --- a/inc/drv_rfm.h +++ b/inc/drv_rfm.h @@ -102,98 +102,26 @@ typedef struct phy_timer_config_ind_t uint8_t num_ants; //天线个数 }phy_timer_config_ind_t; +typedef struct _tagPhyDelCell +{ + uint32_t scsId; + uint32_t delCoreId; // 此次需要删除小区的ape core id,bitmap方式,bit0对应ape0,bit1对应ape1,。。。 +}stPhyDelCell; + /* - 函数名称:cpri_timer_init4buildcell_c0 + 函数名称:mtimer_init4phy 函数入参:my_cpritmr:小区参数 - 函数功能:小区创建时,定时器参数配置接口 + 函数功能:小区创建时,定时器参数配置接口,先走ecs rfm1的建小区流程,再通知APE建小区 */ -void mtimer_init4phy(phy_timer_config_ind_t *my_mtmr); -//void cpri_timer_init4buildcell_c0(phy_timer_config_ind_t *my_cpritmr); -//void jesd_timer_init4buildcell_c0(phy_timer_config_ind_t *my_cpritmr); +int32_t mtimer_init4phy(phy_timer_config_ind_t *my_mtmr); /* - 函数名称:get_tx_nr_sfn - 函数入参:scs - 函数功能:获取发送帧号 + 函数名称:mtimer_del_cell_cfg + 函数入参:delCell:待删除的小区参数 + 函数功能:删小区,先通知APE删除任务和定时点,再走ecs rfm1的删小区流程 */ -int get_tx_nr_sfn(uint8_t scs); +int32_t mtimer_del_cell_cfg(stPhyDelCell* delCell); -/* - 函数名称:get_tx_lte_sfn - 函数入参:无 - 函数功能:获取发送帧号 -*/ -int get_tx_lte_sfn(); - -/* - 函数名称:get_tx_slot - 函数入参:scs - 函数功能:获取发送时隙号 -*/ -int get_tx_nr_slot(uint8_t scs); - -/* - 函数名称:get_tx_subframe - 函数入参:无 - 函数功能:获取发送时隙号 -*/ -int get_tx_lte_subframe(); - -/* - 函数名称:get_rx_nr_sfn - 函数入参:scs - 函数功能:接收帧号 -*/ -int get_rx_nr_sfn(uint8_t scs); - -/* - 函数名称:get_rx_nr_sfn - 函数入参:无 - 函数功能:接收帧号 -*/ -int get_rx_lte_sfn(); - -/* - 函数名称:get_rx_slot - 函数入参:scs - 函数功能:接收时隙号 -*/ -int get_rx_nr_slot(uint8_t scs); - -/* - 函数名称:get_rx_subframe - 函数入参:无 - 函数功能:接收时隙号 -*/ -int get_rx_lte_subframe(); - -/* - 函数名称:get_tx_nr_slot_cycle - 函数入参:scs - 函数功能:获取发送时隙偏移,单位为ns -*/ -int get_tx_nr_slot_cycle(uint8_t scs); - -/* - 函数名称:get_tx_lte_slot_cycle - 函数入参:scs - 函数功能:获取发送时隙偏移,单位为ns -*/ -int get_tx_lte_subframe_cycle(); - -/* - 函数名称:get_rx_nr_slot_cycle - 函数入参:scs - 函数功能:获取接收时隙偏移,单位为ns -*/ -int get_rx_nr_slot_cycle(uint8_t scs); - -/* - 函数名称:get_rx_lte_slot_cycle - 函数入参:scs - 函数功能:获取接收时隙偏移,单位为ns -*/ -int get_rx_lte_subframe_cycle(); /* 函数名称:get_cpri_delay diff --git a/inc/osp_ape.h b/inc/osp_ape.h index ba2045d..41bbd2f 100644 --- a/inc/osp_ape.h +++ b/inc/osp_ape.h @@ -84,9 +84,17 @@ extern int osp_task_create(osp_task_info_ex *); /* 函数名称:osp_del_task 函数入参:prio : 待删除的任务的优先级 + 函数入参:scsId: scs id 函数功能:任务删除接口 */ -extern void osp_del_task(int prio); +osp_del_task(int prio, int scsId); + +/* + 函数名称:osp_var_init + 函数入参:无 + 函数功能:设置配置文件标识位 +*/ +void osp_var_init(void); /* 函数名称:smart_int_disable diff --git a/public/ecs_rfm_spu1/driver/src/cpri_driver.s.c b/public/ecs_rfm_spu1/driver/src/cpri_driver.s.c index 5dd4baa..dc3763c 100644 --- a/public/ecs_rfm_spu1/driver/src/cpri_driver.s.c +++ b/public/ecs_rfm_spu1/driver/src/cpri_driver.s.c @@ -2510,7 +2510,7 @@ void jecspma_recrx_reset() } void init_cpri(uint32_t cpri_speed_sel) { - //uint32_t resynctimes = 0; + uint32_t resynctimes = 0; //JECS_CTRL_PROTOCOL_SEL = JECS_CTRL_PROTOCOL_SEL | BIT4;//cpri tx pma sel jecs do_write(&JECS_CTRL_PROTOCOL_SEL, do_read_volatile(&JECS_CTRL_PROTOCOL_SEL) | BIT4); init_cpri_pma_rst(); @@ -2602,7 +2602,7 @@ void init_cpri(uint32_t cpri_speed_sel) { } jecspma_recrx_eq(); -#if 0 +#if 1 delay_us(10000); for(uint32_t i=0;i<3000;i++) { diff --git a/public/ecs_rfm_spu1/driver/src/cpri_timer.s.c b/public/ecs_rfm_spu1/driver/src/cpri_timer.s.c index 46e8972..1dd865f 100644 --- a/public/ecs_rfm_spu1/driver/src/cpri_timer.s.c +++ b/public/ecs_rfm_spu1/driver/src/cpri_timer.s.c @@ -671,7 +671,7 @@ uint32_t start = GET_STC_CNT(); #endif pMtimerInt->pp1sIntCnt++; debug_write((DBG_DDR_IDX_DRV_BASE+64+1), pMtimerInt->pp1sIntCnt); // 0x104 -#ifdef PALLADIUM_TEST +#if 0 //def PALLADIUM_TEST //debug_write((DBG_DDR_IDX_DRV_BASE+576+(gCpriTimerPara.pp1sIntCnt&0x3f)), get_tx_nr_slot(1)); // 0xB7E06900 uint32_t val = 0; diff --git a/public/ecs_rfm_spu1/driver/src/jesd_timer.s.c b/public/ecs_rfm_spu1/driver/src/jesd_timer.s.c index fd6e661..bafd647 100644 --- a/public/ecs_rfm_spu1/driver/src/jesd_timer.s.c +++ b/public/ecs_rfm_spu1/driver/src/jesd_timer.s.c @@ -75,7 +75,7 @@ void jesd_init() #endif jesd_mtimer_init(MTIMER_JESD_RX0_ID, NR_SCS_30K, 10); - jesd_mtimer_init(MTIMER_JESD_RX1_ID, NR_SCS_30K, 10); + //jesd_mtimer_init(MTIMER_JESD_RX1_ID, NR_SCS_30K, 10); #ifdef PALLADIUM_TEST flag++; debug_write((DBG_DDR_IDX_DRV_BASE+2+(apeId<<2)), flag); // 0xB8 @@ -862,7 +862,7 @@ uint32_t start = GET_STC_CNT(); pMtimerInt->pp1sIntCnt++; debug_write((DBG_DDR_IDX_DRV_BASE+64+1), pMtimerInt->pp1sIntCnt); // 0x104 -#ifdef PALLADIUM_TEST +#if 0 //def PALLADIUM_TEST uint32_t val = 0; for (int32_t core = 0; core < 12; core++) { diff --git a/public/ecs_rfm_spu1/driver/src/mtimer_cell.s.c b/public/ecs_rfm_spu1/driver/src/mtimer_cell.s.c index 8c4d47d..e4cce1f 100644 --- a/public/ecs_rfm_spu1/driver/src/mtimer_cell.s.c +++ b/public/ecs_rfm_spu1/driver/src/mtimer_cell.s.c @@ -14,6 +14,9 @@ extern uint32_t gScsId; extern uint32_t gMtimerId; extern stSfnPara gCellSfnPara[2]; // cell para extern stPhyScsPara* phyPara; +extern uint32_t reCfgFlag; + +extern void check_phy_cell(void); void phy_cell_para_init(int32_t nScsId) { @@ -47,6 +50,9 @@ void mtimer_init4phy(phy_timer_config_ind_t *mtmr) gMtimerId = MTIMER_JESD_RX0_ID; #endif do_write((&(pPhyCellPara->flag)), PHY_CELL_FLAG); + __ucps2_synch(f_SM); + + check_phy_cell(); } // Сecs rfm1ĽС̣֪ͨAPE @@ -118,6 +124,10 @@ int32_t mtimer_reconfig(phy_timer_config_ind_t *my_mtmr) flag++; debug_write((DBG_DDR_IDX_DRV_BASE+32), flag); // 0xb7e06080 #ifdef DISTRIBUTED_BS + while (0 != reCfgFlag) // wait last cell built finished + { + debug_write((DBG_DDR_IDX_DRV_BASE+36), reCfgFlag); // 0xb7e06090 + } if (-1 == set_cpri_ape_slot_offset(my_mtmr->runCoreId)) { flag++; @@ -127,6 +137,10 @@ int32_t mtimer_reconfig(phy_timer_config_ind_t *my_mtmr) } #endif #ifdef INTEGRATED_BS + while (0 != reCfgFlag) // wait last cell built finished + { + debug_write((DBG_DDR_IDX_DRV_BASE+36), reCfgFlag); // 0xb7e06090 + } if (-1 == set_jesd_ape_slot_offset(MTIMER_JESD_RX0_ID, my_mtmr->runCoreId)) { flag++; @@ -156,6 +170,10 @@ int32_t mtimer_reconfig(phy_timer_config_ind_t *my_mtmr) { do_write_short((&(phyPara[nScsId].mtimerId)), SCS_2nd_MTIMER_ID); #ifdef DISTRIBUTED_BS + while (0 != reCfgFlag) // wait last cell built finished + { + debug_write((DBG_DDR_IDX_DRV_BASE+36), reCfgFlag); // 0xb7e06090 + } ecpri_timer_reconfig(my_mtmr); if (-1 == set_ecpri_ape_slot_offset(my_mtmr->runCoreId)) { @@ -163,6 +181,10 @@ int32_t mtimer_reconfig(phy_timer_config_ind_t *my_mtmr) } #endif #ifdef INTEGRATED_BS + while (0 != reCfgFlag) // wait last cell built finished + { + debug_write((DBG_DDR_IDX_DRV_BASE+36), reCfgFlag); // 0xb7e06090 + } jesd_timer_reconfig(MTIMER_JESD_RX1_ID, my_mtmr); if (-1 == set_jesd_ape_slot_offset(MTIMER_JESD_RX1_ID, my_mtmr->runCoreId)) { diff --git a/public/ecs_rfm_spu1/top/src/main.s.c b/public/ecs_rfm_spu1/top/src/main.s.c index f83cb80..de45e96 100644 --- a/public/ecs_rfm_spu1/top/src/main.s.c +++ b/public/ecs_rfm_spu1/top/src/main.s.c @@ -83,7 +83,7 @@ int32_t main(int32_t argc, char* argv[]) check_test_outcome(0); #endif -#if 1 +#if 0 if (1 == do_read_volatile(0x0A4D726C)) { #ifdef CPRI_TIMING_7D2U_TEST @@ -98,7 +98,6 @@ int32_t main(int32_t argc, char* argv[]) { check_phy_cell(); } -#endif if (3 == do_read_volatile(0x0A4D726C)) { #ifdef CPRI_TIMING_7D2U_TEST @@ -121,6 +120,7 @@ int32_t main(int32_t argc, char* argv[]) #endif do_write(0x0A4D726C, 0); } +#endif phy_queue_polling();