Skip to content

Commit

Permalink
Initialize component BIOS/CPLD
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs authored and keboliu committed Jun 6, 2022
1 parent f454691 commit 6db2401
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
7 changes: 2 additions & 5 deletions platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,11 +530,8 @@ def initialize_components(self):
from .component import ComponentONIE, ComponentSSD, ComponentBIOS, ComponentCPLD
self._component_list.append(ComponentONIE())
self._component_list.append(ComponentSSD())
biosComponent = DeviceDataManager.get_bios_component()
if not biosComponent:
biosComponent = ComponentBIOS()
self._component_list.append(biosComponent)
self._component_list.extend(ComponentCPLD.get_component_list())
self._component_list.append(DeviceDataManager.get_bios_component())
self._component_list.extend(DeviceDataManager.get_cpld_component_list())

def get_num_components(self):
"""
Expand Down
13 changes: 11 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,18 @@ def get_cpu_thermal_threshold(cls):

@classmethod
def get_bios_component(cls):
from .component import ComponentBIOS, ComponentBIOSSN2201
if cls.get_platform_name() in ['x86_64-nvidia_sn2201-r0']:
from .component import ComponentBIOSSN2201
# For SN2201, special chass is required for handle BIOS
# Currently, only fetching BIOS version is supported
return ComponentBIOSSN2201()
return None
return ComponentBIOS()

@classmethod
def get_cpld_component_list(cls):
from .component import ComponentCPLD, ComponentCPLDSN2201
if cls.get_platform_name() in ['x86_64-nvidia_sn2201-r0']:
# For SN2201, special chass is required for handle BIOS
# Currently, only fetching BIOS version is supported
return ComponentCPLDSN2201.get_component_list()
return ComponentCPLD.get_component_list()

0 comments on commit 6db2401

Please sign in to comment.