2019-06-09 14:09:31 -05:00
|
|
|
#############################################################################
|
|
|
|
# Broadcom XLR/GTS 'eeprom' support
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
#
|
2020-04-10 11:25:52 -05:00
|
|
|
# Note: the file /usr/share/sonic/platform/sys_eeprom.bin is generated
|
|
|
|
# by the script brcm-xlr-gts-create-eeprom-file.py
|
2019-06-09 14:09:31 -05:00
|
|
|
#############################################################################
|
|
|
|
|
2020-04-10 11:25:52 -05:00
|
|
|
import os
|
|
|
|
|
2019-06-09 14:09:31 -05:00
|
|
|
try:
|
|
|
|
from sonic_eeprom import eeprom_tlvinfo
|
2020-11-25 12:28:36 -06:00
|
|
|
except ImportError as e:
|
|
|
|
raise ImportError(str(e) + "- required module not found")
|
2019-06-09 14:09:31 -05:00
|
|
|
|
|
|
|
|
|
|
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
|
|
|
|
|
|
|
def __init__(self, name, path, cpld_root, ro):
|
2020-04-10 11:25:52 -05:00
|
|
|
self.eeprom_path = "/usr/share/sonic/platform/sys_eeprom.bin"
|
|
|
|
if os.path.isfile(self.eeprom_path) is False:
|
2020-11-25 12:28:36 -06:00
|
|
|
self.eeprom_path = "/usr/share/sonic/device/x86_64-bcm_xlr-r0/sys_eeprom.bin"
|
2019-06-09 14:09:31 -05:00
|
|
|
super(board, self).__init__(self.eeprom_path, 0, '', False, True)
|
|
|
|
|
|
|
|
def serial_number_str(self, e):
|
|
|
|
"""Return service tag instead of serial number"""
|
|
|
|
return "No service tag"
|