diff --git a/device/celestica/x86_64-cel_belgite-r0/installer.conf b/device/celestica/x86_64-cel_belgite-r0/installer.conf index 6ba1f09f192f..61846e4455e0 100644 --- a/device/celestica/x86_64-cel_belgite-r0/installer.conf +++ b/device/celestica/x86_64-cel_belgite-r0/installer.conf @@ -1,4 +1,4 @@ CONSOLE_PORT=0x3f8 CONSOLE_DEV=0 CONSOLE_SPEED=9600 -ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off module_blacklist=gpio_ich,i2c-ismt,i2c_ismt,i2c-i801,i2c_i801 crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M acpi_no_watchdog" +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="intel_iommu=off module_blacklist=gpio_ich crashkernel=0M-2G:256M,2G-4G:320M,4G-8G:384M,8G-:448M acpi_no_watchdog" diff --git a/device/celestica/x86_64-cel_belgite-r0/platform.json b/device/celestica/x86_64-cel_belgite-r0/platform.json index 31fbe1d9d1b1..1d4a1f9e3420 100644 --- a/device/celestica/x86_64-cel_belgite-r0/platform.json +++ b/device/celestica/x86_64-cel_belgite-r0/platform.json @@ -21,7 +21,7 @@ { "name": "Fantray1_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -31,7 +31,7 @@ { "name": "Fantray2_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -41,7 +41,7 @@ { "name": "Fantray3_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -51,7 +51,7 @@ { "name": "Fantray1_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -61,7 +61,7 @@ { "name": "Fantray2_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -71,7 +71,7 @@ { "name": "Fantray3_1", "speed": { - "controllable": false + "controllable": true }, "status_led": { "controllable": true, @@ -86,8 +86,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false }, "max_consumed_power": false, "fans": [ @@ -97,8 +96,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false } } ] @@ -109,8 +107,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false }, "max_consumed_power": false, "fans": [ @@ -120,8 +117,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false } } ] @@ -132,8 +128,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false }, "max_consumed_power": false, "fans": [ @@ -143,8 +138,7 @@ "controllable": false }, "status_led": { - "controllable": true, - "colors": ["green", "amber","off"] + "controllable": false } } ] @@ -157,9 +151,7 @@ { "name": "PSU1_FAN1", "speed": { - "controllable": true, - "minimum": 25, - "maximum": 100 + "controllable": false }, "status_led": { "controllable": false @@ -172,6 +164,7 @@ "voltage_high_threshold": false, "voltage_low_threshold": false, "temperature": false, + "fans_target_speed": false, "status_led": { "controllable": false } @@ -182,9 +175,7 @@ { "name": "PSU2_FAN1", "speed": { - "controllable": true, - "minimum": 25, - "maximum": 100 + "controllable": false }, "status_led": { "controllable": false @@ -197,6 +188,7 @@ "voltage_high_threshold": false, "voltage_low_threshold": false, "temperature": false, + "fans_target_speed": false, "status_led": { "controllable": false } diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/modules/mc24lc64t.c b/platform/broadcom/sonic-platform-modules-cel/belgite/modules/mc24lc64t.c index 49e9d8b21f8f..e71e551438eb 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/modules/mc24lc64t.c +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/modules/mc24lc64t.c @@ -18,7 +18,7 @@ #include #include -#define EEPROM_SIZE 8192 //mc24lt64t eeprom size in bytes. +#define EEPROM_SIZE 256 //mc24lt64t eeprom size in bytes. struct mc24lc64t_data { struct mutex update_lock; diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/modules/pddf_custom_wdt.c b/platform/broadcom/sonic-platform-modules-cel/belgite/modules/pddf_custom_wdt.c index 190fa85471cf..a73a6f6eb143 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/modules/pddf_custom_wdt.c +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/modules/pddf_custom_wdt.c @@ -522,9 +522,9 @@ static long watchdog_ioctl(struct file *file, unsigned int cmd, new_timeout = new_timeout*1000; if (watchdog_set_timeout(p, new_timeout)) return -EINVAL; - //watchdog_keepalive(p); - /* Fall */ - return 0; + + val = watchdog_get_timeout(p); + return put_user(val, uarg.i); case WDIOC_GETTIMEOUT: val = watchdog_get_timeout(p); return put_user(val, uarg.i); diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/chassis.py index 6595f365efa8..5e2b204e3d0b 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/chassis.py @@ -13,23 +13,25 @@ from sonic_platform.watchdog import Watchdog import sys import subprocess + from sonic_py_common import device_info except ImportError as e: raise ImportError(str(e) + "- required module not found") NUM_COMPONENT = 3 FAN_DIRECTION_FILE_PATH = "/var/fan_direction" - class Chassis(PddfChassis): """ PDDF Platform-specific Chassis class """ def __init__(self, pddf_data=None, pddf_plugin_data=None): + PddfChassis.__init__(self, pddf_data, pddf_plugin_data) vendor_ext = self._eeprom.vendor_ext_str() with open(FAN_DIRECTION_FILE_PATH, "w+") as f: f.write(vendor_ext) + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() self.__initialize_components() @@ -74,9 +76,11 @@ def get_watchdog(self): An object derived from WatchdogBase representing the hardware watchdog device """ - self._watchdog = Watchdog() + if self._watchdog is None: + self._watchdog = Watchdog() return self._watchdog + def get_reboot_cause(self): """ Retrieves the cause of the previous reboot @@ -138,3 +142,21 @@ def get_base_mac(self): def get_system_eeprom_info(self): return self._eeprom.system_eeprom_info() + def get_name(self): + return self.modelstr() + + def get_model(self): + return self._eeprom.part_number_str() + + def set_status_led(self, color): + color_dict = { + 'green': "STATUS_LED_COLOR_GREEN", + 'red': "STATUS_LED_COLOR_AMBER", + 'amber': "STATUS_LED_COLOR_AMBER", + 'off': "STATUS_LED_COLOR_OFF" + } + return self.set_system_led("SYS_LED", color_dict.get(color, "off")) + + def get_status_led(self): + return self.get_system_led("SYS_LED") + diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/component.py index 4b8a3ffaffb4..e4f3e1257da8 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/component.py @@ -115,5 +115,28 @@ def install_firmware(self, image_path): return False def update_firmware(self, image_path): + return False + + def get_available_firmware_version(self, image_path): + return 'N/A' + + def get_firmware_update_notification(self, image_path): + return "None" + + def get_model(self): + return 'N/A' + + def get_position_in_parent(self): + return -1 + + def get_presence(self): + return True + + def get_serial(self): + return 'N/A' + + def get_status(self): + return True + def is_replaceable(self): return False diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/fan_drawer.py index 7a9e3ecabbc8..ac80aad4b1eb 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/fan_drawer.py @@ -23,3 +23,11 @@ def set_status_led(self, color): def get_status_led(self, color=None): return self._fan_list[0].get_status_led() + + def get_serial(self): + serial = "Unknown" + return serial + + def get_model(self): + model = "Unknown" + return model diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/psu.py index 0e2c925a0f07..9616d030012f 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/psu.py @@ -49,5 +49,7 @@ def get_position_in_parent(self): return self.psu_index def get_revision(self): - return "N/A" + + def temperature(self): + return self.get_temperature() diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/watchdog.py index 789c04addf1e..7973e8a3cfad 100644 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/pddf/sonic_platform/watchdog.py @@ -154,16 +154,16 @@ def arm(self, seconds): try: if self.timeout != seconds: self.timeout = self._settimeout(seconds) + if self.armed: self._keepalive() else: - self._settimeout(seconds) self._enable() self.armed = True + ret = self.timeout except IOError as e: pass - return ret def disarm(self): diff --git a/platform/broadcom/sonic-platform-modules-cel/belgite/scripts/pddf_pre_driver_install.sh b/platform/broadcom/sonic-platform-modules-cel/belgite/scripts/pddf_pre_driver_install.sh index a25c39df41a1..2b37a5d5f6ff 100755 --- a/platform/broadcom/sonic-platform-modules-cel/belgite/scripts/pddf_pre_driver_install.sh +++ b/platform/broadcom/sonic-platform-modules-cel/belgite/scripts/pddf_pre_driver_install.sh @@ -1,3 +1,5 @@ #!/bin/bash modprobe -r i2c_ismt -modprobe -r i2c-i801 +sleep 0.1 +modprobe -r i2c-i801 +sleep 0.1