Merge branch 'dev_ck_v2.1_feature_enhancement#1546#' into 'dev_ck_v2.1'
libstc.a与libmsgtransfer.a解耦 See merge request ucp/driver/ucp4008_platform_arm!44
This commit is contained in:
commit
47063b64b5
@ -26,6 +26,7 @@
|
||||
#include "ospShell.h"
|
||||
#include "ucp_printf.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
int32_t test_case(uint32_t argc, int32_t* argvp);
|
||||
|
||||
@ -130,6 +131,7 @@ int32_t main(int32_t argc, char* argvp[])
|
||||
osp_init();
|
||||
osp_set_taskcpu(7, 95);
|
||||
drv_init();
|
||||
init_stc();
|
||||
|
||||
#ifdef PALLADIUM_TEST
|
||||
UCP_PRINT_DEBUG("entered testmode.");
|
||||
|
6
build.sh
6
build.sh
@ -72,6 +72,12 @@ if [[ "${fronthaul_option}" == "jesd" ]]; then
|
||||
make
|
||||
fi
|
||||
|
||||
cd ${DIR_ROOT}/driver/tfu
|
||||
source ./build.sh
|
||||
cp build/libstc.a ${DIR_ROOT}/lib
|
||||
cp build/libstc.a ${BUILD_DIR}
|
||||
cp stc/inc/stc_drv_api.h ${DIR_ROOT}/interface
|
||||
|
||||
echo -e "\n"
|
||||
echo "###### start building msgTransfer.out and libmsgTransfer.a ######"
|
||||
cd ${DIR_ROOT}/
|
||||
|
@ -32,11 +32,11 @@
|
||||
uint8_t* virMemAddr = NULL;
|
||||
int arm_csu_init()
|
||||
{
|
||||
if (-1 == g_drv_mem_fd)
|
||||
if (-1 == g_drv_mem_fd0)
|
||||
{
|
||||
// printf("open dev mem. \r\n");
|
||||
g_drv_mem_fd = open("/dev/mem", O_RDWR|O_SYNC);
|
||||
if (0 > g_drv_mem_fd)
|
||||
g_drv_mem_fd0 = open("/dev/mem", O_RDWR|O_SYNC);
|
||||
if (0 > g_drv_mem_fd0)
|
||||
{
|
||||
UCP_PRINT_ERROR("open /dev/mem error\n");
|
||||
return -1;
|
||||
@ -44,7 +44,7 @@ int arm_csu_init()
|
||||
}
|
||||
|
||||
// printf("start mmap. \r\n");
|
||||
virMemAddr = (uint8_t*)mmap(NULL, CSU_DEV_MAP_LEN, PROT_READ|PROT_WRITE, MAP_SHARED, g_drv_mem_fd, AP_CSU_BASE);
|
||||
virMemAddr = (uint8_t*)mmap(NULL, CSU_DEV_MAP_LEN, PROT_READ|PROT_WRITE, MAP_SHARED, g_drv_mem_fd0, AP_CSU_BASE);
|
||||
if ((uint8_t*)(-1) == virMemAddr)
|
||||
{
|
||||
UCP_PRINT_ERROR("mmap error!!");
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "typedef.h"
|
||||
|
||||
extern int32_t g_drv_mem_fd;
|
||||
extern int32_t g_drv_mem_fd0;
|
||||
|
||||
#define STC_REG_BASE_ADDR (0x08568000)
|
||||
#define STC_REG_LEN (0x08000)
|
||||
@ -11,7 +11,7 @@ extern int32_t g_drv_mem_fd;
|
||||
|
||||
int32_t drv_init(void);
|
||||
uint64_t get_arm_cycle();
|
||||
uint32_t read_stc_local_timer();
|
||||
//uint32_t read_stc_local_timer();
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -9,8 +9,7 @@
|
||||
#include "arm_csu.h"
|
||||
#include "ucp_printf.h"
|
||||
|
||||
int32_t g_drv_mem_fd = -1;
|
||||
uint32_t *g_stc_regs_ptr = NULL; //0x08568000
|
||||
int32_t g_drv_mem_fd0 = -1;
|
||||
|
||||
uint64_t get_arm_cycle()
|
||||
{
|
||||
@ -21,52 +20,14 @@ uint64_t get_arm_cycle()
|
||||
return cycle;
|
||||
}
|
||||
|
||||
uint32_t read_stc_local_timer()
|
||||
{
|
||||
return *(g_stc_regs_ptr + STC_LTBG_REG_OFFSET);
|
||||
}
|
||||
|
||||
int32_t init_stc()
|
||||
{
|
||||
if(g_drv_mem_fd < 0)
|
||||
{
|
||||
g_drv_mem_fd = open("/dev/mem", O_RDWR|O_SYNC);
|
||||
if(g_drv_mem_fd < 0)
|
||||
{
|
||||
UCP_PRINT_ERROR("open /dev/mem error");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(g_stc_regs_ptr == NULL)
|
||||
{
|
||||
g_stc_regs_ptr = mmap(NULL, STC_REG_LEN, PROT_READ|PROT_WRITE, MAP_SHARED,
|
||||
g_drv_mem_fd, STC_REG_BASE_ADDR);
|
||||
if(-1 == (int64_t)g_stc_regs_ptr)
|
||||
{
|
||||
UCP_PRINT_ERROR("mmap stc regs error!! return = %ld\n",(uint64_t)g_stc_regs_ptr);
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t drv_init(void)
|
||||
{
|
||||
|
||||
if(0 != arm_csu_init())
|
||||
{
|
||||
UCP_PRINT_ERROR("Init arm csu error!!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(0 != init_stc())
|
||||
{
|
||||
UCP_PRINT_ERROR("Init stc error!!");
|
||||
return -3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 85a547fe18f6645a03489124eec040ad20ef116a
|
||||
Subproject commit 59d436372f6d310f582c10c62c709c26e488d0c8
|
@ -1 +1 @@
|
||||
Subproject commit 7bd0c4a6b87b70cf28b0c47eea74b731c9e90e38
|
||||
Subproject commit 81b543d4ec66acdde54865eec21a3b3a863520fe
|
@ -70,16 +70,24 @@ typedef enum ucp_jesd_gpioEnableLevel
|
||||
uint8_t enableLevel;
|
||||
} ucp_jesd_gpio_t;
|
||||
|
||||
typedef struct ucp_jesd_tr_gpio {
|
||||
ucp_jesd_gpio_t trx;
|
||||
ucp_jesd_gpio_t rf;
|
||||
ucp_jesd_gpio_t sw;
|
||||
} ucp_jesd_tr_gpio_t;
|
||||
|
||||
typedef struct ucp_jesd_TrxGpio {
|
||||
ucp_jesd_gpio_t tx;
|
||||
ucp_jesd_gpio_t rx;
|
||||
ucp_jesd_gpio_t orx;
|
||||
ucp_jesd_tr_gpio_t tx;
|
||||
ucp_jesd_tr_gpio_t rx;
|
||||
ucp_jesd_tr_gpio_t orx;
|
||||
} ucp_jesd_TrxGpio_t;
|
||||
|
||||
/**
|
||||
* \brief Data structure to configure of trx's contrl pins
|
||||
*/
|
||||
typedef struct ucp_jesd_TrxGpioCfg {
|
||||
char board[16];
|
||||
uint32_t version;
|
||||
uint8_t maxCh;
|
||||
uint8_t devClkSrc;
|
||||
int32_t uldelay;
|
||||
@ -93,8 +101,7 @@ typedef struct ucp_jesd_TrxGpioCfg {
|
||||
*/
|
||||
typedef struct ucp_jesd_CommonSettings
|
||||
{
|
||||
uint32_t devClock_kHz; /*!< Device clock frequency in kHz */
|
||||
uint32_t sampleClock_kHz; /*!< Sample clock frequency in kHz */
|
||||
uint32_t devClock_kHz; /*!< Device clock frequency in kHz */
|
||||
uint8_t enableJesd204C; /*!< 1= Enable JESD204C framer, 0 = use JESD204B framer */
|
||||
uint8_t jesdSubClass;
|
||||
} ucp_jesd_CommonSettings_t;
|
||||
@ -105,6 +112,7 @@ typedef struct ucp_jesd_CommonSettings
|
||||
typedef struct ucp_jesd_FrmCfg
|
||||
{
|
||||
uint8_t enable;
|
||||
uint32_t sampleClock_kHz; /*!< Sample clock frequency in kHz */
|
||||
uint8_t jesd204M; /*!< Number of ADCs (0, 2, or 4) where 2 ADCs are required per receive chain (I and Q). */
|
||||
uint16_t jesd204K; /*!< Number of frames in a multiframe. Default = 32, F*K must be modulo 4. Where, F=2*M/numberOfLanes (Max 32 for JESD204B, Max 256 for JESD204C). */
|
||||
uint8_t jesd204F; /*!< Number of bytes(octets) per frame (Valid 1, 2, 4, 8). */
|
||||
@ -122,6 +130,7 @@ typedef struct ucp_jesd_FrmCfg
|
||||
typedef struct ucp_jesd_DfrmCfg
|
||||
{
|
||||
uint8_t enable;
|
||||
uint32_t sampleClock_kHz; /*!< Sample clock frequency in kHz */
|
||||
uint8_t jesd204M; /*!< Number of DACs (0, 2, or 4) - 2 DACs per transmit chain (I and Q) */
|
||||
uint16_t jesd204K; /*!< Number of frames in a multiframe. Default = 32, F*K = modulo 4. Where, F=2*M/numberOfLanes (Max 32 for JESD204B, Max 256 for JESD204C) */
|
||||
uint8_t jesd204F; /*!< Number of bytes(octets) per frame . */
|
||||
@ -172,6 +181,16 @@ extern void UCP_API_JESD_ApeWorkStep(ucp_jesd_ApeWorkStep_e step);
|
||||
*/
|
||||
extern void UCP_API_JESD_TrxGpioSetup (const char *trxGpioConfigFile);
|
||||
|
||||
/**
|
||||
* \brief Gets the gpio's inf of tx and rx
|
||||
*
|
||||
* \param void
|
||||
*
|
||||
* \retval TrxGpioCfg point.
|
||||
*/
|
||||
extern ucp_jesd_TrxGpioCfg_t* UCP_API_JESD_TrxGpioGet (void);
|
||||
|
||||
|
||||
/**
|
||||
* \brief Sets up the ucp4008 jesd's para setting
|
||||
*
|
||||
@ -199,6 +218,22 @@ extern ucp_jesd_States_e UCP_API_JESD_CellSetup (ucp_jesd_Init_t *setting);
|
||||
*/
|
||||
extern void UCP_API_JESD_CellDelete (void);
|
||||
|
||||
/**
|
||||
* \brief gpio of rf controlling
|
||||
*
|
||||
* \param setting
|
||||
*
|
||||
* \retval none.
|
||||
*/
|
||||
extern void UCP_API_GPIO_Tx (void);
|
||||
extern void UCP_API_GPIO_Rx (void);
|
||||
extern void UCP_API_GPIO_On (void);
|
||||
extern void UCP_API_GPIO_Off (void);
|
||||
extern void UCP_API_GPIO_OrxOn (void);
|
||||
extern void UCP_API_GPIO_OrxOff (void);
|
||||
extern void UCP_API_GPIO_TrigOn (void);
|
||||
extern void UCP_API_GPIO_TrigOff (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
4
makefile
4
makefile
@ -46,6 +46,7 @@ INCLUDE_DIRS ?= ./app/inc
|
||||
INCLUDE_DIRS += ./osp/inc
|
||||
INCLUDE_DIRS += ./driver/arm_csu/inc
|
||||
INCLUDE_DIRS += ./driver/init/inc
|
||||
INCLUDE_DIRS += ./driver/tfu/stc/inc
|
||||
test ?= $(test_option)
|
||||
case ?= $(test_id)
|
||||
ifeq ($(test),yes)
|
||||
@ -67,8 +68,9 @@ LD_FLAGS += -lm -ldl -Wl,-rpath=./
|
||||
LD_FLAGS += -lpthread
|
||||
LD_FLAGS += -rdynamic -funwind-tables -ffunction-sections
|
||||
ifeq ($(fronthaul_option),jesd)
|
||||
LD_FLAGS += -lrfic
|
||||
LD_FLAGS += -lrfic -lstc
|
||||
endif
|
||||
LD_FLAGS += -lstc
|
||||
$(info "DEFINES=" $(DEFINES))
|
||||
|
||||
#Flatten files and remove the duplicate by sort
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "typedef.h"
|
||||
#include "ospHeap.h"
|
||||
#include "ucp_printf.h"
|
||||
#include "ospTypes.h"
|
||||
|
||||
|
||||
/*typedef unsigned char uint8_t;
|
||||
typedef signed char int8_t;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "ucp_printf.h"
|
||||
#include "arm_csu.h"
|
||||
#include "memcpy_csu.h"
|
||||
#include "ospTypes.h"
|
||||
|
||||
extern int32_t g_dev_mem_fd;
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "ospTask.h"
|
||||
#include "drv_init.h"
|
||||
#include "ospSwTimer.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "ospTask.h"
|
||||
#include "drv_init.h"
|
||||
#include "ospSwTimer.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "ospTask.h"
|
||||
#include "drv_init.h"
|
||||
#include "ospSwTimer.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "ospLog.h"
|
||||
#include "ospCfgToBin.h"
|
||||
#include "drv_init.h"
|
||||
#include "stc_drv_api.h"
|
||||
|
||||
uint32_t slot_ind_flag = 0;
|
||||
uint32_t slot_ind_time_flag = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user