From ec514f10e501909d6016e627cfba069d2b0720de Mon Sep 17 00:00:00 2001 From: liweihua Date: Mon, 24 Jul 2023 19:59:22 +0800 Subject: [PATCH] 1 delete UCP_API_JESD_PlatformSetup() and UCP_API_RFIC_CellInit() in drv_init; 2 call UCP_API_RFIC_CellInit() in main --- app/src/main.c | 7 ++++++ driver/init/src/drv_init.s.c | 12 ---------- driver/rfic | 2 +- driver/tfu | 2 +- interface/ucp_api_jesd.h | 43 +++++++++++++++++++++++++++++++++--- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/app/src/main.c b/app/src/main.c index 67b663c..712e501 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -29,6 +29,10 @@ int32_t test_case(uint32_t argc, int32_t* argvp); extern OSP_STATUS osp_init(); extern uint8_t osp_sw_queue_init(); +#ifdef ENABLE_JESD_TEST +extern int32_t UCP_API_RFIC_CellInit(void); +#endif + #define MAX_PARA_NUM 4 int32_t main(int32_t argc, char* argvp[]) @@ -42,6 +46,9 @@ int32_t main(int32_t argc, char* argvp[]) CPU_SET(4,&mask); sched_setaffinity(0,sizeof(cpu_set_t),&mask); +#ifdef ENABLE_JESD_TEST + UCP_API_RFIC_CellInit(); +#endif osp_init(); drv_init(); diff --git a/driver/init/src/drv_init.s.c b/driver/init/src/drv_init.s.c index 720685b..e05fe77 100644 --- a/driver/init/src/drv_init.s.c +++ b/driver/init/src/drv_init.s.c @@ -9,11 +9,6 @@ #include "arm_csu.h" #include "ucp_printf.h" -#ifdef ENABLE_JESD_TEST -extern void UCP_API_JESD_PlatformSetup (void); -extern int32_t UCP_API_RFIC_CellInit(void); -#endif - int32_t g_drv_mem_fd = -1; uint32_t *g_stc_regs_ptr = NULL; //0x08568000 @@ -60,13 +55,6 @@ int32_t init_stc() int32_t drv_init(void) { -#ifdef ENABLE_JESD_TEST - UCP_API_JESD_PlatformSetup(); - UCP_API_RFIC_CellInit(); - //UCP_API_RFIC_CellSetup(2575770000u, 2575770000u, 100000000u, 0); - usleep(100000); -#endif - if(0 != arm_csu_init()) { UCP_PRINT_ERROR("Init arm csu error!!"); diff --git a/driver/rfic b/driver/rfic index 8ea4378..99d6653 160000 --- a/driver/rfic +++ b/driver/rfic @@ -1 +1 @@ -Subproject commit 8ea437815106d50f2230e0b3989f7f7174ac0fed +Subproject commit 99d6653cd9acb4b2797ec3c36252f0c80dcf0895 diff --git a/driver/tfu b/driver/tfu index 7bd0c4a..7908793 160000 --- a/driver/tfu +++ b/driver/tfu @@ -1 +1 @@ -Subproject commit 7bd0c4a6b87b70cf28b0c47eea74b731c9e90e38 +Subproject commit 7908793098da2a3fcc5da3f3f2831c84fe4947f7 diff --git a/interface/ucp_api_jesd.h b/interface/ucp_api_jesd.h index d403dc5..57cf370 100644 --- a/interface/ucp_api_jesd.h +++ b/interface/ucp_api_jesd.h @@ -35,6 +35,30 @@ typedef enum ucp_jesd_States UCP_JESD_STATE_RUN = 0x40 } ucp_jesd_States_e; +/** + * \brief Data structure to ape working step + */ +typedef enum ucp_jesd_ApeWorkStep +{ + UCP_JESD_APE_POWERONRESET = 0x00, + UCP_JESD_APE_CLOCKGENRUN = 0x01, + UCP_JESD_APE_CELLRUN = 0x02, +} ucp_jesd_ApeWorkStep_e; + +/** + * \brief Data structure to contrl pins of rf's trx + */ +typedef struct ucp_jesd_TrxGpio { + uint8_t ch0_tx_gpio_index; + uint8_t ch0_rx_gpio_index; + uint8_t ch1_tx_gpio_index; + uint8_t ch1_rx_gpio_index; + uint8_t ch2_tx_gpio_index; + uint8_t ch2_rx_gpio_index; + uint8_t ch3_tx_gpio_index; + uint8_t ch3_rx_gpio_index; +} ucp_jesd_TrxGpio_t; + /** * \brief Data structure to hold digital clock settings */ @@ -99,13 +123,25 @@ typedef struct ucp_jesd_Init extern uint32_t UCP_API_JESD_Version(void); /** -* \brief Sets up the ucp4008 jesd module's working environment +* \brief Sets up the ape work step * -* \param void +* \param step +* UCP_JESD_APE_POWERONRESET: when jesd reset or power up, set this value +* UCP_JESD_APE_CLOCKGENRUN: when clock gen chip sets up, set this value +* UCP_JESD_APE_CELLRUN: when cell and trx set up, set this value * * \retval none. */ -extern void UCP_API_JESD_PlatformSetup (void); +extern void UCP_API_JESD_ApeWorkStep(ucp_jesd_ApeWorkStep_e step); + +/** +* \brief Sets up the gpios of tx and rx +* +* \param setting +* +* \retval none. +*/ +extern void UCP_API_JESD_TrxGpioSetup (ucp_jesd_TrxGpio_t *gpio); /** * \brief Sets up the ucp4008 jesd's para setting @@ -139,3 +175,4 @@ extern void UCP_API_JESD_CellDelete (void); #endif #endif /* #ifndef UCP_API_JESD_H_ */ +