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

[sonic_platform_base/chassis_base]: Add firmware management interface #34

Merged
merged 5 commits into from
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class ChassisBase(device_base.DeviceBase):
# available on the chassis
_sfp_list = []

# List of component names that available on the chassis
jleveque marked this conversation as resolved.
Show resolved Hide resolved
_component_list = []
jleveque marked this conversation as resolved.
Show resolved Hide resolved

# Object derived from WatchdogBase for interacting with hardware watchdog
_watchdog = None

Expand Down Expand Up @@ -95,16 +98,39 @@ def get_reboot_cause(self):
"""
raise NotImplementedError

def get_component_versions(self):
def get_component_list(self):
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
Retrieves chassis components list such as BIOS, CPLD, FPGA, etc.
jleveque marked this conversation as resolved.
Show resolved Hide resolved

Returns:
A list containing component name.
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
return self._component_list

def get_firmware_version(self, component):
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
Retrieves platform-specific hardware/firmware versions for chassis
componenets such as BIOS, CPLD, FPGA, etc.
Args:
component: A string, the component name.

Returns:
A string containing platform-specific component versions
"""
raise NotImplementedError

def install_component_firmware(self, component, image_path):
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
Install firmware to module
jleveque marked this conversation as resolved.
Show resolved Hide resolved
Args:
component: A string, the component name.
image_path: A string, path to firmware image.

Returns:
A boolean, True if install successfully, False if not
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
raise NotImplementedError

##############################################
# Module methods
##############################################
Expand Down
36 changes: 36 additions & 0 deletions sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ModuleBase(device_base.DeviceBase):
# available on the module
_sfp_list = []

# List of component names that available on the chassis
_component_list = []

def get_base_mac(self):
"""
Retrieves the base MAC address for the module
Expand Down Expand Up @@ -66,6 +69,39 @@ def get_system_eeprom_info(self):
"""
raise NotImplementedError

def get_component_list(self):
"""
Retrieves chassis components list such as BIOS, CPLD, FPGA, etc.
jleveque marked this conversation as resolved.
Show resolved Hide resolved

Returns:
A list containing component name.
"""
return self._component_list

def get_firmware_version(self, component):
"""
Retrieves platform-specific hardware/firmware versions for chassis
componenets such as BIOS, CPLD, FPGA, etc.
Args:
component: A string, the component name.

Returns:
A string containing platform-specific component versions
"""
raise NotImplementedError

def install_component_firmware(self, component, image_path):
"""
Install firmware to module
jleveque marked this conversation as resolved.
Show resolved Hide resolved
Args:
component: A string, the component name.
image_path: A string, path to firmware image.

Returns:
A boolean, True if install successfully, False if not
jleveque marked this conversation as resolved.
Show resolved Hide resolved
"""
raise NotImplementedError

##############################################
# Fan module methods
##############################################
Expand Down