aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-07-14 12:51:08 -0700
committerMartin Braun <martin.braun@ettus.com>2015-07-14 14:02:25 -0700
commit8f47d5b898d7b60f5139fed242309597834c0c52 (patch)
tree1cf547c3aac15eef04b5d7bd160075c2ac76f82a /host/lib
parent6091e8759a9291f4a2134cf726683c24983eebf7 (diff)
downloaduhd-8f47d5b898d7b60f5139fed242309597834c0c52.tar.gz
uhd-8f47d5b898d7b60f5139fed242309597834c0c52.tar.bz2
uhd-8f47d5b898d7b60f5139fed242309597834c0c52.zip
x300: Added max hw rev checking
Diffstat (limited to 'host/lib')
-rw-r--r--host/lib/usrp/x300/x300_fw_common.h1
-rw-r--r--host/lib/usrp/x300/x300_impl.cpp10
2 files changed, 11 insertions, 0 deletions
diff --git a/host/lib/usrp/x300/x300_fw_common.h b/host/lib/usrp/x300/x300_fw_common.h
index 42583f7f0..76531f921 100644
--- a/host/lib/usrp/x300/x300_fw_common.h
+++ b/host/lib/usrp/x300/x300_fw_common.h
@@ -29,6 +29,7 @@
extern "C" {
#endif
+#define X300_MAX_HW_REV 6
#define X300_FW_COMPAT_MAJOR 3
#define X300_FW_COMPAT_MINOR 0
#define X300_FPGA_COMPAT_MAJOR 9
diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp
index 809a56765..58914c02b 100644
--- a/host/lib/usrp/x300/x300_impl.cpp
+++ b/host/lib/usrp/x300/x300_impl.cpp
@@ -622,6 +622,16 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr)
mb.hw_rev = X300_REV("D");
}
+ UHD_VAR(mb.hw_rev)
+ if (mb.hw_rev > X300_MAX_HW_REV) {
+ throw uhd::runtime_error(str(
+ boost::format("Unsupported board revision number: %d.\n"
+ "The maximum board revision number supported in this version is %d.\n"
+ "Please update your UHD version.")
+ % mb.hw_rev % X300_MAX_HW_REV
+ ));
+ }
+
//Create clock control. NOTE: This does not configure the LMK yet.
initialize_clock_control(mb);
mb.clock = x300_clock_ctrl::make(mb.zpu_spi,