2018-03-23 14:36:25 -05:00
|
|
|
try:
|
|
|
|
import binascii
|
|
|
|
import time
|
|
|
|
import optparse
|
|
|
|
import warnings
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
from sonic_eeprom import eeprom_base
|
|
|
|
from sonic_eeprom import eeprom_tlvinfo
|
|
|
|
import subprocess
|
2020-11-25 12:28:36 -06:00
|
|
|
except ImportError as e:
|
|
|
|
raise ImportError(str(e) + "- required module not found")
|
|
|
|
|
2018-03-23 14:36:25 -05:00
|
|
|
|
|
|
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
|
|
|
_TLV_INFO_MAX_LEN = 256
|
2020-11-25 12:28:36 -06:00
|
|
|
|
2018-03-23 14:36:25 -05:00
|
|
|
def __init__(self, name, path, cpld_root, ro):
|
2022-03-17 19:47:08 -05:00
|
|
|
exists = os.path.isfile('/sys/bus/i2c/devices/0-0056/eeprom')
|
|
|
|
if (exists is True):
|
|
|
|
self.eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom"
|
|
|
|
else:
|
|
|
|
self.eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom"
|
|
|
|
|
2018-03-23 14:36:25 -05:00
|
|
|
super(board, self).__init__(self.eeprom_path, 0, '', True)
|