aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_prop_tree.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_prop_tree.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
index 556e2e48d..2bd955194 100644
--- a/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
+++ b/host/lib/usrp/mpmd/mpmd_prop_tree.cpp
@@ -13,6 +13,8 @@
#include <uhd/types/eeprom.hpp>
#include <uhd/types/sensors.hpp>
#include <uhd/usrp/mboard_eeprom.hpp>
+#include <uhd/utils/cast.hpp>
+#include <boost/algorithm/string/case_conv.hpp>
using namespace uhd;
using namespace uhd::mpmd;
@@ -34,6 +36,7 @@ uhd::usrp::component_files_t _update_component(
// Also construct a copy of just the metadata to store in the property tree
uhd::usrp::component_files_t all_comps_copy;
+ bool just_reload = false;
for (const auto& comp : comps) {
// Make a map for update components args
std::map<std::string, std::string> metadata;
@@ -43,6 +46,12 @@ uhd::usrp::component_files_t _update_component(
for (const auto& key : comp.metadata.keys()) {
metadata[key] = comp.metadata[key];
comp_copy.metadata[key] = comp.metadata[key];
+ if (key == "just_reload") {
+ just_reload =
+ just_reload
+ | uhd::cast::from_str<bool>(metadata.at("just_reload"));
+ //| (boost::to_lower_copy(metadata.at("just_reload")) == "true");
+ }
}
// Copy to the update component args
all_data.push_back(comp.data);
@@ -51,6 +60,15 @@ uhd::usrp::component_files_t _update_component(
all_comps_copy.push_back(comp_copy);
}
+ // If reset is specified we presume that the fpga/dts
+ // components were updated in the last uhd::image_loader::load()
+ // call and just reload the fpga/dts by resetting the peripheral
+ // manager.
+ if (just_reload) {
+ mb->rpc->notify_with_token(MPMD_DEFAULT_INIT_TIMEOUT, "reset_timer_and_mgr");
+ return all_comps_copy;
+ }
+
// Now call update component
mb->rpc->notify_with_token(
MPMD_DEFAULT_INIT_TIMEOUT, "update_component", all_metadata, all_data);