diff options
author | Virendra Kakade <virendra.kakade@ni.com> | 2021-11-23 13:34:01 -0600 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2021-12-02 06:42:09 -0800 |
commit | 6d6fc2a01dfa23627421d6b4d9efb25755be36ae (patch) | |
tree | 1c6edbfd75438f4645b0c08ae67d1df619d2a8bc /mpm/python/usrp_mpm/chips | |
parent | 84323ef7bc2c5ba522cffe937e8ab4671f5f5658 (diff) | |
download | uhd-6d6fc2a01dfa23627421d6b4d9efb25755be36ae.tar.gz uhd-6d6fc2a01dfa23627421d6b4d9efb25755be36ae.tar.bz2 uhd-6d6fc2a01dfa23627421d6b4d9efb25755be36ae.zip |
uhd: add support for max10 variants
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
Diffstat (limited to 'mpm/python/usrp_mpm/chips')
-rw-r--r-- | mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py | 20 |
1 files changed, 18 insertions, 2 deletions
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 392356552..388706b5a 100644 --- a/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py +++ b/mpm/python/usrp_mpm/chips/max10_cpld_flash_ctrl.py @@ -107,11 +107,27 @@ class Max10CpldFlashCtrl(): def erase_flash_memory(self): with self: + # determine M04 or M08 variant based on + # value encoded in the FLASH_CFM0_START_ADDR_REG + # register + start_addr = self.get_start_addr() + if start_addr == 0x9C00: + self.max10_variant = "m04" + elif start_addr == 0xAC00: + self.max10_variant = "m08" + else: + raise RuntimeError('Unknown MAX10 variant (FLASH_CFM0_START_ADDR_REG=0x{:04X})'.format(start_addr)) # check for sectors to be erased: if self.is_memory_initialization_enabled(): - sectors = [2, 3, 4] + if self.max10_variant == "m04": + sectors = [2, 3, 4] + else: + sectors = [3, 4, 5] else: - sectors = [4] + if self.max10_variant == "m04": + sectors = [4] + else: + sectors = [5] # erase each sector individually for sector in sectors: # start erase |