From 0d55f572b7aceac1176f73c163049de4a0bde2eb Mon Sep 17 00:00:00 2001 From: Lars Amsel Date: Tue, 7 Jan 2020 11:21:03 +0100 Subject: 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. --- mpm/python/usrp_mpm/periph_manager/e31x.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mpm/python/usrp_mpm/periph_manager/e31x.py') 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, -- cgit v1.2.3