Skip to content

Commit eba30ff

Browse files
authored
[Celestica Seastone] fix multi sonic platform issues (#13356)
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.
1 parent e1f0d76 commit eba30ff

File tree

5 files changed

+25
-12
lines changed

5 files changed

+25
-12
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"chassis": {
3-
"Celestica-DX010-C32": {
3+
"Seastone-DX010": {
44
"component": {
55
"CPLD1": {},
66
"CPLD2": {},
77
"CPLD3": {},
88
"CPLD4": {},
9+
"CPLD5": {},
910
"BIOS": {}
1011
}
1112
}
1213
}
13-
}
14+
}

device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
NUM_PSU = 2
2121
NUM_THERMAL = 5
2222
NUM_SFP = 32
23-
NUM_COMPONENT = 5
23+
NUM_COMPONENT = 6
2424
RESET_REGISTER = "0x103"
2525
HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/"
2626
REBOOT_CAUSE_FILE = "reboot-cause.txt"
@@ -43,6 +43,7 @@ def __init__(self):
4343
self.__initialize_psu()
4444
self.__initialize_thermals()
4545
self.__initialize_components()
46+
self.__initialize_system_led()
4647

4748
def __initialize_sfp(self):
4849
sfputil_helper = SfpUtilHelper()
@@ -85,6 +86,9 @@ def __initialize_components(self):
8586
component = Component(index)
8687
self._component_list.append(component)
8788

89+
def __initialize_system_led(self):
90+
self.set_status_led(self.STATUS_LED_COLOR_GREEN)
91+
8892
def __get_air_flow(self):
8993
air_flow_path = '/usr/share/sonic/device/{}/fan_airflow'.format(
9094
self._api_helper.platform) \
@@ -316,6 +320,14 @@ def is_replaceable(self):
316320
"""
317321
return False
318322

323+
def initizalize_system_led(self):
324+
"""
325+
This function is not defined in chassis base class,
326+
system-health command would invoke chassis.initizalize_system_led(),
327+
add this stub function just to let the command sucessfully execute
328+
"""
329+
pass
330+
319331
def set_status_led(self, color):
320332
"""
321333
Sets the state of the PSU status LED
@@ -344,7 +356,7 @@ def get_status_led(self):
344356
"""
345357
status = self._api_helper.read_txt_file(STATUS_LED_PATH)
346358
status_str = {
347-
'255': self.STATUS_LED_COLOR_GREEN,
359+
'1': self.STATUS_LED_COLOR_GREEN,
348360
'0': self.STATUS_LED_COLOR_OFF
349361
}.get(status, None)
350362

device/celestica/x86_64-cel_seastone-r0/sonic_platform/component.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424
}
2525
GETREG_PATH = "/sys/devices/platform/dx010_cpld/getreg"
2626
BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version"
27-
COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "BIOS"]
27+
COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "CPLD5", "BIOS"]
2828
COMPONENT_DES_LIST = ["Used for managing the CPU",
29-
"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"]
29+
"Used for managing QSFP+ ports (1-10)", "Used for managing QSFP+ ports (11-21)",
30+
"Used for misc status and control", "Used for managing QSFP+ ports (22-32)",
31+
"Basic Input/Output System"]
3032

3133

3234
class Component(ComponentBase):

device/celestica/x86_64-cel_seastone-r0/sonic_platform/psu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def set_status_led(self, color):
197197
"""
198198

199199
set_status_str = {
200-
self.STATUS_LED_COLOR_GREEN: '1',
200+
self.STATUS_LED_COLOR_GREEN: '255',
201201
self.STATUS_LED_COLOR_OFF: '0'
202202
}.get(color, None)
203203

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"services_to_ignore": [],
33
"devices_to_ignore": [
4-
"asic",
5-
"psu.temperature",
6-
"PSU2 Fan",
7-
"PSU1 Fan"
4+
"PSU-1 FAN-1",
5+
"PSU-2 FAN-1"
86
],
97
"user_defined_checkers": [],
108
"polling_interval": 60,
@@ -13,4 +11,4 @@
1311
"normal": "green",
1412
"booting": "orange_blink"
1513
}
16-
}
14+
}

0 commit comments

Comments
 (0)