sonic-buildimage/device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/eeprom.py
Srideep dc994b8425 DellEMC: Dell platform bug fixes on s5248 and s6232 (#4071)
* Dynamic bus detection and loading driver for eeprom on s5248,s5232
* sfputil fix for S5248
2020-01-27 23:28:26 -08:00

33 lines
996 B
Python

#!/usr/bin/env python
#############################################################################
# DellEMC S5232f
#
# Platform and model specific eeprom subclass, inherits from the base class,
# and provides the followings:
# - the eeprom format definition
# - specific encoder/decoder if there is special need
#############################################################################
try:
import os.path
from sonic_eeprom import eeprom_tlvinfo
except ImportError, e:
raise ImportError (str(e) + "- required module not found")
class board(eeprom_tlvinfo.TlvInfoDecoder):
def __init__(self, name, path, cpld_root, ro):
self.eeprom_path = None
for b in (0, 1):
f = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'.format(b)
if os.path.exists(f):
self.eeprom_path = f
break
if self.eeprom_path is None:
return
super(board, self).__init__(self.eeprom_path, 0, '', True)