aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/mboard_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-04-08 16:59:29 -0500
committerJosh Blum <josh@joshknows.com>2011-04-08 16:59:29 -0500
commit2f102fbff2b7245d3d038e7dfffaa2de856b61aa (patch)
tree9f00fc9c1df092beb5142fafebc34f84eba817cf /host/lib/usrp/usrp2/mboard_impl.cpp
parentf0a2601d456ba4b5a75a7f0c9d21d2ab517dacec (diff)
downloaduhd-2f102fbff2b7245d3d038e7dfffaa2de856b61aa.tar.gz
uhd-2f102fbff2b7245d3d038e7dfffaa2de856b61aa.tar.bz2
uhd-2f102fbff2b7245d3d038e7dfffaa2de856b61aa.zip
usrp2: support fw protos with older compats for various parts
i2c, spi, and uart are long time no changing registers changed recently (think re-map) also, perform the fpga compat check in the make now we can find devices with out of date images
Diffstat (limited to 'host/lib/usrp/usrp2/mboard_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/mboard_impl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/host/lib/usrp/usrp2/mboard_impl.cpp b/host/lib/usrp/usrp2/mboard_impl.cpp
index 40fc5098b..7a6c596bc 100644
--- a/host/lib/usrp/usrp2/mboard_impl.cpp
+++ b/host/lib/usrp/usrp2/mboard_impl.cpp
@@ -66,6 +66,16 @@ usrp2_mboard_impl::usrp2_mboard_impl(
device_addr["addr"], BOOST_STRINGIZE(USRP2_UDP_CTRL_PORT)
)))
{
+
+ //check the fpga compatibility number
+ const boost::uint32_t fpga_compat_num = _iface->peek32(_iface->regs.compat_num_rb);
+ if (fpga_compat_num != USRP2_FPGA_COMPAT_NUM){
+ throw uhd::runtime_error(str(boost::format(
+ "Expected fpga compatibility number %d, but got %d:\n"
+ "The fpga build is not compatible with the host code build."
+ ) % int(USRP2_FPGA_COMPAT_NUM) % fpga_compat_num));
+ }
+
//construct transports for dsp and async errors
std::cout << "Making transport for DSP0..." << std::endl;
device.dsp_xports.push_back(udp_zero_copy::make(