aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/e300
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2015-12-15 15:17:36 -0800
committerAshish Chaudhari <ashish@ettus.com>2015-12-15 15:17:36 -0800
commitf44f7f2ca7dbbd1a72f5b3d239856a1954569884 (patch)
tree310055d734a28063359b26f7cdc4d4704c517b9e /host/lib/usrp/e300
parent75ea07bd6d19494e018cd5c3109e1f85969b7ac6 (diff)
parent10178875a154e58af6c14774621776d13e7e3daa (diff)
downloaduhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.tar.gz
uhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.tar.bz2
uhd-f44f7f2ca7dbbd1a72f5b3d239856a1954569884.zip
Merge branch 'maint'
Conflicts: host/lib/usrp/b200/b200_impl.hpp host/lib/usrp/e300/e300_fpga_defs.hpp host/lib/usrp/x300/x300_fw_common.h
Diffstat (limited to 'host/lib/usrp/e300')
-rw-r--r--host/lib/usrp/e300/e300_fpga_defs.hpp2
-rw-r--r--host/lib/usrp/e300/e300_impl.cpp27
-rw-r--r--host/lib/usrp/e300/e300_impl.hpp5
3 files changed, 29 insertions, 5 deletions
diff --git a/host/lib/usrp/e300/e300_fpga_defs.hpp b/host/lib/usrp/e300/e300_fpga_defs.hpp
index dcfb05021..594461518 100644
--- a/host/lib/usrp/e300/e300_fpga_defs.hpp
+++ b/host/lib/usrp/e300/e300_fpga_defs.hpp
@@ -21,7 +21,7 @@ namespace uhd { namespace usrp { namespace e300 { namespace fpga {
static const size_t NUM_RADIOS = 2;
-static const boost::uint32_t COMPAT_MAJOR = 13;
+static const boost::uint32_t COMPAT_MAJOR = 14;
static const boost::uint32_t COMPAT_MINOR = 0;
}}}} // namespace
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp
index c82ab3d0e..3242a7fe8 100644
--- a/host/lib/usrp/e300/e300_impl.cpp
+++ b/host/lib/usrp/e300/e300_impl.cpp
@@ -175,7 +175,7 @@ device_addrs_t e300_find(const device_addr_t &multi_dev_hint)
device_addr_t new_hint = hint;
new_hint["addr"] = if_addrs.bcast;
- // call discover with the new hint ad append results
+ // call discover with the new hint and append results
device_addrs_t new_e300_addrs = e300_find(new_hint);
e300_addrs.insert(e300_addrs.begin(),
new_e300_addrs.begin(), new_e300_addrs.end());
@@ -529,8 +529,11 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr)
////////////////////////////////////////////////////////////////////
_tree->create<time_spec_t>(mb_path / "time" / "now")
.publish(boost::bind(&time_core_3000::get_time_now, _radio_perifs[0].time64))
- .subscribe(boost::bind(&time_core_3000::set_time_now, _radio_perifs[0].time64, _1))
- .subscribe(boost::bind(&time_core_3000::set_time_now, _radio_perifs[1].time64, _1));
+ .subscribe(boost::bind(&e300_impl::_set_time, this, _1))
+ .set(0.0);
+ //re-sync the times when the tick rate changes
+ _tree->access<double>(mb_path / "tick_rate")
+ .subscribe(boost::bind(&e300_impl::_sync_times, this));
_tree->create<time_spec_t>(mb_path / "time" / "pps")
.publish(boost::bind(&time_core_3000::get_time_last_pps, _radio_perifs[0].time64))
.subscribe(boost::bind(&time_core_3000::set_time_next_pps, _radio_perifs[0].time64, _1))
@@ -796,6 +799,21 @@ void e300_impl::_update_time_source(const std::string &source)
_update_gpio_state();
}
+void e300_impl::_set_time(const uhd::time_spec_t& t)
+{
+ BOOST_FOREACH(radio_perifs_t &perif, _radio_perifs)
+ perif.time64->set_time_sync(t);
+ _misc.time_sync = 1;
+ _update_gpio_state();
+ _misc.time_sync = 0;
+ _update_gpio_state();
+}
+
+void e300_impl::_sync_times()
+{
+ _set_time(_radio_perifs[0].time64->get_time_now());
+}
+
size_t e300_impl::_get_axi_dma_channel(
boost::uint8_t destination,
boost::uint8_t prefix)
@@ -1081,7 +1099,8 @@ void e300_impl::_update_gpio_state(void)
| (_misc.tx_bandsels << gpio_t::TX_BANDSEL)
| (_misc.rx_bandsel_a << gpio_t::RX_BANDSELA)
| (_misc.rx_bandsel_b << gpio_t::RX_BANDSELB)
- | (_misc.rx_bandsel_c << gpio_t::RX_BANDSELC);
+ | (_misc.rx_bandsel_c << gpio_t::RX_BANDSELC)
+ | (_misc.time_sync << gpio_t::TIME_SYNC);
_global_regs->poke32(global_regs::SR_CORE_MISC, misc_reg);
}
diff --git a/host/lib/usrp/e300/e300_impl.hpp b/host/lib/usrp/e300/e300_impl.hpp
index 9b39c7468..1bf5cb950 100644
--- a/host/lib/usrp/e300/e300_impl.hpp
+++ b/host/lib/usrp/e300/e300_impl.hpp
@@ -200,6 +200,8 @@ private: // types
boost::uint32_t rx_bandsel_b;
boost::uint32_t rx_bandsel_c;
+ boost::uint32_t time_sync;
+
static const size_t PPS_SEL = 0;
static const size_t MIMO = 2;
static const size_t CODEC_ARST = 3;
@@ -207,6 +209,7 @@ private: // types
static const size_t RX_BANDSELA = 7;
static const size_t RX_BANDSELB = 13;
static const size_t RX_BANDSELC = 17;
+ static const size_t TIME_SYNC = 21;
};
private: // methods
@@ -257,6 +260,8 @@ private: // methods
void _update_time_source(const std::string &source);
void _update_clock_source(const std::string &);
+ void _set_time(const uhd::time_spec_t&);
+ void _sync_times(void);
void _update_subdev_spec(
const std::string &txrx,