aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/e31x.py
diff options
context:
space:
mode:
authorLars Amsel <lars.amsel@ni.com>2020-01-07 11:21:03 +0100
committerMartin Braun <martin@gnuradio.org>2021-05-31 05:28:47 -0700
commit0d55f572b7aceac1176f73c163049de4a0bde2eb (patch)
tree42e585a2f7432184405f8536b665ca53e2e1ac8d /mpm/python/usrp_mpm/periph_manager/e31x.py
parent530cb0a8aaaac906fe124086e780d6651241b0ad (diff)
downloaduhd-0d55f572b7aceac1176f73c163049de4a0bde2eb.tar.gz
uhd-0d55f572b7aceac1176f73c163049de4a0bde2eb.tar.bz2
uhd-0d55f572b7aceac1176f73c163049de4a0bde2eb.zip
mpm: Add symbol name based EEPROM read, cleanup EEPROM handling
Handling of EEPROM read was cleanup in PeriphManagerBase such that EEPROM reading for mother and daugther board have similar names and signatures. Base class supports symbol names for the nvmem files which make it easy to find them by name such as db0_eeprom instead of addresses like ff020000.i2c:cros-ec@3c:db0-i2c-tunnel. Base class furthermore reads out all available auxiliary board EEPROM files and stores them in a dictionary member.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/e31x.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/e31x.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/e31x.py b/mpm/python/usrp_mpm/periph_manager/e31x.py
index 94d6f7529..e7da81ca5 100644
--- a/mpm/python/usrp_mpm/periph_manager/e31x.py
+++ b/mpm/python/usrp_mpm/periph_manager/e31x.py
@@ -343,14 +343,15 @@ class e31x(ZynqComponents, PeriphManagerBase):
If no EEPROM is defined, returns empty values.
"""
+ (self._eeprom_head, self.eeprom_rawdata) = {}, b''
eeprom_path = \
get_eeprom_paths(self.mboard_eeprom_addr)[self.mboard_eeprom_path_index]
if not eeprom_path:
self.log.error("Could not identify EEPROM path for %s!",
self.mboard_eeprom_addr)
- return {}, b''
+ return
self.log.trace("MB EEPROM: Using path {}".format(eeprom_path))
- (eeprom_head, eeprom_rawdata) = e31x_legacy_eeprom.read_eeprom(
+ (self._eeprom_head, self.eeprom_rawdata) = e31x_legacy_eeprom.read_eeprom(
True, # is_motherboard
eeprom_path,
self.mboard_eeprom_offset,
@@ -358,10 +359,9 @@ class e31x(ZynqComponents, PeriphManagerBase):
e31x_legacy_eeprom.MboardEEPROM.eeprom_header_keys,
self.mboard_eeprom_max_len
)
- self.log.trace("Read %d bytes of EEPROM data.", len(eeprom_rawdata))
- return eeprom_head, eeprom_rawdata
+ self.log.trace("Read %d bytes of EEPROM data.", len(self.eeprom_rawdata))
- def _read_dboard_eeprom(self, dboard_eeprom_path):
+ def _read_dboard_eeprom_data(self, dboard_eeprom_path):
return e31x_legacy_eeprom.read_eeprom(
False, # is not motherboard.
dboard_eeprom_path,