Commit 8b66c974 authored by Karim HAROUAT's avatar Karim HAROUAT

add patch uhd for lib 4.6.0.0, propose a new enhanced way to patch uhd file by...

add patch uhd for lib 4.6.0.0, propose a new enhanced way to patch uhd file by factorizing shell code lines
parent 513f060f
......@@ -261,29 +261,34 @@ install_usrp_uhd_driver_from_source(){
# For our legacy TDD eNB running with a B2xx RF board
# the following patch has to be applied
if [[ -v UHD_VERSION ]]; then
git checkout tags/v${UHD_VERSION}
# We recommend to use not older than 3.15.0.0
if [[ "$UHD_VERSION" == "3.15.0.0" ]]; then
# Tested that patch for the following versions:
# - 3.15.0.0
git apply $OPENAIR_DIR/cmake_targets/tools/uhd-3.15-tdd-patch.diff
ret=$?;[[ $ret -ne 0 ]] && echo_fatal "Could not apply the TDD patch"
else
# Tested that patch for the following versions:
# - 4.0.0.0
# - 4.1.0.0
# - 4.1.0.5
# - 4.2.0.0
# - 4.2.0.1
# - 4.3.0.0-rc1
# - 4.4.0.0
git apply $OPENAIR_DIR/cmake_targets/tools/uhd-4.x-tdd-patch.diff
ret=$?;[[ $ret -ne 0 ]] && echo_fatal "Could not apply the TDD patch"
fi
UHD_TAG=${UHD_VERSION}
else
git checkout tags/v4.0.0.0
git apply $OPENAIR_DIR/cmake_targets/tools/uhd-4.x-tdd-patch.diff
ret=$?;[[ $ret -ne 0 ]] && echo_fatal "Could not apply the TDD patch"
UHD_TAG="4.0.0.0"
fi
git checkout tags/v${UHD_TAG}
# We recommend to use not older than 3.15.0.0
# create the uhd patch inside cmake_targets/tools and name it within format uhd-Y*-patch.diff
UHD_VERSION_MAJOR_MINOR=$(echo ${UHD_TAG} | awk -F'.' '{print $1"."$2}')
UHD_VERSION_MAJOR=$(echo ${UHD_TAG} | awk -F'.' '{print $1"."}')
file_to_apply=$(find $OPENAIR_DIR/cmake_targets/tools/ -name "uhd-${UHD_VERSION_MAJOR_MINOR}*-patch.diff" | head -n 1)
[ -z "${file_to_apply}" ] && file_to_apply=$(find $OPENAIR_DIR/cmake_targets/tools/ -name "uhd-${UHD_VERSION_MAJOR}*-patch.diff" | head -n 1)
if [ ! -z "${file_to_apply}" ]
then
# Tested that patch for the following versions:
# - 3.15.0.0
# - 4.0.0.0
# - 4.1.0.0
# - 4.1.0.5
# - 4.2.0.0
# - 4.2.0.1
# - 4.3.0.0-rc1
# - 4.4.0.0
set +e
git apply --check ${file_to_apply}
ret=$?;
set -e
[[ $ret -ne 0 ]] && echo_fatal "Could not apply the TDD patch ${file_to_apply}"
[ $ret -eq 0 ] && git apply ${file_to_apply}
fi
# Printing out the results of the patch to make sure it was properly applied
git diff
......
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index 656aaeae1..2d0a7b87d 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -1410,10 +1410,10 @@ void b200_impl::update_atrs(void)
if (not enb_rx and enb_tx)
fd = txonly;
gpio_atr_3000::sptr atr = perif.atr;
- atr->set_atr_reg(ATR_REG_IDLE, STATE_RX1_OFF);
- atr->set_atr_reg(ATR_REG_RX_ONLY, rxonly);
- atr->set_atr_reg(ATR_REG_TX_ONLY, txonly);
- atr->set_atr_reg(ATR_REG_FULL_DUPLEX, fd);
+ atr->set_atr_reg(ATR_REG_IDLE, STATE_RX1_OFF | (1<<7));
+ atr->set_atr_reg(ATR_REG_RX_ONLY, rxonly | (1<<7));
+ atr->set_atr_reg(ATR_REG_TX_ONLY, txonly | (1<<7));
+ atr->set_atr_reg(ATR_REG_FULL_DUPLEX, fd | (1<<7));
}
if (_radio_perifs.size() > _fe2 and _radio_perifs[_fe2].atr) {
radio_perifs_t& perif = _radio_perifs[_fe2];
@@ -1431,10 +1431,10 @@ void b200_impl::update_atrs(void)
if (not enb_rx and enb_tx)
fd = txonly;
gpio_atr_3000::sptr atr = perif.atr;
- atr->set_atr_reg(ATR_REG_IDLE, STATE_RX2_OFF);
- atr->set_atr_reg(ATR_REG_RX_ONLY, rxonly);
- atr->set_atr_reg(ATR_REG_TX_ONLY, txonly);
- atr->set_atr_reg(ATR_REG_FULL_DUPLEX, fd);
+ atr->set_atr_reg(ATR_REG_IDLE, STATE_RX2_OFF | (1<<7));
+ atr->set_atr_reg(ATR_REG_RX_ONLY, rxonly | (1<<7));
+ atr->set_atr_reg(ATR_REG_TX_ONLY, txonly | (1<<7));
+ atr->set_atr_reg(ATR_REG_FULL_DUPLEX, fd | (1<<7));
}
}
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