This change introduces PDDF which is described here: https://github.com/Azure/SONiC/pull/536 Most of the platform bring up effort goes in developing the platform device drivers, SONiC platform APIs and validating them. Typically each platform vendor writes their own drivers and platform APIs which is very tailor made to that platform. This involves writing code, building, installing it on the target platform devices and testing. Many of the details of the platform are hard coded into these drivers, from the HW spec. They go through this cycle repetitively till everything works fine, and is validated before upstreaming the code. PDDF aims to make this platform driver and platform APIs development process much simpler by providing a data driven development framework. This is enabled by: JSON descriptor files for platform data Generic data-driven drivers for various devices Generic SONiC platform APIs Vendor specific extensions for customisation and extensibility Signed-off-by: Fuzail Khan <fuzail.khan@broadcom.com>
28 lines
882 B
Python
Executable File
28 lines
882 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
try:
|
|
import os
|
|
import sys
|
|
import json
|
|
sys.path.append('/usr/share/sonic/platform/plugins')
|
|
import pddfparse
|
|
#from sonic_eeprom import eeprom_base
|
|
from sonic_eeprom import eeprom_tlvinfo
|
|
except ImportError, e:
|
|
raise ImportError (str(e) + "- required module not found")
|
|
|
|
|
|
class board(eeprom_tlvinfo.TlvInfoDecoder):
|
|
_TLV_INFO_MAX_LEN = 256
|
|
def __init__(self, name, path, cpld_root, ro):
|
|
global pddf_obj
|
|
global plugin_data
|
|
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd:
|
|
plugin_data = json.load(pd)
|
|
|
|
pddf_obj = pddfparse.PddfParse()
|
|
# system EEPROM always has device name EEPROM1
|
|
self.eeprom_path = pddf_obj.get_path("EEPROM1", "eeprom")
|
|
super(board, self).__init__(self.eeprom_path, 0, '', True)
|
|
|