Skip to content

Commit

Permalink
[Celestica Seastone] fix multi sonic platform issues (#13356)
Browse files Browse the repository at this point in the history
Why I did it
Fix the following issues for Seastone platform:

- system-health issue: show system-health detail will not complete #9530, Celestica Seastone DX010-C32: show system-health detail fails with 'Chassis' object has no attribute 'initizalize_system_led' #11322
- show platform firmware updates issue: Celestica Seastone DX010-C32: show platform firmware updates #11317
- other platform optimization

How I did it
Modify and optimize the platform implememtation.

How to verify it
Manual run the test commands described in these issues.
  • Loading branch information
qnos authored and qiluo-msft committed Jan 19, 2023
1 parent 2357eee commit 607cbde
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"chassis": {
"Celestica-DX010-C32": {
"Seastone-DX010": {
"component": {
"CPLD1": {},
"CPLD2": {},
"CPLD3": {},
"CPLD4": {},
"CPLD5": {},
"BIOS": {}
}
}
}
}
}
16 changes: 14 additions & 2 deletions device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
NUM_PSU = 2
NUM_THERMAL = 5
NUM_SFP = 32
NUM_COMPONENT = 5
NUM_COMPONENT = 6
RESET_REGISTER = "0x103"
HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/"
REBOOT_CAUSE_FILE = "reboot-cause.txt"
Expand All @@ -44,6 +44,7 @@ def __init__(self):
self.__initialize_psu()
self.__initialize_thermals()
self.__initialize_components()
self.__initialize_system_led()

def __initialize_sfp(self):
sfputil_helper = SfpUtilHelper()
Expand Down Expand Up @@ -86,6 +87,9 @@ def __initialize_components(self):
component = Component(index)
self._component_list.append(component)

def __initialize_system_led(self):
self.set_status_led(self.STATUS_LED_COLOR_GREEN)

def __get_air_flow(self):
air_flow_path = '/usr/share/sonic/device/{}/fan_airflow'.format(
self._api_helper.platform) \
Expand Down Expand Up @@ -317,6 +321,14 @@ def is_replaceable(self):
"""
return False

def initizalize_system_led(self):
"""
This function is not defined in chassis base class,
system-health command would invoke chassis.initizalize_system_led(),
add this stub function just to let the command sucessfully execute
"""
pass

def set_status_led(self, color):
"""
Sets the state of the PSU status LED
Expand Down Expand Up @@ -345,7 +357,7 @@ def get_status_led(self):
"""
status = self._api_helper.read_txt_file(STATUS_LED_PATH)
status_str = {
'255': self.STATUS_LED_COLOR_GREEN,
'1': self.STATUS_LED_COLOR_GREEN,
'0': self.STATUS_LED_COLOR_OFF
}.get(status, None)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@
}
GETREG_PATH = "/sys/devices/platform/dx010_cpld/getreg"
BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version"
COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "BIOS"]
COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "CPLD5", "BIOS"]
COMPONENT_DES_LIST = ["Used for managing the CPU",
"Used for managing QSFP+ ports (1-10)", "Used for managing QSFP+ ports (11-20)", "Used for managing QSFP+ ports (22-32)", "Basic Input/Output System"]
"Used for managing QSFP+ ports (1-10)", "Used for managing QSFP+ ports (11-21)",
"Used for misc status and control", "Used for managing QSFP+ ports (22-32)",
"Basic Input/Output System"]


class Component(ComponentBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def set_status_led(self, color):
"""

set_status_str = {
self.STATUS_LED_COLOR_GREEN: '1',
self.STATUS_LED_COLOR_GREEN: '255',
self.STATUS_LED_COLOR_OFF: '0'
}.get(color, None)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"services_to_ignore": [],
"devices_to_ignore": [
"asic",
"psu.temperature",
"PSU2 Fan",
"PSU1 Fan"
"PSU-1 FAN-1",
"PSU-2 FAN-1"
],
"user_defined_checkers": [],
"polling_interval": 60,
Expand All @@ -13,4 +11,4 @@
"normal": "green",
"booting": "orange_blink"
}
}
}

0 comments on commit 607cbde

Please sign in to comment.