aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authormichael-west <michael.west@ettus.com>2017-12-05 15:49:28 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-07 13:32:26 -0800
commitc0057e35b805faa9f0733ae27ca6e24609dc62c2 (patch)
tree7b8c33d4671e8553e81b1f338c643c944ff9576e /host/lib
parentcc86cc5a6a713788cc58add7fd76486b8a8fa141 (diff)
downloaduhd-c0057e35b805faa9f0733ae27ca6e24609dc62c2.tar.gz
uhd-c0057e35b805faa9f0733ae27ca6e24609dc62c2.tar.bz2
uhd-c0057e35b805faa9f0733ae27ca6e24609dc62c2.zip
UHD: Add eeprom info to dboard_base
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/b100/b100_impl.cpp4
-rw-r--r--host/lib/usrp/dboard_base.cpp14
-rw-r--r--host/lib/usrp/dboard_ctor_args.hpp6
-rw-r--r--host/lib/usrp/dboard_manager.cpp57
-rw-r--r--host/lib/usrp/usrp1/usrp1_impl.cpp4
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp4
-rw-r--r--host/lib/usrp/x300/x300_radio_ctrl_impl.cpp8
7 files changed, 55 insertions, 42 deletions
diff --git a/host/lib/usrp/b100/b100_impl.cpp b/host/lib/usrp/b100/b100_impl.cpp
index 110c5ff87..473a3d6b1 100644
--- a/host/lib/usrp/b100/b100_impl.cpp
+++ b/host/lib/usrp/b100/b100_impl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2012-2014 Ettus Research LLC
+// Copyright 2012-2014,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -471,7 +471,7 @@ b100_impl::b100_impl(const device_addr_t &device_addr){
//create a new dboard interface and manager
_dboard_manager = dboard_manager::make(
- rx_db_eeprom.id, tx_db_eeprom.id, gdb_eeprom.id,
+ rx_db_eeprom, tx_db_eeprom, gdb_eeprom,
make_b100_dboard_iface(_fifo_ctrl, _fpga_i2c_ctrl, _fifo_ctrl/*spi*/, _clock_ctrl, _codec_ctrl),
_tree->subtree(mb_path / "dboards/A")
);
diff --git a/host/lib/usrp/dboard_base.cpp b/host/lib/usrp/dboard_base.cpp
index 465b9e489..bacb2a5a1 100644
--- a/host/lib/usrp/dboard_base.cpp
+++ b/host/lib/usrp/dboard_base.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -44,11 +44,19 @@ dboard_iface::sptr dboard_base::get_iface(void){
}
dboard_id_t dboard_base::get_rx_id(void){
- return _impl->args.rx_id;
+ return _impl->args.rx_eeprom.id;
}
dboard_id_t dboard_base::get_tx_id(void){
- return _impl->args.tx_id;
+ return _impl->args.tx_eeprom.id;
+}
+
+dboard_eeprom_t dboard_base::get_rx_eeprom(void){
+ return _impl->args.rx_eeprom;
+}
+
+dboard_eeprom_t dboard_base::get_tx_eeprom(void){
+ return _impl->args.tx_eeprom;
}
property_tree::sptr dboard_base::get_rx_subtree(void){
diff --git a/host/lib/usrp/dboard_ctor_args.hpp b/host/lib/usrp/dboard_ctor_args.hpp
index c8e4006d1..db26193cc 100644
--- a/host/lib/usrp/dboard_ctor_args.hpp
+++ b/host/lib/usrp/dboard_ctor_args.hpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -19,9 +19,9 @@
#define INCLUDED_LIBUHD_USRP_DBOARD_CTOR_ARGS_HPP
#include <uhd/property_tree.hpp>
-#include <uhd/usrp/dboard_id.hpp>
#include <uhd/usrp/dboard_base.hpp>
#include <uhd/usrp/dboard_iface.hpp>
+#include <uhd/usrp/dboard_eeprom.hpp>
#include <string>
namespace uhd{ namespace usrp{
@@ -30,7 +30,7 @@ namespace uhd{ namespace usrp{
public:
std::string sd_name;
dboard_iface::sptr db_iface;
- dboard_id_t rx_id, tx_id;
+ dboard_eeprom_t rx_eeprom, tx_eeprom;
property_tree::sptr rx_subtree, tx_subtree;
dboard_base::sptr rx_container, tx_container;
diff --git a/host/lib/usrp/dboard_manager.cpp b/host/lib/usrp/dboard_manager.cpp
index 87b0c9f9c..68e7c1920 100644
--- a/host/lib/usrp/dboard_manager.cpp
+++ b/host/lib/usrp/dboard_manager.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2011 Ettus Research LLC
+// Copyright 2010-2011,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -178,8 +178,8 @@ class dboard_manager_impl : public dboard_manager{
public:
dboard_manager_impl(
- dboard_id_t rx_dboard_id,
- dboard_id_t tx_dboard_id,
+ dboard_eeprom_t rx_eeprom,
+ dboard_eeprom_t tx_eeprom,
dboard_iface::sptr iface,
property_tree::sptr subtree,
bool defer_db_init
@@ -197,7 +197,7 @@ public:
void initialize_dboards();
private:
- void init(dboard_id_t, dboard_id_t, property_tree::sptr, bool);
+ void init(dboard_eeprom_t, dboard_eeprom_t, property_tree::sptr, bool);
//list of rx and tx dboards in this dboard_manager
//each dboard here is actually a subdevice proxy
//the subdevice proxy is internal to the cpp file
@@ -215,17 +215,17 @@ private:
* make routine for dboard manager
**********************************************************************/
dboard_manager::sptr dboard_manager::make(
- dboard_id_t rx_dboard_id,
- dboard_id_t tx_dboard_id,
- dboard_id_t gdboard_id,
+ dboard_eeprom_t rx_eeprom,
+ dboard_eeprom_t tx_eeprom,
+ dboard_eeprom_t gdb_eeprom,
dboard_iface::sptr iface,
property_tree::sptr subtree,
bool defer_db_init
){
return dboard_manager::sptr(
new dboard_manager_impl(
- rx_dboard_id,
- (gdboard_id == dboard_id_t::none())? tx_dboard_id : gdboard_id,
+ rx_eeprom,
+ (gdb_eeprom.id == dboard_id_t::none())? tx_eeprom : gdb_eeprom,
iface, subtree, defer_db_init
)
);
@@ -235,8 +235,8 @@ dboard_manager::sptr dboard_manager::make(
* implementation class methods
**********************************************************************/
dboard_manager_impl::dboard_manager_impl(
- dboard_id_t rx_dboard_id,
- dboard_id_t tx_dboard_id,
+ dboard_eeprom_t rx_eeprom,
+ dboard_eeprom_t tx_eeprom,
dboard_iface::sptr iface,
property_tree::sptr subtree,
bool defer_db_init
@@ -244,7 +244,7 @@ dboard_manager_impl::dboard_manager_impl(
_iface(iface)
{
try{
- this->init(rx_dboard_id, tx_dboard_id, subtree, defer_db_init);
+ this->init(rx_eeprom, tx_eeprom, subtree, defer_db_init);
}
catch(const std::exception &e){
UHD_LOGGER_ERROR("DBMGR") << boost::format(
@@ -256,24 +256,29 @@ dboard_manager_impl::dboard_manager_impl(
if (subtree->exists("rx_frontends")) subtree->remove("rx_frontends");
if (subtree->exists("tx_frontends")) subtree->remove("tx_frontends");
if (subtree->exists("iface")) subtree->remove("iface");
- this->init(dboard_id_t::none(), dboard_id_t::none(), subtree, false);
+ dboard_eeprom_t dummy_eeprom;
+ dummy_eeprom.id = dboard_id_t::none();
+ this->init(dummy_eeprom, dummy_eeprom, subtree, false);
}
}
void dboard_manager_impl::init(
- dboard_id_t rx_dboard_id, dboard_id_t tx_dboard_id, property_tree::sptr subtree, bool defer_db_init
+ dboard_eeprom_t rx_eeprom,
+ dboard_eeprom_t tx_eeprom,
+ property_tree::sptr subtree,
+ bool defer_db_init
){
//find the dboard key matches for the dboard ids
dboard_key_t rx_dboard_key, tx_dboard_key, xcvr_dboard_key;
for(const dboard_key_t &key: get_id_to_args_map().keys()){
if (key.is_xcvr()){
- if (rx_dboard_id == key.rx_id() and tx_dboard_id == key.tx_id()) xcvr_dboard_key = key;
- if (rx_dboard_id == key.rx_id()) rx_dboard_key = key; //kept to handle warning
- if (tx_dboard_id == key.tx_id()) tx_dboard_key = key; //kept to handle warning
+ if (rx_eeprom.id == key.rx_id() and tx_eeprom.id == key.tx_id()) xcvr_dboard_key = key;
+ if (rx_eeprom.id == key.rx_id()) rx_dboard_key = key; //kept to handle warning
+ if (rx_eeprom.id == key.tx_id()) tx_dboard_key = key; //kept to handle warning
}
else{
- if (rx_dboard_id == key.xx_id()) rx_dboard_key = key;
- if (tx_dboard_id == key.xx_id()) tx_dboard_key = key;
+ if (rx_eeprom.id == key.xx_id()) rx_dboard_key = key;
+ if (tx_eeprom.id == key.xx_id()) tx_dboard_key = key;
}
}
@@ -284,7 +289,7 @@ void dboard_manager_impl::init(
"Is your daughter-board mounted properly?\n"
"RX dboard ID: %s\n"
"TX dboard ID: %s\n"
- ) % rx_dboard_id.to_pp_string() % tx_dboard_id.to_pp_string();
+ ) % rx_eeprom.id.to_pp_string() % tx_eeprom.id.to_pp_string();
}
//initialize the gpio pins before creating subdevs
@@ -309,8 +314,8 @@ void dboard_manager_impl::init(
//create the container class.
//a container class exists per N subdevs registered in a register_dboard* call
db_ctor_args.sd_name = "common";
- db_ctor_args.rx_id = rx_dboard_id;
- db_ctor_args.tx_id = tx_dboard_id;
+ db_ctor_args.rx_eeprom = rx_eeprom;
+ db_ctor_args.tx_eeprom = tx_eeprom;
db_ctor_args.rx_subtree = subtree->subtree("rx_frontends/" + db_ctor_args.sd_name);
db_ctor_args.tx_subtree = subtree->subtree("tx_frontends/" + db_ctor_args.sd_name);
if (container_ctor) {
@@ -361,8 +366,8 @@ void dboard_manager_impl::init(
//create the container class.
//a container class exists per N subdevs registered in a register_dboard* call
db_ctor_args.sd_name = "common";
- db_ctor_args.rx_id = rx_dboard_id;
- db_ctor_args.tx_id = dboard_id_t::none();
+ db_ctor_args.rx_eeprom = rx_eeprom;
+ db_ctor_args.tx_eeprom.id = dboard_id_t::none();
db_ctor_args.rx_subtree = subtree->subtree("rx_frontends/" + db_ctor_args.sd_name);
db_ctor_args.tx_subtree = property_tree::sptr();
if (rx_cont_ctor) {
@@ -400,8 +405,8 @@ void dboard_manager_impl::init(
//create the container class.
//a container class exists per N subdevs registered in a register_dboard* call
db_ctor_args.sd_name = "common";
- db_ctor_args.rx_id = dboard_id_t::none();
- db_ctor_args.tx_id = tx_dboard_id;
+ db_ctor_args.rx_eeprom.id = dboard_id_t::none();
+ db_ctor_args.tx_eeprom = tx_eeprom;
db_ctor_args.rx_subtree = property_tree::sptr();
db_ctor_args.tx_subtree = subtree->subtree("tx_frontends/" + db_ctor_args.sd_name);
if (tx_cont_ctor) {
diff --git a/host/lib/usrp/usrp1/usrp1_impl.cpp b/host/lib/usrp/usrp1/usrp1_impl.cpp
index 17009c6a9..3a2c25729 100644
--- a/host/lib/usrp/usrp1/usrp1_impl.cpp
+++ b/host/lib/usrp/usrp1/usrp1_impl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012,2014 Ettus Research LLC
+// Copyright 2010-2012,2014,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -380,7 +380,7 @@ usrp1_impl::usrp1_impl(const device_addr_t &device_addr){
_master_clock_rate, rx_db_eeprom.id
);
_dbc[db].dboard_manager = dboard_manager::make(
- rx_db_eeprom.id, tx_db_eeprom.id, gdb_eeprom.id,
+ rx_db_eeprom, tx_db_eeprom, gdb_eeprom,
dboard_iface, _tree->subtree(mb_path / "dboards" / db)
);
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 90b949759..94d18d342 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2012,2014 Ettus Research LLC
+// Copyright 2010-2012,2014,2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -736,7 +736,7 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr) :
//create a new dboard interface and manager
_mbc[mb].dboard_manager = dboard_manager::make(
- rx_db_eeprom.id, tx_db_eeprom.id, gdb_eeprom.id,
+ rx_db_eeprom, tx_db_eeprom, gdb_eeprom,
make_usrp2_dboard_iface(_mbc[mb].wbiface, _mbc[mb].iface/*i2c*/, _mbc[mb].spiface, _mbc[mb].clock),
_tree->subtree(mb_path / "dboards/A")
);
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
index 1a37cbdd1..282754da6 100644
--- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2015-2016 Ettus Research
+// Copyright 2015-2017 Ettus Research, A National Instruments Company
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -639,9 +639,9 @@ void x300_radio_ctrl_impl::setup_radio(
//create a new dboard manager
boost::shared_ptr<x300_dboard_iface> db_iface = boost::make_shared<x300_dboard_iface>(db_config);
_db_manager = dboard_manager::make(
- _db_eeproms[RX_EEPROM_ADDR + DB_OFFSET].id,
- _db_eeproms[TX_EEPROM_ADDR + DB_OFFSET].id,
- _db_eeproms[GDB_EEPROM_ADDR + DB_OFFSET].id,
+ _db_eeproms[RX_EEPROM_ADDR + DB_OFFSET],
+ _db_eeproms[TX_EEPROM_ADDR + DB_OFFSET],
+ _db_eeproms[GDB_EEPROM_ADDR + DB_OFFSET],
db_iface, _tree->subtree(db_path),
true // defer daughterboard intitialization
);