aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_iface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_iface.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_iface.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_iface.cpp b/host/lib/usrp/usrp2/usrp2_iface.cpp
index 170447b6e..123910166 100644
--- a/host/lib/usrp/usrp2/usrp2_iface.cpp
+++ b/host/lib/usrp/usrp2/usrp2_iface.cpp
@@ -106,13 +106,6 @@ public:
_protocol_compat = ntohl(ctrl_data.proto_ver);
mb_eeprom = mboard_eeprom_t(*this, mboard_eeprom_t::MAP_N100);
-
- //----------------------- special temporary warning ------------
- if (mb_eeprom["gpsdo"] == "internal" and _protocol_compat < USRP2_FW_COMPAT_NUM){
- UHD_MSG(warning) << "You must upgrade your USRP's firmware to use the GPSDO" << std::endl;
- }
- //--------------------------------------------------------------
-
}
~usrp2_iface_impl(void){UHD_SAFE_CALL(
@@ -130,11 +123,14 @@ public:
}
else{
_lock_task.reset(); //shutdown the task
- this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_POKE32>(U2_FW_REG_LOCK_TIME, 0xfffffff0); //unlock
+ this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_POKE32>(U2_FW_REG_LOCK_TIME, 0); //unlock
}
}
bool is_device_locked(void){
+ //never assume lock with fpga image mismatch
+ if ((this->peek32(U2_REG_COMPAT_NUM_RB) >> 16) != USRP2_FPGA_COMPAT_NUM) return false;
+
boost::uint32_t lock_time = this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_PEEK32>(U2_FW_REG_LOCK_TIME);
boost::uint32_t lock_gpid = this->get_reg<boost::uint32_t, USRP2_REG_ACTION_FW_PEEK32>(U2_FW_REG_LOCK_GPID);
@@ -142,6 +138,7 @@ public:
const boost::uint32_t lock_timeout_time = boost::uint32_t(3*100e6);
//if the difference is larger, assume not locked anymore
+ if ((lock_time & 1) == 0) return false; //bit0 says unlocked
const boost::uint32_t time_diff = this->get_curr_time() - lock_time;
if (time_diff >= lock_timeout_time) return false;
@@ -157,7 +154,7 @@ public:
}
boost::uint32_t get_curr_time(void){
- return this->peek32(U2_REG_TIME64_LO_RB_IMM);
+ return this->peek32(U2_REG_TIME64_LO_RB_IMM) | 1; //bit 1 says locked
}
/***********************************************************************