aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/dboard_manager/magnesium.py
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-12-21 13:08:57 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:06:03 -0800
commite2b155726ee7c2ba6f2333948f5bf35d896b301a (patch)
treec7072dc3b9303721f59ac70e1c24079be1bc3c79 /mpm/python/usrp_mpm/dboard_manager/magnesium.py
parent8eeb664b6762451b506a39da3bc21e96779ab300 (diff)
downloaduhd-e2b155726ee7c2ba6f2333948f5bf35d896b301a.tar.gz
uhd-e2b155726ee7c2ba6f2333948f5bf35d896b301a.tar.bz2
uhd-e2b155726ee7c2ba6f2333948f5bf35d896b301a.zip
mpm: mg: Fix CPLD rev check
Now checks the oldest-compat-rev register. Current rev is read out for logging purposes. Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/dboard_manager/magnesium.py')
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/magnesium.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
index 724314c42..b6743cdc0 100644
--- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py
+++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
@@ -199,15 +199,22 @@ class MgCPLD(object):
self.CPLD_SIGNATURE, signature))
raise RuntimeError("CPLD Status Check Failed!")
rev = self.peek16(self.REG_REVISION)
- if rev != self.CPLD_REV:
- self.log.error("CPLD Revision Mismatch! " \
- "Expected: %d Got: %d", self.CPLD_REV, rev)
+ oldest_compat_rev = self.peek16(self.REG_OLDEST_COMPAT)
+ if oldest_compat_rev != self.CPLD_REV:
+ self.log.error(
+ "CPLD Revision compat mismatch! Expected: %d Got: %d",
+ self.CPLD_REV,
+ oldest_compat_rev
+ )
raise RuntimeError("CPLD Revision Check Failed!")
date_code = self.peek16(self.REG_BUILD_CODE_LSB) | \
(self.peek16(self.REG_BUILD_CODE_MSB) << 16)
- self.log.trace(
- "CPLD Signature: 0x{:X} Revision: 0x{:04X} Date code: 0x{:08X}"
- .format(signature, rev, date_code))
+ self.log.debug(
+ "CPLD Signature: 0x{:X} "
+ "Revision: 0x{:04X} "
+ "Oldest compat rev: 0x{:04X} "
+ "Date code: 0x{:08X}"
+ .format(signature, rev, oldest_compat_rev, date_code))
def set_scratch(self, val):
" Write to the scratch register "