Commit 30db068f authored by Fang-WANG's avatar Fang-WANG Committed by wf

add OXGRF support

oxgrf ok

update build script for oxgrf

del logs

missing one file

modify build and config

missing rf type
parent 1a0c0cd1
...@@ -566,6 +566,14 @@ target_link_libraries(oai_bladerfdevif bladeRF) ...@@ -566,6 +566,14 @@ target_link_libraries(oai_bladerfdevif bladeRF)
include_directories("${OPENAIR_DIR}/radio/LMSSDR/USERSPACE/LIB/") include_directories("${OPENAIR_DIR}/radio/LMSSDR/USERSPACE/LIB/")
include_directories("${OPENAIR_DIR}/radio/OXGRF/USERSPACE/LIB/")
set(HWLIB_OXGRF_SOURCE
${OPENAIR_DIR}/radio/OXGRF/USERSPACE/LIB/oxgrf_lib.c
)
add_library(oai_oxgrfdevif MODULE ${HWLIB_OXGRF_SOURCE} )
target_link_libraries(oai_oxgrfdevif oxgrf_ss)
set(HWLIB_LMSSDR_SOURCE set(HWLIB_LMSSDR_SOURCE
${OPENAIR_DIR}/radio/LMSSDR/USERSPACE/LIB/lms_lib.cpp ${OPENAIR_DIR}/radio/LMSSDR/USERSPACE/LIB/lms_lib.cpp
) )
...@@ -2746,7 +2754,7 @@ if (${T_TRACER}) ...@@ -2746,7 +2754,7 @@ if (${T_TRACER})
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions #all "add_library" definitions
ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap ITTI lte_rrc nr_rrc s1ap x2ap m2ap m3ap f1ap
params_libconfig oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer params_libconfig oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer oai_oxgrfdevif
oai_eth_transpro oai_mobipass coding HASHTABLE UTIL OMG_SUMO oai_eth_transpro oai_mobipass coding HASHTABLE UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
......
...@@ -114,7 +114,7 @@ Options: ...@@ -114,7 +114,7 @@ Options:
--UE-gen-nvram [output path] --UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\") Specify gen_nvram_path (default \"$gen_nvram_path\")
-w | --hardware -w | --hardware
USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, None (Default) USRP, BLADERF, LMSSDR, IRIS, SIMU, AW2SORI, OXGRF, None (Default)
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
-t | --transport -t | --transport
Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g Selects the transport protocol type, options: None, Ethernet, benetel4g, benetel5g
...@@ -288,7 +288,7 @@ function main() { ...@@ -288,7 +288,7 @@ function main() {
-w | --hardware) -w | --hardware)
# Use OAI_USRP as the key word USRP is used inside UHD driver # Use OAI_USRP as the key word USRP is used inside UHD driver
case "$2" in case "$2" in
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU" | "AW2SORI") "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "SIMU" | "AW2SORI"| "OXGRF")
HW="OAI_"$2 HW="OAI_"$2
;; ;;
"None") "None")
...@@ -693,6 +693,20 @@ function main() { ...@@ -693,6 +693,20 @@ function main() {
ln -sf liboai_bladerfdevif.so liboai_device.so ln -sf liboai_bladerfdevif.so liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library" echo_info "liboai_device.so is linked to BLADERF device library"
elif [ "$HW" == "OAI_OXGRF" ] ; then
if [ ! -f "/usr/local/include/oxgrf_api_ss.h" ] ; then
sudo cp $THIS_SCRIPT_PATH/../radio/OXGRF/USERSPACE/LIB/oxgrf_api_ss.h /usr/local/include/oxgrf_api_ss.h
sudo cp $THIS_SCRIPT_PATH/../radio/OXGRF/USERSPACE/LIB/liboxgrf_ss.so /usr/local/lib/liboxgrf_ss.so
sudo chmod +x /usr/local/lib/liboxgrf_ss.so
sudo ldconfig /usr/local/lib
fi
compilations \
$BUILD_DIR oai_oxgrfdevif \
liboai_oxgrfdevif.so $dbin/liboai_oxgrfdevif.so.$REL
echo_info "before link"
ln -sf liboai_oxgrfdevif.so liboai_device.so
ln -sf $dbin/liboai_oxgrfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to OXGRF device library"
elif [ "$HW" == "OAI_LMSSDR" ] ; then elif [ "$HW" == "OAI_LMSSDR" ] ; then
# if [ -f "/usr/include/libbladeRF.h" ] ; then # if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations $BUILD_DIR oai_lmssdrdevif compilations $BUILD_DIR oai_lmssdrdevif
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n" #define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n" #define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_DMAMAP "use DMA memory mapping\n" #define CONFIG_HLP_DMAMAP "use DMA memory mapping\n"
#define CONFIG_HLP_OXGRF_ARGS "set the arguments to identify OXGRF\n"
#define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n" #define CONFIG_HLP_TDD "Set hardware to TDD mode (default: FDD). Used only with -U (otherwise set in config file).\n"
#define CONFIG_HLP_TADV "Set timing_advance\n" #define CONFIG_HLP_TADV "Set timing_advance\n"
...@@ -105,7 +106,7 @@ ...@@ -105,7 +106,7 @@
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \ {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \ {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ {"oxgrf-args", CONFIG_HLP_OXGRF_ARGS, 0, strptr:(char **)&oxgrf_args, defstrval:"dev=pciex:0",TYPE_STRING, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \ {"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0}, \ {"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0}, \
{"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0}, \ {"ue-idx-standalone", NULL, 0, u16ptr:&ue_idx_standalone, defuintval:0xFFFF, TYPE_UINT16, 0}, \
......
...@@ -163,6 +163,8 @@ int transmission_mode=1; ...@@ -163,6 +163,8 @@ int transmission_mode=1;
char *usrp_args=NULL; char *usrp_args=NULL;
char *usrp_clksrc=NULL; char *usrp_clksrc=NULL;
char *oxgrf_args=NULL;
THREAD_STRUCT thread_struct; THREAD_STRUCT thread_struct;
/* struct for ethernet specific parameters given in eNB conf file */ /* struct for ethernet specific parameters given in eNB conf file */
eth_params_t *eth_params; eth_params_t *eth_params;
...@@ -471,6 +473,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) { ...@@ -471,6 +473,7 @@ void init_openair0(LTE_DL_FRAME_PARMS *frame_parms,int rxgain) {
} }
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args; if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
else if (oxgrf_args) openair0_cfg[card].sdr_addrs = oxgrf_args;
} }
} }
......
...@@ -101,6 +101,8 @@ ...@@ -101,6 +101,8 @@
#define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n" #define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n"
#define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n" #define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n"
#define CONFIG_HLP_OXGRF_ARGS "set the arguments to identify OXGRF\n"
#define CONFIG_HLP_FLOG "Enable online log \n" #define CONFIG_HLP_FLOG "Enable online log \n"
#define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n" #define CONFIG_HLP_LOGL "Set the global log level, valid options: (4:trace, 3:debug, 2:info, 1:warn, (0:error))\n"
#define CONFIG_HLP_LOGV "Set the global log verbosity \n" #define CONFIG_HLP_LOGV "Set the global log verbosity \n"
......
...@@ -120,6 +120,7 @@ double rx_gain_off = 0.0; ...@@ -120,6 +120,7 @@ double rx_gain_off = 0.0;
char *usrp_args = NULL; char *usrp_args = NULL;
char *tx_subdev = NULL; char *tx_subdev = NULL;
char *rx_subdev = NULL; char *rx_subdev = NULL;
char *oxgrf_args = NULL;
char *rrc_config_path = NULL; char *rrc_config_path = NULL;
char *uecap_file = NULL; char *uecap_file = NULL;
int dumpframe = 0; int dumpframe = 0;
...@@ -364,7 +365,7 @@ void init_openair0(void) { ...@@ -364,7 +365,7 @@ void init_openair0(void) {
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args; if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
if (tx_subdev) openair0_cfg[card].tx_subdev = tx_subdev; if (tx_subdev) openair0_cfg[card].tx_subdev = tx_subdev;
if (rx_subdev) openair0_cfg[card].rx_subdev = rx_subdev; if (rx_subdev) openair0_cfg[card].rx_subdev = rx_subdev;
if (oxgrf_args) openair0_cfg[card].sdr_addrs = oxgrf_args;
} }
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \ {"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"tx_subdev", CONFIG_HLP_TX_SUBDEV, 0, strptr:&tx_subdev, defstrval:NULL, TYPE_STRING, 0}, \ {"tx_subdev", CONFIG_HLP_TX_SUBDEV, 0, strptr:&tx_subdev, defstrval:NULL, TYPE_STRING, 0}, \
{"rx_subdev", CONFIG_HLP_RX_SUBDEV, 0, strptr:&rx_subdev, defstrval:NULL, TYPE_STRING, 0}, \ {"rx_subdev", CONFIG_HLP_RX_SUBDEV, 0, strptr:&rx_subdev, defstrval:NULL, TYPE_STRING, 0}, \
{"oxgrf-args", CONFIG_HLP_OXGRF_ARGS, 0, strptr:(char **)&oxgrf_args,defstrval:"dev=pciex:0", TYPE_STRING, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, u8ptr:NULL, defintval:0, TYPE_UINT8, 0}, \ {"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, u8ptr:NULL, defintval:0, TYPE_UINT8, 0}, \
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:&nrUE_params.ofdm_offset_divisor, defuintval:8, TYPE_UINT32, 0}, \ {"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:&nrUE_params.ofdm_offset_divisor, defuintval:8, TYPE_UINT32, 0}, \
......
...@@ -452,7 +452,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -452,7 +452,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
} }
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) #if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)
LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id, ue->Mod_id,
openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset, openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset,
...@@ -501,10 +501,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -501,10 +501,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#ifndef OAI_BLADERF #ifndef OAI_BLADERF
#ifndef OAI_LMSSDR #ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706 #ifndef OAI_ADRV9371_ZC706
#ifndef OAI_OXGRF
//phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); //phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif #endif
#endif #endif
#endif #endif
#endif
#endif #endif
} }
...@@ -514,10 +516,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -514,10 +516,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
#ifndef OAI_BLADERF #ifndef OAI_BLADERF
#ifndef OAI_LMSSDR #ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706 #ifndef OAI_ADRV9371_ZC706
#ifndef OAI_OXGRF
//phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); //phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif #endif
#endif #endif
#endif #endif
#endif
#endif #endif
} }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface * @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface * @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface * @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
* @defgroup _OXGRF_PHY_RF_INTERFACE_ PHY - OXGRF RF Interface
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface * @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
* @} * @}
* *
......
...@@ -77,7 +77,13 @@ fifo_dump_emos_UE emos_dump_UE; ...@@ -77,7 +77,13 @@ fifo_dump_emos_UE emos_dump_UE;
#include "intertask_interface.h" #include "intertask_interface.h"
#include "T.h" #include "T.h"
<<<<<<< HEAD
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) #if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
=======
char nr_mode_string[NUM_UE_MODE][20] = {"NOT SYNCHED","PRACH","RAR","RA_WAIT_CR", "PUSCH", "RESYNCH"};
#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_OXGRF)
>>>>>>> d3d2964e65... add OXGRF support
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
#endif #endif
......
...@@ -50,6 +50,7 @@ const char* devtype_names[MAX_RF_DEV_TYPE] = { ...@@ -50,6 +50,7 @@ const char* devtype_names[MAX_RF_DEV_TYPE] = {
"USRP N300", "USRP N300",
"USRP X400", "USRP X400",
"BLADERF", "BLADERF",
"OXGRF_DEV",
"LMSSDR", "LMSSDR",
"IRIS", "IRIS",
"No HW", "No HW",
......
...@@ -93,6 +93,8 @@ typedef enum { ...@@ -93,6 +93,8 @@ typedef enum {
USRP_X400_DEV, USRP_X400_DEV,
/*!\brief device is BLADE RF*/ /*!\brief device is BLADE RF*/
BLADERF_DEV, BLADERF_DEV,
/*!\brief device is OXGRF pcie*/
OXGRF_DEV,
/*!\brief device is LMSSDR (SoDeRa)*/ /*!\brief device is LMSSDR (SoDeRa)*/
LMSSDR_DEV, LMSSDR_DEV,
/*!\brief device is Iris */ /*!\brief device is Iris */
......
This diff is collapsed.
This diff is collapsed.
/** oxgrf_lib.h
*
* Author: openxg
*/
#include "oxgrf_api_ss.h"
#include "common_lib.h"
/** @addtogroup _OXGRF_PHY_RF_INTERFACE_
* @{
*/
/*! \brief OXGRF specific data structure */
typedef struct {
//! opaque OXGRF device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
OXGRF_DESCRIPTOR *dev;
int16_t *rx_buffer;
int16_t *tx_buffer;
//! Sample rate
unsigned int sample_rate;
int rx_num_channels;
int tx_num_channels;
// --------------------------------
// Debug and output control
// --------------------------------
//! Number of underflows
int num_underflows;
//! Number of overflows
int num_overflows;
//! number of RX errors
int num_rx_errors;
//! Number of TX errors
int num_tx_errors;
//! timestamp of current TX
uint64_t tx_current_ts;
//! timestamp of current RX
uint64_t rx_current_ts;
//! number of TX samples
uint64_t tx_nsamps;
//! number of RX samples
uint64_t rx_nsamps;
//! number of TX count
uint64_t tx_count;
//! number of RX count
uint64_t rx_count;
//! timestamp of RX packet
openair0_timestamp rx_timestamp;
} oxgrf_state_t;
/*! \brief get current timestamp
*\param device the hardware to use
*/
openair0_timestamp trx_get_timestamp(openair0_device *device);
#define REMOVE_SUBSTRING_WITHCOMAS(S, TOREMOVE) \
remove_substring(S, TOREMOVE ","); \
remove_substring(S, TOREMOVE ", "); \
remove_substring(S, "," TOREMOVE); \
remove_substring(S, ", " TOREMOVE); \
remove_substring(S, TOREMOVE)
static inline void remove_substring(char* s, const char* toremove)
{
while ((s = strstr(s, toremove))) {
memmove(s, s + strlen(toremove), 1 + strlen(s + strlen(toremove)));
}
}
static inline void copy_subdev_string(char* dst, char* src)
{
int n = 0;
int len = (int)strlen(src);
/* Copy until end of string or comma */
while (n < len && src[n] != '\0' && src[n] != ',') {
dst[n] = src[n];
n++;
}
dst[n] = '\0';
}
/*@}*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment