diff options
Diffstat (limited to 'host')
-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; |