diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-07-14 14:51:14 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-07-14 14:51:14 -0700 |
commit | 7c6bc34f625e3945458a0a2a281850513a02ef08 (patch) | |
tree | 0e34c196d4aceae4cae6d7e22708ded67f558c31 /host/lib/usrp/e300/e300_impl.cpp | |
parent | bb940ccabb94daa685b4869f44c00844eeeb905b (diff) | |
parent | 5f4470a8fb340677f2d0b557f4670bc7506fc38a (diff) | |
download | uhd-7c6bc34f625e3945458a0a2a281850513a02ef08.tar.gz uhd-7c6bc34f625e3945458a0a2a281850513a02ef08.tar.bz2 uhd-7c6bc34f625e3945458a0a2a281850513a02ef08.zip |
Merge branch 'maint'
Conflicts:
fpga-src
host/CMakeLists.txt
host/cmake/Modules/UHDVersion.cmake
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/e300_impl.cpp')
-rw-r--r-- | host/lib/usrp/e300/e300_impl.cpp | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/host/lib/usrp/e300/e300_impl.cpp b/host/lib/usrp/e300/e300_impl.cpp index 231816fe8..de2357100 100644 --- a/host/lib/usrp/e300/e300_impl.cpp +++ b/host/lib/usrp/e300/e300_impl.cpp @@ -284,32 +284,36 @@ e300_impl::e300_impl(const uhd::device_addr_t &device_addr) // load the fpga image //////////////////////////////////////////////////////////////////// if (_xport_path == AXI) { - if (not device_addr.has_key("no_reload_fpga")) { + _do_not_reload = device_addr.has_key("no_reload_fpga"); + if (not _do_not_reload) { // Load FPGA image if provided via args - if (device_addr.has_key("fpga")) { - common::load_fpga_image(device_addr["fpga"]); - // Else load the FPGA image based on the product ID - } else { - //extract the FPGA path for the e300 - const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( + const boost::uint16_t pid = boost::lexical_cast<boost::uint16_t>( device_addr["product"]); - std::string fpga_image; - switch(e300_eeprom_manager::get_mb_type(pid)) { - case e300_eeprom_manager::USRP_E310_MB: - fpga_image = find_image_path(E310_FPGA_FILE_NAME); - break; - case e300_eeprom_manager::USRP_E300_MB: - fpga_image = find_image_path(E300_FPGA_FILE_NAME); - break; - case e300_eeprom_manager::UNKNOWN: - default: - UHD_MSG(warning) << "Unknown motherboard type, loading e300 image." + + std::string fpga_image; + + //extract the FPGA path for the e300 + switch(e300_eeprom_manager::get_mb_type(pid)) { + case e300_eeprom_manager::USRP_E310_MB: + fpga_image = device_addr.cast<std::string>("fpga", + find_image_path(E310_FPGA_FILE_NAME)); + _idle_image = find_image_path(E310_FPGA_IDLE_FILE_NAME); + break; + case e300_eeprom_manager::USRP_E300_MB: + fpga_image = device_addr.cast<std::string>("fpga", + find_image_path(E300_FPGA_FILE_NAME)); + _idle_image = find_image_path(E300_FPGA_IDLE_FILE_NAME); + break; + case e300_eeprom_manager::UNKNOWN: + default: + UHD_MSG(warning) << "Unknown motherboard type, loading e300 image." << std::endl; - fpga_image = find_image_path(E300_FPGA_FILE_NAME); - break; - } - common::load_fpga_image(fpga_image); + fpga_image = device_addr.cast<std::string>("fpga", + find_image_path(E300_FPGA_FILE_NAME)); + _idle_image = find_image_path(E300_FPGA_IDLE_FILE_NAME); + break; } + common::load_fpga_image(fpga_image); } } @@ -623,7 +627,8 @@ uhd::sensor_value_t e300_impl::_get_fe_pll_lock(const bool is_tx) e300_impl::~e300_impl(void) { - /* NOP */ + if (_xport_path == AXI and not _do_not_reload) + common::load_fpga_image(_idle_image); } void e300_impl::_enforce_tick_rate_limits( |