aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/b200
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-02-10 18:18:25 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-12 17:31:55 +0200
commit2902fa87824997a17b48742c494648440c53d317 (patch)
tree1ead5c0a380efe486a17d5dc1ed1847494055f81 /host/lib/usrp/b200
parentec786351c73a4b94bf43f5212b1f57d0820267bb (diff)
downloaduhd-2902fa87824997a17b48742c494648440c53d317.tar.gz
uhd-2902fa87824997a17b48742c494648440c53d317.tar.bz2
uhd-2902fa87824997a17b48742c494648440c53d317.zip
Add support for LEA-M8F GPSDO board
Diffstat (limited to 'host/lib/usrp/b200')
-rw-r--r--host/lib/usrp/b200/b200_cores.cpp8
-rw-r--r--host/lib/usrp/b200/b200_cores.hpp1
-rw-r--r--host/lib/usrp/b200/b200_impl.cpp11
3 files changed, 19 insertions, 1 deletions
diff --git a/host/lib/usrp/b200/b200_cores.cpp b/host/lib/usrp/b200/b200_cores.cpp
index 010c012a6..6999ba474 100644
--- a/host/lib/usrp/b200/b200_cores.cpp
+++ b/host/lib/usrp/b200/b200_cores.cpp
@@ -64,6 +64,14 @@ void b200_ref_pll_ctrl::set_lock_to_ext_ref(bool external)
_spi->restore_perif();
}
+bool b200_ref_pll_ctrl::set_refclk_frequency(int refclk_kHz)
+{
+ _spi->change_perif(b200_local_spi_core::PLL);
+ bool success = adf4001_ctrl::set_refclk_frequency(refclk_kHz);
+ _spi->restore_perif();
+ return success;
+}
+
b200_local_spi_core::sptr b200_local_spi_core::make(
uhd::wb_iface::sptr iface, b200_local_spi_core::perif_t default_perif)
diff --git a/host/lib/usrp/b200/b200_cores.hpp b/host/lib/usrp/b200/b200_cores.hpp
index 4d327f8f6..1f0613b06 100644
--- a/host/lib/usrp/b200/b200_cores.hpp
+++ b/host/lib/usrp/b200/b200_cores.hpp
@@ -48,6 +48,7 @@ public:
b200_ref_pll_ctrl(b200_local_spi_core::sptr spi);
virtual void set_lock_to_ext_ref(bool external);
+ virtual bool set_refclk_frequency(int refclk_kHz);
private:
b200_local_spi_core::sptr _spi;
diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp
index dac54bb05..12da66a0f 100644
--- a/host/lib/usrp/b200/b200_impl.cpp
+++ b/host/lib/usrp/b200/b200_impl.cpp
@@ -479,7 +479,8 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
if (_gpsdo_capable)
{
- if ((_local_ctrl->peek32(RB32_CORE_STATUS) & 0xff) != B200_GPSDO_ST_NONE)
+ // Do not check this flag, I don't see why it is needed
+ //if ((_local_ctrl->peek32(RB32_CORE_STATUS) & 0xff) != B200_GPSDO_ST_NONE)
{
UHD_LOGGER_INFO("B200") << "Detecting internal GPSDO.... " << std::flush;
try
@@ -739,6 +740,14 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s
_tree->access<std::string>(mb_path / "clock_source/value").set("internal");
_tree->access<std::string>(mb_path / "time_source/value").set("internal");
+ //GPS installed: use external ref, time, and init time spec
+ if (_gps and _gps->gps_detected()) {
+ const int freq = _gps->gps_refclock_frequency();
+ if (not _adf4001_iface->set_refclk_frequency(freq)) {
+ throw uhd::value_error("Could not set refclk frequency");
+ }
+ }
+
// Set the DSP chains to some safe value
for (size_t i = 0; i < _radio_perifs.size(); i++) {
_radio_perifs[i].ddc->set_host_rate(default_tick_rate / ad936x_manager::DEFAULT_DECIM);