diff options
author | Virendra Kakade <virendra.kakade@ni.com> | 2019-04-30 17:05:28 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-01-11 13:18:22 -0600 |
commit | fab4a5dd1708de6c5dc5fb4dc50b396a4adfeb51 (patch) | |
tree | c051515b67bbf12921d5c83ae6ac80337632f508 /host/lib/usrp/mpmd/mpmd_prop_tree.cpp | |
parent | 643dd4f9d103da89feaa600214f2dab9d3c64bdc (diff) | |
download | uhd-fab4a5dd1708de6c5dc5fb4dc50b396a4adfeb51.tar.gz uhd-fab4a5dd1708de6c5dc5fb4dc50b396a4adfeb51.tar.bz2 uhd-fab4a5dd1708de6c5dc5fb4dc50b396a4adfeb51.zip |
mpmd: Add support to delay and trigger fpga/dts load after update
Add a new image_loader argument delay_reload to provide a way to update
components but optionally delay the actual load.
Similarly add a new argument, just_reload, to enable uhd to reload
the fpga/dts components.
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_prop_tree.cpp')
-rw-r--r-- | host/lib/usrp/mpmd/mpmd_prop_tree.cpp | 18 |
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); |