aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2015-04-15 13:55:10 -0700
committermichael-west <michael.west@ettus.com>2015-04-15 17:08:02 -0700
commitbe54951d4c14b11e21518f2e7d87fd527102c948 (patch)
tree7a3c36bd2b9af356d0347934060bbee3d921919f /host/lib/usrp
parent5e3bf468c3e379743ede3b10a70699976ea83b09 (diff)
downloaduhd-be54951d4c14b11e21518f2e7d87fd527102c948.tar.gz
uhd-be54951d4c14b11e21518f2e7d87fd527102c948.tar.bz2
uhd-be54951d4c14b11e21518f2e7d87fd527102c948.zip
UHD host code changes for B200 rev 5 support.
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp35
-rw-r--r--host/lib/usrp/b200/b200_impl.hpp4
2 files changed, 26 insertions, 13 deletions
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index e567ff434..cea7e5969 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -43,10 +43,6 @@ using namespace uhd::transport;
static const boost::posix_time::milliseconds REENUMERATION_TIMEOUT_MS(3000);
-//! mapping of frontend to radio perif index
-static const size_t FE1 = 1;
-static const size_t FE2 = 0;
-
class b200_ad9361_client_t : public ad9361_params {
public:
~b200_ad9361_client_t() {}
@@ -264,6 +260,19 @@ b200_impl::b200_impl(const device_addr_t &device_addr) :
UHD_ASSERT_THROW(device_addr.has_key("fpga"));
}
+ //set up frontend mapping
+ _fe1 = 1;
+ _fe2 = 0;
+ if (not mb_eeprom["revision"].empty())
+ {
+ size_t rev = boost::lexical_cast<size_t>(mb_eeprom["revision"]);
+ if (rev == 5)
+ {
+ _fe1 = 0;
+ _fe2 = 1;
+ }
+ }
+
//extract the FPGA path for the B200
std::string b200_fpga_image = find_image_path(
device_addr.has_key("fpga")? device_addr["fpga"] : default_file_name
@@ -628,7 +637,7 @@ void b200_impl::setup_radio(const size_t dspno)
for(size_t direction = 0; direction < 2; direction++)
{
const std::string x = direction? "rx" : "tx";
- const std::string key = std::string((direction? "RX" : "TX")) + std::string(((dspno == FE1)? "1" : "2"));
+ const std::string key = std::string((direction? "RX" : "TX")) + std::string(((dspno == _fe1)? "1" : "2"));
const fs_path rf_fe_path = mb_path / "dboards" / "A" / (x+"_frontends") / (dspno? "B" : "A");
_tree->create<std::string>(rf_fe_path / "name").set("FE-"+key);
@@ -924,9 +933,9 @@ void b200_impl::reset_codec_dcm(void)
void b200_impl::update_atrs(void)
{
- if (_radio_perifs.size() > FE1 and _radio_perifs[FE1].atr)
+ if (_radio_perifs.size() > _fe1 and _radio_perifs[_fe1].atr)
{
- radio_perifs_t &perif = _radio_perifs[FE1];
+ radio_perifs_t &perif = _radio_perifs[_fe1];
const bool enb_rx = bool(perif.rx_streamer.lock());
const bool enb_tx = bool(perif.tx_streamer.lock());
const bool is_rx2 = perif.ant_rx2;
@@ -942,9 +951,9 @@ void b200_impl::update_atrs(void)
atr->set_atr_reg(dboard_iface::ATR_REG_TX_ONLY, txonly);
atr->set_atr_reg(dboard_iface::ATR_REG_FULL_DUPLEX, fd);
}
- if (_radio_perifs.size() > FE2 and _radio_perifs[FE2].atr)
+ if (_radio_perifs.size() > _fe2 and _radio_perifs[_fe2].atr)
{
- radio_perifs_t &perif = _radio_perifs[FE2];
+ radio_perifs_t &perif = _radio_perifs[_fe2];
const bool enb_rx = bool(perif.rx_streamer.lock());
const bool enb_tx = bool(perif.tx_streamer.lock());
const bool is_rx2 = perif.ant_rx2;
@@ -972,10 +981,10 @@ void b200_impl::update_antenna_sel(const size_t which, const std::string &ant)
void b200_impl::update_enables(void)
{
//extract settings from state variables
- const bool enb_tx1 = (_radio_perifs.size() > FE1) and bool(_radio_perifs[FE1].tx_streamer.lock());
- const bool enb_rx1 = (_radio_perifs.size() > FE1) and bool(_radio_perifs[FE1].rx_streamer.lock());
- const bool enb_tx2 = (_radio_perifs.size() > FE2) and bool(_radio_perifs[FE2].tx_streamer.lock());
- const bool enb_rx2 = (_radio_perifs.size() > FE2) and bool(_radio_perifs[FE2].rx_streamer.lock());
+ const bool enb_tx1 = (_radio_perifs.size() > _fe1) and bool(_radio_perifs[_fe1].tx_streamer.lock());
+ const bool enb_rx1 = (_radio_perifs.size() > _fe1) and bool(_radio_perifs[_fe1].rx_streamer.lock());
+ const bool enb_tx2 = (_radio_perifs.size() > _fe2) and bool(_radio_perifs[_fe2].tx_streamer.lock());
+ const bool enb_rx2 = (_radio_perifs.size() > _fe2) and bool(_radio_perifs[_fe2].rx_streamer.lock());
const size_t num_rx = (enb_rx1?1:0) + (enb_rx2?1:0);
const size_t num_tx = (enb_tx1?1:0) + (enb_tx2?1:0);
const bool mimo = num_rx == 2 or num_tx == 2;
diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp
index 396819f9a..e871e6b9a 100644
--- a/host/lib/usrp/b200/b200_impl.hpp
+++ b/host/lib/usrp/b200/b200_impl.hpp
@@ -119,6 +119,10 @@ private:
boost::mutex _transport_setup_mutex;
+ // mapping of frontend to radio perif index
+ size_t _fe1;
+ size_t _fe2;
+
//async ctrl + msgs
uhd::msg_task::sptr _async_task;
typedef uhd::transport::bounded_buffer<uhd::async_metadata_t> async_md_type;