From e2b155726ee7c2ba6f2333948f5bf35d896b301a Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 21 Dec 2017 13:08:57 -0800 Subject: 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 Reviewed-by: Moritz Fischer --- mpm/python/usrp_mpm/dboard_manager/magnesium.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'mpm/python/usrp_mpm/dboard_manager/magnesium.py') 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 " -- cgit v1.2.3