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 | |
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')
-rw-r--r-- | host/lib/usrp/x300/x300_impl.cpp | 7 | ||||
-rw-r--r-- | host/lib/usrp/x300/x300_regs.hpp | 3 |
2 files changed, 8 insertions, 2 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) diff --git a/host/lib/usrp/x300/x300_regs.hpp b/host/lib/usrp/x300/x300_regs.hpp index 458d6ba0f..c5ed1460b 100644 --- a/host/lib/usrp/x300/x300_regs.hpp +++ b/host/lib/usrp/x300/x300_regs.hpp @@ -53,10 +53,9 @@ static const int ZPU_RB_SPI = 2; static const int ZPU_RB_CLK_STATUS = 3; static const int ZPU_RB_COMPAT_NUM = 6; static const int ZPU_RB_NUM_CE = 7; +static const int ZPU_RB_GIT_HASH = 10; static const int ZPU_RB_SFP0_TYPE = 4; static const int ZPU_RB_SFP1_TYPE = 5; -static const int ZPU_RB_DRAM_FIFO0 = 10; -static const int ZPU_RB_DRAM_FIFO1 = 11; static const uint32_t RB_SFP_1G_ETH = 0; static const uint32_t RB_SFP_10G_ETH = 1; |