Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BFN] Implementation API for platform component #10180

Merged
merged 11 commits into from
Mar 10, 2022
8 changes: 8 additions & 0 deletions device/barefoot/x86_64-accton_as9516_32d-r0/platform.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"chassis": {
"name": "Newport",
"components": [
{
"name": "BIOS"
},
{
"name": "BMC"
}
],
"fans": [
{
"name": "counter-rotating-fan-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"chassis": {
"Newport": {
"component": {
}
}
}
{
"chassis": {
"Newport": {
"component": {
"BIOS": { },
"BMC": { }
}
}
}
}
8 changes: 8 additions & 0 deletions device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"chassis": {
"name": "Wedge100BF-32X-O-AC-F-BF",
"components": [
{
"name": "BIOS"
},
{
"name": "BMC"
}
],
"fans": [
{
"name": "counter-rotating-fan-1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"chassis": {
"Wedge100BF-32X-O-AC-F-BF": {
"component": {
}
}
}
{
"chassis": {
"Wedge100BF-32X-O-AC-F-BF": {
"component": {
"BIOS": { },
"BMC": { }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

NUM_COMPONENT = 2
class Chassis(ChassisBase):
"""
Platform-specific Chassis class
Expand All @@ -44,6 +45,7 @@ def __init__(self):
self.ready = False
self.phy_port_cur_state = {}
self.qsfp_interval = self.QSFP_CHECK_INTERVAL
self.__initialize_components()

@property
def _eeprom(self):
Expand Down Expand Up @@ -128,6 +130,12 @@ def qsfp_max_port_get(client):
self.PORT_END = self.QSFP_PORT_END
self.PORTS_IN_BLOCK = self.QSFP_PORT_END

def __initialize_components(self):
from sonic_platform.component import Components
for index in range(0, NUM_COMPONENT):
component = Components(index)
self._component_list.append(component)

def get_name(self):
"""
Retrieves the name of the chassis
Expand Down
Loading