From b9816d806d390d21f8e6cc3f81bed94fe913ced1 Mon Sep 17 00:00:00 2001 From: Michael Auchter Date: Wed, 9 Jun 2021 11:34:41 -0500 Subject: mpm: max10_cpld_flash_ctrl: only reprogram cpld if necessary When updating the CPLD via the flash method, first read back the CPLD image from flash and compare it with the image to be programmed. If they match, the CPLD is already running the correct image and reprogramming it is not necessary. --- mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mpm') diff --git a/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py b/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py index c1e756124..7ad61c655 100644 --- a/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py +++ b/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py @@ -203,6 +203,14 @@ class Max10CpldFlashCtrl(): if not self.check_reconfig_engine_status(): return False + self.log.debug('Checking if update is necessary...') + if self.verify_flash_memory(raw_data): + self.log.info('CPLD already programmed with specified image, not reprogramming.') + return True + + if not self.check_reconfig_engine_status(): + return False + self.log.debug('Erasing CPLD flash memory...') if not (self.erase_flash_memory() and self.check_reconfig_engine_status()): -- cgit v1.2.3