aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-05-30 23:23:26 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:03:58 -0800
commit34174c98f38a9096adc71665fbb9c00aed345293 (patch)
tree4e28c7180418c9e3c7971fd6219603e88333c199
parentd6525231d16e442d5a4db7ac32cf950074d7d769 (diff)
downloaduhd-34174c98f38a9096adc71665fbb9c00aed345293.tar.gz
uhd-34174c98f38a9096adc71665fbb9c00aed345293.tar.bz2
uhd-34174c98f38a9096adc71665fbb9c00aed345293.zip
eiscat/mpm: Moved EISCAT full init sequence to UHD
-rw-r--r--host/include/uhd/rfnoc/blocks/radio_eiscat.xml4
-rw-r--r--host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp21
-rw-r--r--host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp2
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/eiscat.py7
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py14
5 files changed, 30 insertions, 18 deletions
diff --git a/host/include/uhd/rfnoc/blocks/radio_eiscat.xml b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml
index a7077d503..69f7ffc50 100644
--- a/host/include/uhd/rfnoc/blocks/radio_eiscat.xml
+++ b/host/include/uhd/rfnoc/blocks/radio_eiscat.xml
@@ -48,6 +48,10 @@
<address>201</address>
</setreg>
<setreg>
+ <name>SR_SYSREF</name>
+ <address>221</address>
+ </setreg>
+ <setreg>
<name>SR_CHANNEL_GAIN_0</name>
<address>204</address>
</setreg>
diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp
index ce5c4ca26..d948a89c0 100644
--- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp
+++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.cpp
@@ -35,7 +35,6 @@ namespace {
const size_t SR_ANTENNA_SELECT_BASE = 192; // Note: On other dboards, 192 is DB_GPIO address space
const size_t RB_CHOOSE_BEAMS = 10;
-
const double EISCAT_TICK_RATE = 208e6; // Hz
const double EISCAT_RADIO_RATE = 104e6; // Hz
const double EISCAT_CENTER_FREQ = 104e6; // Hz
@@ -394,9 +393,27 @@ bool eiscat_radio_ctrl_impl::check_radio_config()
void eiscat_radio_ctrl_impl::set_rpc_client(
uhd::rpc_client::sptr rpcc,
- const uhd::device_addr_t & /* block_args */
+ const uhd::device_addr_t &block_args
) {
_rpcc = rpcc;
+ std::function<void()> send_sysref;
+ if (block_args.has_key("use_mpm_sysref")) {
+ send_sysref = [rpcc](){ rpcc->call<void>("db_0_send_sysref"); };
+ } else {
+ send_sysref = [this](){ this->sr_write("SR_SYSREF", 1); };
+ }
+
+ UHD_LOG_INFO(
+ "EISCAT",
+ "Finalizing dboard initialization using internal PPS"
+ );
+ send_sysref();
+ rpcc->call_with_token<void>("db_0_init_adcs_and_deframers");
+ rpcc->call_with_token<void>("db_1_init_adcs_and_deframers");
+ send_sysref();
+ std::this_thread::sleep_for(std::chrono::milliseconds(500));
+ rpcc->call_with_token<void>("db_0_check_deframer_status");
+ rpcc->call_with_token<void>("db_1_check_deframer_status");
}
/****************************************************************************
diff --git a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp
index edc44631e..33708f3b3 100644
--- a/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp
+++ b/host/lib/usrp/dboard/eiscat/eiscat_radio_ctrl_impl.hpp
@@ -87,6 +87,8 @@ public:
protected:
virtual bool check_radio_config();
+ /*! Finalize initialization sequence
+ */
void set_rpc_client(
uhd::rpc_client::sptr rpcc,
const uhd::device_addr_t &block_args
diff --git a/mpm/python/usrp_mpm/dboard_manager/eiscat.py b/mpm/python/usrp_mpm/dboard_manager/eiscat.py
index 14b0acd49..0b76c88ee 100644
--- a/mpm/python/usrp_mpm/dboard_manager/eiscat.py
+++ b/mpm/python/usrp_mpm/dboard_manager/eiscat.py
@@ -60,6 +60,9 @@ def create_spidev_iface_phasedac(dev_node):
class ADS54J56(object):
"""
Controls for ADS54J56 ADC
+
+ These commands are very specific to the EISCAT daughterboard, so they stay
+ here.
"""
def __init__(self, regs, log):
self.log = log
@@ -533,8 +536,8 @@ class EISCAT(DboardManagerBase):
def send_sysref(self):
"""
- TODO this is a temp way of sending sysref
- need to replace with timed command
+ Send a SYSREF from MPM. This is not possible to do in a timed
+ fashion though.
"""
self.log.trace("Sending SYSREF via MPM...")
self.radio_regs.poke32(self.SYSREF_CONTROL, 0x0)
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index b1c4840d7..a5036121a 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -148,20 +148,6 @@ class n310(PeriphManagerBase):
}
for ifname, table in iteritems(self._eth_dispatchers):
table.set_ipv4_addr(self._chdr_interfaces[ifname]['ip_addr'])
- self.log.warning("Running a custom EISCAT-specific sequence to bring " \
- "up 2 daughterboards without requiring UHD support. " \
- "This effectively disables Magnesium and must be " \
- "replaced before merging back into n3xx-master."
- )
- self.dboards[0].send_sysref()
- for dboard in self.dboards:
- dboard.init_adcs_and_deframers()
- self.dboards[0].send_sysref()
- time.sleep(0.5)
- for dboard in self.dboards:
- dboard.check_deframer_status()
- assert dboard.initialized
-
def _allocate_sid(self, sender_addr, port, sid, xbar_src_addr, xbar_src_port):
"""