diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2016-08-03 12:05:25 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-08-09 12:48:42 -0700 |
commit | 7998db839f5b1515b24dcba5ecae6607685dce99 (patch) | |
tree | 19b7e8b3f3e881122a53a08140233b6e64285ad5 /host/lib/usrp/x300/x300_impl.cpp | |
parent | 650c477cff8ef28a4de9e9a1aeef211d0a026dcb (diff) | |
download | uhd-7998db839f5b1515b24dcba5ecae6607685dce99.tar.gz uhd-7998db839f5b1515b24dcba5ecae6607685dce99.tar.bz2 uhd-7998db839f5b1515b24dcba5ecae6607685dce99.zip |
x3xx: Enable readback of fpga_version_hash
This adds a feature that is already present in e3xx and n230
products allowing to read back the fpga git hash the current
image has been built from.
The value is available via property tree at:
/mboards/0/fpga_version_hash
Note: A compatibility number bump is required, as otherwise the
register will always read back 0
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'host/lib/usrp/x300/x300_impl.cpp')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index ce257947e..ee0baa2a3 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -1609,6 +1609,13 @@ void x300_impl::check_fpga_compat(const fs_path &mb_path, const mboard_members_t } _tree->create<std::string>(mb_path / "fpga_version").set(str(boost::format("%u.%u") % compat_major % compat_minor)); + + const boost::uint32_t git_hash = members.zpu_ctrl->peek32(SR_ADDR(SET0_BASE, + ZPU_RB_GIT_HASH)); + _tree->create<std::string>(mb_path / "fpga_version_hash").set( + str(boost::format("%07x%s") + % (git_hash & 0x0FFFFFFF) + % ((git_hash & 0xF000000) ? "-dirty" : ""))); } x300_impl::x300_mboard_t x300_impl::get_mb_type_from_pcie(const std::string& resource, const std::string& rpc_port) |