aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/x300
diff options
context:
space:
mode:
authorAshish Chaudhari <ashish@ettus.com>2016-02-18 17:40:47 -0800
committerAshish Chaudhari <ashish@ettus.com>2016-02-18 17:40:47 -0800
commit1c2f56bbc1ccd0bffaac8fa4da174d1ad130a3ba (patch)
treea6c4fb7f587a6949485717d13cea3e4fa53e3496 /host/lib/usrp/x300
parent2d68f228888807d0fd76c7b759ec39fd86523f67 (diff)
parented4223d74cab604213b925da2eccb6055aa7aea2 (diff)
downloaduhd-1c2f56bbc1ccd0bffaac8fa4da174d1ad130a3ba.tar.gz
uhd-1c2f56bbc1ccd0bffaac8fa4da174d1ad130a3ba.tar.bz2
uhd-1c2f56bbc1ccd0bffaac8fa4da174d1ad130a3ba.zip
Merge branch 'maint'
Conflicts: host/lib/usrp/cores/gpio_core_200.cpp host/lib/usrp/dboard/db_ubx.cpp
Diffstat (limited to 'host/lib/usrp/x300')
-rw-r--r--host/lib/usrp/x300/x300_clock_ctrl.cpp9
-rw-r--r--host/lib/usrp/x300/x300_clock_ctrl.hpp1
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp1
-rw-r--r--host/lib/usrp/x300/x300_impl.hpp1
4 files changed, 9 insertions, 3 deletions
diff --git a/host/lib/usrp/x300/x300_clock_ctrl.cpp b/host/lib/usrp/x300/x300_clock_ctrl.cpp
index d5687f5cc..3df2b7c02 100644
--- a/host/lib/usrp/x300/x300_clock_ctrl.cpp
+++ b/host/lib/usrp/x300/x300_clock_ctrl.cpp
@@ -28,7 +28,6 @@
static const double X300_REF_CLK_OUT_RATE = 10e6;
static const boost::uint16_t X300_MAX_CLKOUT_DIV = 1045;
-static const double X300_DEFAULT_DBOARD_CLK_RATE = 50e6;
struct x300_clk_delays {
x300_clk_delays() :
@@ -70,11 +69,13 @@ public:
const size_t slaveno,
const size_t hw_rev,
const double master_clock_rate,
+ const double dboard_clock_rate,
const double system_ref_rate):
_spiface(spiface),
_slaveno(slaveno),
_hw_rev(hw_rev),
_master_clock_rate(master_clock_rate),
+ _dboard_clock_rate(dboard_clock_rate),
_system_ref_rate(system_ref_rate)
{
init();
@@ -603,7 +604,7 @@ private:
std::ceil(_vco_freq / _master_clock_rate));
boost::uint16_t dboard_div = static_cast<boost::uint16_t>(
- std::ceil(_vco_freq / X300_DEFAULT_DBOARD_CLK_RATE));
+ std::ceil(_vco_freq / _dboard_clock_rate));
/* Reset the LMK clock controller. */
_lmk04816_regs.RESET = lmk04816_regs_t::RESET_RESET;
@@ -731,6 +732,7 @@ private:
const size_t _slaveno;
const size_t _hw_rev;
const double _master_clock_rate;
+ const double _dboard_clock_rate;
const double _system_ref_rate;
lmk04816_regs_t _lmk04816_regs;
double _vco_freq;
@@ -741,7 +743,8 @@ x300_clock_ctrl::sptr x300_clock_ctrl::make(uhd::spi_iface::sptr spiface,
const size_t slaveno,
const size_t hw_rev,
const double master_clock_rate,
+ const double dboard_clock_rate,
const double system_ref_rate) {
return sptr(new x300_clock_ctrl_impl(spiface, slaveno, hw_rev,
- master_clock_rate, system_ref_rate));
+ master_clock_rate, dboard_clock_rate, system_ref_rate));
}
diff --git a/host/lib/usrp/x300/x300_clock_ctrl.hpp b/host/lib/usrp/x300/x300_clock_ctrl.hpp
index 160a14e6d..7126f1b9f 100644
--- a/host/lib/usrp/x300/x300_clock_ctrl.hpp
+++ b/host/lib/usrp/x300/x300_clock_ctrl.hpp
@@ -48,6 +48,7 @@ public:
const size_t slaveno,
const size_t hw_rev,
const double master_clock_rate,
+ const double dboard_clock_rate,
const double system_ref_rate);
/*! Get the master clock rate of the device.
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 0491e7274..80953ac20 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -689,6 +689,7 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
1 /*slaveno*/,
mb.hw_rev,
dev_addr.cast<double>("master_clock_rate", X300_DEFAULT_TICK_RATE),
+ dev_addr.cast<double>("dboard_clock_rate", X300_DEFAULT_DBOARD_CLK_RATE),
dev_addr.cast<double>("system_ref_rate", X300_DEFAULT_SYSREF_RATE));
//Initialize clock source to use internal reference and generate
diff --git a/host/lib/usrp/x300/x300_impl.hpp b/host/lib/usrp/x300/x300_impl.hpp
index c5e3af698..6ebea0161 100644
--- a/host/lib/usrp/x300/x300_impl.hpp
+++ b/host/lib/usrp/x300/x300_impl.hpp
@@ -55,6 +55,7 @@
static const std::string X300_FW_FILE_NAME = "usrp_x300_fw.bin";
static const double X300_DEFAULT_TICK_RATE = 200e6; //Hz
+static const double X300_DEFAULT_DBOARD_CLK_RATE = 50e6; //Hz
static const double X300_BUS_CLOCK_RATE = 166.666667e6; //Hz
static const size_t X300_TX_HW_BUFF_SIZE_SRAM = 520*1024; //512K SRAM buffer + 8K 2Clk FIFO