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

[action] [PR:13356] [Celestica Seastone] fix multi sonic platform issues #13485

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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"
}
}
}