diff --git a/sonic_platform_base/chassis_base.py b/sonic_platform_base/chassis_base.py index a51c47733..e47381a00 100644 --- a/sonic_platform_base/chassis_base.py +++ b/sonic_platform_base/chassis_base.py @@ -46,6 +46,9 @@ class ChassisBase(device_base.DeviceBase): # available on the chassis _sfp_list = [] + # List of component names that are available on the chassis + _component_name_list = [] + # Object derived from WatchdogBase for interacting with hardware watchdog _watchdog = None @@ -95,16 +98,39 @@ def get_reboot_cause(self): """ raise NotImplementedError - def get_component_versions(self): + def get_component_name_list(self): + """ + Retrieves a list of the names of components available on the chassis (e.g., BIOS, CPLD, FPGA, etc.) + + Returns: + A list containing the names of components available on the chassis + """ + return self._component_name_list + + def get_firmware_version(self, component_name): """ Retrieves platform-specific hardware/firmware versions for chassis componenets such as BIOS, CPLD, FPGA, etc. + Args: + component_name: A string, the component name. Returns: A string containing platform-specific component versions """ raise NotImplementedError + def install_component_firmware(self, component_name, image_path): + """ + Install firmware to component + Args: + component_name: A string, the component name. + image_path: A string, path to firmware image. + + Returns: + A boolean, True if install was successful, False if not + """ + raise NotImplementedError + ############################################## # Module methods ############################################## diff --git a/sonic_platform_base/module_base.py b/sonic_platform_base/module_base.py index 4517295d4..583f3cc35 100644 --- a/sonic_platform_base/module_base.py +++ b/sonic_platform_base/module_base.py @@ -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_name_list = [] + def get_base_mac(self): """ Retrieves the base MAC address for the module @@ -66,6 +69,39 @@ def get_system_eeprom_info(self): """ raise NotImplementedError + def get_component_name_list(self): + """ + Retrieves a list of the names of components available on the module (e.g., BIOS, CPLD, FPGA, etc.) + + Returns: + A list containing the names of components available on the module. + """ + return self._component_name_list + + def get_firmware_version(self, component_name): + """ + Retrieves platform-specific hardware/firmware versions for chassis + componenets such as BIOS, CPLD, FPGA, etc. + Args: + component_name: A string, the component name. + + Returns: + A string containing platform-specific component versions + """ + raise NotImplementedError + + def install_component_firmware(self, component_name, image_path): + """ + Install firmware to component + Args: + component_name: A string, the component name. + image_path: A string, path to firmware image. + + Returns: + A boolean, True if install was successful, False if not + """ + raise NotImplementedError + ############################################## # Fan module methods ##############################################