2020-11-18 19:00:40 -06:00
|
|
|
try:
|
|
|
|
import os
|
|
|
|
from sonic_eeprom import eeprom_tlvinfo
|
|
|
|
except ImportError as 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 = "/sys/class/i2c-adapter/i2c-0/0-0053/eeprom"
|
|
|
|
if not os.path.exists(self.eeprom_path):
|
2022-12-01 11:12:50 -06:00
|
|
|
file = "/sys/class/i2c-adapter/i2c-0/new_device"
|
|
|
|
with open(file, 'w') as f:
|
|
|
|
f.write('24c02 0x53\n')
|
2020-11-18 19:00:40 -06:00
|
|
|
super(board, self).__init__(self.eeprom_path, 0, '', True)
|