def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): self.is_psu_eeprom = is_psu self.is_fan_eeprom = is_fan self.is_sys_eeprom = not (is_psu | is_fan) if self.is_sys_eeprom: self.start_offset = 0 self.eeprom_path = self.I2C_DIR + "i2c-10/10-0053/eeprom" # System EEPROM is in ONIE TlvInfo EEPROM format super(Eeprom, self).__init__(self.eeprom_path, self.start_offset, '', True) self._load_system_eeprom() else: self.start_offset = 6 if self.is_psu_eeprom: self.index = psu_index self.eeprom_path = self.I2C_DIR \ + "i2c-1/1-005{}/eeprom".format(2 - self.index) self.format = psu_eeprom_format else: self.index = fan_index self.eeprom_path = self.I2C_DIR \ + "i2c-11/11-005{}/eeprom".format(4 - self.index) self.format = fan_eeprom_format EepromDecoder.__init__(self, self.eeprom_path, self.format, self.start_offset, '', True) self._load_device_eeprom()
def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): self.is_psu_eeprom = is_psu self.is_fan_eeprom = is_fan self.is_sys_eeprom = not (is_psu | is_fan) if self.is_sys_eeprom: self.start_offset = 0 self.eeprom_path = self.I2C_DIR + "i2c-0/0-0053/eeprom" # System EEPROM is in ONIE TlvInfo EEPROM format super(Eeprom, self).__init__(self.eeprom_path, self.start_offset, '', True) self._load_system_eeprom() else: if self.is_psu_eeprom: self.index = psu_index self.start_offset = 18 self.eeprom_path = self.I2C_DIR \ + "i2c-1/1-005{}/eeprom".format(self.index - 1) self.format = psu_eeprom_format # Decode device eeprom as per specified format EepromDecoder.__init__(self, self.eeprom_path, self.format, self.start_offset, '', True) else: self.index = fan_index self.start_offset = 0 self.eeprom_path = self.I2C_DIR \ + "i2c-0/0-005{}/eeprom".format(self.index + 4) # Fan EEPROM is in ONIE TlvInfo EEPROM format super(Eeprom, self).__init__(self.eeprom_path, self.start_offset, '', True) self._load_device_eeprom()
def __init__(self, eeprom_path, device_format, start_offset): # Decode device eeprom as per specified format self.format = device_format self.start_offset = start_offset EepromDecoder.__init__(self, eeprom_path, self.format, self.start_offset, '', True) self._load_device_eeprom()
def __init__(self, prefdl, **kwargs): EepromDecoder.__init__(self, path=None, format=None, start=0, status='', readonly=True, **kwargs) self._prefdl = prefdl