From c21c5ee6fe6c0e30ac803b308d74ec77317a456f Mon Sep 17 00:00:00 2001 From: michael-west Date: Wed, 14 Oct 2015 11:57:15 -0700 Subject: E300/X300: Add VITA time synchronization on internal signal --- host/lib/usrp/x300/x300_impl.cpp | 12 ++++++++++-- host/lib/usrp/x300/x300_impl.hpp | 1 + host/lib/usrp/x300/x300_regs.hpp | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/x300') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index 1e424414e..ebb9bf3a6 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -764,8 +764,8 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) //////////////////////////////////////////////////////////////////// _tree->create(mb_path / "time" / "now") .publish(boost::bind(&time_core_3000::get_time_now, mb.radio_perifs[0].time64)) - .subscribe(boost::bind(&time_core_3000::set_time_now, mb.radio_perifs[0].time64, _1)) - .subscribe(boost::bind(&time_core_3000::set_time_now, mb.radio_perifs[1].time64, _1)); + .subscribe(boost::bind(&x300_impl::sync_times, this, mb, _1)) + .set(0.0); _tree->create(mb_path / "time" / "pps") .publish(boost::bind(&time_core_3000::get_time_last_pps, mb.radio_perifs[0].time64)) .subscribe(boost::bind(&time_core_3000::set_time_next_pps, mb.radio_perifs[0].time64, _1)) @@ -1457,6 +1457,14 @@ void x300_impl::update_time_source(mboard_members_t &mb, const std::string &sour */ } +void x300_impl::sync_times(mboard_members_t &mb, const uhd::time_spec_t& t) +{ + BOOST_FOREACH(radio_perifs_t &perif, mb.radio_perifs) + perif.time64->set_time_sync(t); + mb.fw_regmap->clock_ctrl_reg.write(fw_regmap_t::clk_ctrl_reg_t::TIME_SYNC, 1); + mb.fw_regmap->clock_ctrl_reg.write(fw_regmap_t::clk_ctrl_reg_t::TIME_SYNC, 0); +} + bool x300_impl::wait_for_clk_locked(mboard_members_t& mb, boost::uint32_t which, double timeout) { boost::system_time timeout_time = boost::get_system_time() + boost::posix_time::milliseconds(timeout * 1000.0); diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp index 1630047af..67afa77ee 100644 --- a/host/lib/usrp/x300/x300_impl.hpp +++ b/host/lib/usrp/x300/x300_impl.hpp @@ -354,6 +354,7 @@ private: void set_time_source_out(mboard_members_t&, const bool); void update_clock_source(mboard_members_t&, const std::string &); void update_time_source(mboard_members_t&, const std::string &); + void sync_times(mboard_members_t&, const uhd::time_spec_t&); uhd::sensor_value_t get_ref_locked(mboard_members_t& mb); bool wait_for_clk_locked(mboard_members_t& mb, boost::uint32_t which, double timeout); diff --git a/host/lib/usrp/x300/x300_regs.hpp b/host/lib/usrp/x300/x300_regs.hpp index eba30abb5..3e0966c83 100644 --- a/host/lib/usrp/x300/x300_regs.hpp +++ b/host/lib/usrp/x300/x300_regs.hpp @@ -209,6 +209,7 @@ namespace uhd { namespace usrp { namespace x300 { UHD_DEFINE_SOFT_REG_FIELD(PPS_OUT_EN, /*width*/ 1, /*shift*/ 4); //[4] UHD_DEFINE_SOFT_REG_FIELD(TCXO_EN, /*width*/ 1, /*shift*/ 5); //[5] UHD_DEFINE_SOFT_REG_FIELD(GPSDO_PWR_EN, /*width*/ 1, /*shift*/ 6); //[6] + UHD_DEFINE_SOFT_REG_FIELD(TIME_SYNC, /*width*/ 1, /*shift*/ 7); //[7] static const boost::uint32_t SRC_EXTERNAL = 0x0; static const boost::uint32_t SRC_INTERNAL = 0x2; @@ -221,6 +222,7 @@ namespace uhd { namespace usrp { namespace x300 { set(PPS_OUT_EN, 0); set(TCXO_EN, 1); set(GPSDO_PWR_EN, 1); //GPSDO power always ON + set(TIME_SYNC, 0); } } clock_ctrl_reg; -- cgit v1.2.3 From 9f9a55e1f59dfd1ff7c6580f4e8c7752ac87775b Mon Sep 17 00:00:00 2001 From: michael-west Date: Mon, 2 Nov 2015 16:05:01 -0800 Subject: Bumped FPGA compat numbers for B200, X300, and E300. --- host/lib/usrp/b200/b200_impl.hpp | 2 +- host/lib/usrp/e300/e300_fpga_defs.hpp | 2 +- host/lib/usrp/x300/x300_fw_common.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/x300') diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 4ddb29f0b..538ee8cd7 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -49,7 +49,7 @@ #include "recv_packet_demuxer_3000.hpp" static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 8; static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0; -static const boost::uint16_t B200_FPGA_COMPAT_NUM = 11; +static const boost::uint16_t B200_FPGA_COMPAT_NUM = 12; static const boost::uint16_t B205_FPGA_COMPAT_NUM = 2; static const double B200_BUS_CLOCK_RATE = 100e6; static const boost::uint32_t B200_GPSDO_ST_NONE = 0x83; diff --git a/host/lib/usrp/e300/e300_fpga_defs.hpp b/host/lib/usrp/e300/e300_fpga_defs.hpp index a8fa60d9d..3b21468ba 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 = 11; +static const boost::uint32_t COMPAT_MAJOR = 12; static const boost::uint32_t COMPAT_MINOR = 0; }}}} // namespace diff --git a/host/lib/usrp/x300/x300_fw_common.h b/host/lib/usrp/x300/x300_fw_common.h index 1b88db69a..dc9e6eba1 100644 --- a/host/lib/usrp/x300/x300_fw_common.h +++ b/host/lib/usrp/x300/x300_fw_common.h @@ -33,7 +33,7 @@ extern "C" { #define X300_REVISION_MIN 2 #define X300_FW_COMPAT_MAJOR 4 #define X300_FW_COMPAT_MINOR 0 -#define X300_FPGA_COMPAT_MAJOR 15 +#define X300_FPGA_COMPAT_MAJOR 16 //shared memory sections - in between the stack and the program space #define X300_FW_SHMEM_BASE 0x6000 -- cgit v1.2.3 From bf634e1e902f535ca1ddb4f4a25c84c066018b17 Mon Sep 17 00:00:00 2001 From: Ashish Chaudhari Date: Tue, 24 Nov 2015 12:01:37 -0800 Subject: b2xx,e3xx,x300: Bumped FPGA compat numbers after SW time-sync changes - b200: compat 13 - b200mini: compat 4 - e3xx: compat 14 - x3xx: compat 19 --- host/lib/usrp/b200/b200_impl.hpp | 4 ++-- host/lib/usrp/e300/e300_fpga_defs.hpp | 2 +- host/lib/usrp/x300/x300_fw_common.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'host/lib/usrp/x300') diff --git a/host/lib/usrp/b200/b200_impl.hpp b/host/lib/usrp/b200/b200_impl.hpp index 538ee8cd7..041c8bcb2 100644 --- a/host/lib/usrp/b200/b200_impl.hpp +++ b/host/lib/usrp/b200/b200_impl.hpp @@ -49,8 +49,8 @@ #include "recv_packet_demuxer_3000.hpp" static const boost::uint8_t B200_FW_COMPAT_NUM_MAJOR = 8; static const boost::uint8_t B200_FW_COMPAT_NUM_MINOR = 0; -static const boost::uint16_t B200_FPGA_COMPAT_NUM = 12; -static const boost::uint16_t B205_FPGA_COMPAT_NUM = 2; +static const boost::uint16_t B200_FPGA_COMPAT_NUM = 13; +static const boost::uint16_t B205_FPGA_COMPAT_NUM = 4; static const double B200_BUS_CLOCK_RATE = 100e6; static const boost::uint32_t B200_GPSDO_ST_NONE = 0x83; static const size_t B200_MAX_RATE_USB2 = 53248000; // bytes/s diff --git a/host/lib/usrp/e300/e300_fpga_defs.hpp b/host/lib/usrp/e300/e300_fpga_defs.hpp index 3b21468ba..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 = 12; +static const boost::uint32_t COMPAT_MAJOR = 14; static const boost::uint32_t COMPAT_MINOR = 0; }}}} // namespace diff --git a/host/lib/usrp/x300/x300_fw_common.h b/host/lib/usrp/x300/x300_fw_common.h index dc9e6eba1..549fc9dfa 100644 --- a/host/lib/usrp/x300/x300_fw_common.h +++ b/host/lib/usrp/x300/x300_fw_common.h @@ -33,7 +33,7 @@ extern "C" { #define X300_REVISION_MIN 2 #define X300_FW_COMPAT_MAJOR 4 #define X300_FW_COMPAT_MINOR 0 -#define X300_FPGA_COMPAT_MAJOR 16 +#define X300_FPGA_COMPAT_MAJOR 19 //shared memory sections - in between the stack and the program space #define X300_FW_SHMEM_BASE 0x6000 -- cgit v1.2.3