Skip to content

Commit c021963

Browse files
Wirut Getbamrungjleveque
Wirut Getbamrung
authored andcommitted
[sonic_platform_base/chassis_base]: Add firmware management interface (sonic-net#34)
1 parent 73d5848 commit c021963

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

sonic_platform_base/chassis_base.py

+27-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class ChassisBase(device_base.DeviceBase):
4646
# available on the chassis
4747
_sfp_list = []
4848

49+
# List of component names that are available on the chassis
50+
_component_name_list = []
51+
4952
# Object derived from WatchdogBase for interacting with hardware watchdog
5053
_watchdog = None
5154

@@ -95,16 +98,39 @@ def get_reboot_cause(self):
9598
"""
9699
raise NotImplementedError
97100

98-
def get_component_versions(self):
101+
def get_component_name_list(self):
102+
"""
103+
Retrieves a list of the names of components available on the chassis (e.g., BIOS, CPLD, FPGA, etc.)
104+
105+
Returns:
106+
A list containing the names of components available on the chassis
107+
"""
108+
return self._component_name_list
109+
110+
def get_firmware_version(self, component_name):
99111
"""
100112
Retrieves platform-specific hardware/firmware versions for chassis
101113
componenets such as BIOS, CPLD, FPGA, etc.
114+
Args:
115+
component_name: A string, the component name.
102116
103117
Returns:
104118
A string containing platform-specific component versions
105119
"""
106120
raise NotImplementedError
107121

122+
def install_component_firmware(self, component_name, image_path):
123+
"""
124+
Install firmware to component
125+
Args:
126+
component_name: A string, the component name.
127+
image_path: A string, path to firmware image.
128+
129+
Returns:
130+
A boolean, True if install was successful, False if not
131+
"""
132+
raise NotImplementedError
133+
108134
##############################################
109135
# Module methods
110136
##############################################

sonic_platform_base/module_base.py

+36
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class ModuleBase(device_base.DeviceBase):
3333
# available on the module
3434
_sfp_list = []
3535

36+
# List of component names that available on the chassis
37+
_component_name_list = []
38+
3639
def get_base_mac(self):
3740
"""
3841
Retrieves the base MAC address for the module
@@ -66,6 +69,39 @@ def get_system_eeprom_info(self):
6669
"""
6770
raise NotImplementedError
6871

72+
def get_component_name_list(self):
73+
"""
74+
Retrieves a list of the names of components available on the module (e.g., BIOS, CPLD, FPGA, etc.)
75+
76+
Returns:
77+
A list containing the names of components available on the module.
78+
"""
79+
return self._component_name_list
80+
81+
def get_firmware_version(self, component_name):
82+
"""
83+
Retrieves platform-specific hardware/firmware versions for chassis
84+
componenets such as BIOS, CPLD, FPGA, etc.
85+
Args:
86+
component_name: A string, the component name.
87+
88+
Returns:
89+
A string containing platform-specific component versions
90+
"""
91+
raise NotImplementedError
92+
93+
def install_component_firmware(self, component_name, image_path):
94+
"""
95+
Install firmware to component
96+
Args:
97+
component_name: A string, the component name.
98+
image_path: A string, path to firmware image.
99+
100+
Returns:
101+
A boolean, True if install was successful, False if not
102+
"""
103+
raise NotImplementedError
104+
69105
##############################################
70106
# Fan module methods
71107
##############################################

0 commit comments

Comments
 (0)