diff --git a/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait b/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2010-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py index 914ef050d2..a51a9b0729 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py @@ -20,14 +20,10 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "pwr{}" - self.psu_oper_status = "pwr{}" + + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_pwr_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf index 170b0371fb..3b68f775df 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf @@ -17,3 +17,76 @@ chip "tps53679-*" label pout2 "TPS pout2" label iout1 "TPS iout1" label iout2 "TPS iout2" + +chip "mlxsw-*" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + +chip "*-virtual-*" + ignore temp1 + ignore temp2 + +chip "dps460-*" + ignore fan2 + ignore fan3 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py index b9bb580d7c..b14b1d9dac 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "pwr{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py index 954045dde5..f3cce52b12 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait new file mode 100755 index 0000000000..44321184dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait @@ -0,0 +1,40 @@ +#!/bin/bash + +declare -r EXIT_SUCCESS="0" +declare -r EXIT_TIMEOUT="1" + +declare -r QSFP_PATH="/var/run/hw-management/qsfp" + +function WaitForQsfpReady() { + local -r _QSFP_PATH="${1}" + + local -i _WDOG_CNT="1" + local -ir _WDOG_MAX="300" + + local -r _TIMEOUT="1s" + + while [[ "${_WDOG_CNT}" -le "${_WDOG_MAX}" ]]; do + for _QSFP in ${_QSFP_PATH}/qsfp*; do + if [[ -e "${_QSFP}" ]]; then + return "${EXIT_SUCCESS}" + fi + done + + let "_WDOG_CNT++" + sleep "${_TIMEOUT}" + done + + return "${EXIT_TIMEOUT}" +} + +echo "Wait for QSFP I2C interface is ready" + +WaitForQsfpReady "${QSFP_PATH}" +EXIT_CODE="$?" +if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then + echo "QSFP I2C interface is not ready: timeout" + exit "${EXIT_CODE}" +fi + +echo "QSFP I2C interface is ready: mlxsw_minimal has finished initialization" +exit "${EXIT_SUCCESS}" diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py index 3d7e8d0556..63303c13a2 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py @@ -26,7 +26,7 @@ except ImportError, e: raise ImportError (str(e) + "- required module not found") SYSLOG_IDENTIFIER = "eeprom.py" -EEPROM_SYMLINK = "/bsp/eeprom/vpd_info" +EEPROM_SYMLINK = "/var/run/hw-management/eeprom/vpd_info" CACHE_FILE = "/var/cache/sonic/decode-syseeprom/syseeprom_cache" def log_error(msg): diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py index 954045dde5..f3cce52b12 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py @@ -21,14 +21,9 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index 531e06f132..2a69cb63a7 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -41,7 +41,7 @@ class SfpUtil(SfpUtilBase): db_sel_tbl = None state_db = None sfpd_status_tbl = None - qsfp_sysfs_path = "/sys/devices/platform/i2c_mlxcpld.1/i2c-1/i2c-2/2-0048/" + qsfp_sysfs_path = "/var/run/hw-management/qsfp/" @property def port_start(self): diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf index a3e3039186..247db54f99 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf @@ -19,3 +19,77 @@ chip "ucd9200-i2c-5-41" bus "i2c-17" "i2c-1-mux (chan_id 7)" chip "lm75-i2c-17-49" label temp1 "Ambient Board Temp" + +chip "mlxsw-*" + ignore temp2 + ignore temp3 + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 + ignore temp10 + ignore temp11 + ignore temp12 + ignore temp13 + ignore temp14 + ignore temp15 + ignore temp16 + ignore temp17 + ignore temp18 + ignore temp19 + ignore temp20 + ignore temp21 + ignore temp22 + ignore temp23 + ignore temp24 + ignore temp25 + ignore temp26 + ignore temp27 + ignore temp28 + ignore temp29 + ignore temp30 + ignore temp31 + ignore temp32 + ignore temp33 + ignore temp34 + ignore temp35 + ignore temp36 + ignore temp37 + ignore temp38 + ignore temp39 + ignore temp40 + ignore temp41 + ignore temp42 + ignore temp43 + ignore temp44 + ignore temp45 + ignore temp46 + ignore temp47 + ignore temp48 + ignore temp49 + ignore temp50 + ignore temp51 + ignore temp52 + ignore temp53 + ignore temp54 + ignore temp55 + ignore temp56 + ignore temp57 + ignore temp58 + ignore temp59 + ignore temp60 + ignore temp61 + ignore temp62 + ignore temp63 + ignore temp64 + +chip "*-virtual-*" + ignore temp1 + ignore temp2 + +chip "dps460-*" + ignore fan2 + ignore fan3 + diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py index 8c47a00832..f3cce52b12 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py @@ -20,14 +20,10 @@ class PsuUtil(PsuBase): def __init__(self): PsuBase.__init__(self) - self.psu_path = "" - for index in range(0, 100): - hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index) - if os.path.exists(hwmon_path): - self.psu_path = hwmon_path - break - self.psu_presence = "psu{}" - self.psu_oper_status = "pwr{}" + + self.psu_path = "/var/run/hw-management/thermal/" + self.psu_presence = "psu{}_status" + self.psu_oper_status = "psu{}_pwr_status" def get_num_psus(self): """ diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf index 592964d75c..376d079390 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -1,7 +1,7 @@ ################################################################################ # Copyright (c) 2019 Mellanox Technologies # -# Platform specific sensors config for MSN3700 +# Platform specific sensors config for SN3700 ################################################################################ # Temperature sensors @@ -15,6 +15,10 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-4a" label temp1 "Ambient Port Side Temp (air exhaust)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + # Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" @@ -30,6 +34,7 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-71" label in1 "PMIC-2 PSU 12V Rail (in)" label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (1.5)*@, @/(1.5) label in3 "PMIC-2 ASIC 1.8V Rail (out)" label temp1 "PMIC-2 Temp 1" label temp2 "PMIC-2 Temp 2" @@ -38,6 +43,28 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in3 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait new file mode 120000 index 0000000000..4b30bd4298 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf index 1570ac30b6..7efcefc5f7 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -1,7 +1,7 @@ ################################################################################ # Copyright (c) 2019 Mellanox Technologies # -# Platform specific sensors config for MSN3700C +# Platform specific sensors config for SN3700C ################################################################################ # Temperature sensors @@ -15,6 +15,10 @@ bus "i2c-7" "i2c-1-mux (chan_id 6)" chip "tmp102-i2c-*-4a" label temp1 "Ambient Port Side Temp (air exhaust)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + # Power controllers bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-70" @@ -30,6 +34,7 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" chip "tps53679-i2c-*-71" label in1 "PMIC-2 PSU 12V Rail (in)" label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (1.5)*@, @/(1.5) label in3 "PMIC-2 ASIC 1.8V Rail (out)" label temp1 "PMIC-2 Temp 1" label temp2 "PMIC-2 Temp 2" @@ -38,6 +43,28 @@ bus "i2c-5" "i2c-1-mux (chan_id 4)" label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in3 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" @@ -79,10 +106,6 @@ chip "mlxreg_fan-isa-*" label fan6 "Chassis Fan Drawer-3 Tach 2" label fan7 "Chassis Fan Drawer-4 Tach 1" label fan8 "Chassis Fan Drawer-4 Tach 2" - ignore fan9 - ignore fan10 - ignore fan11 - ignore fan12 # Miscellaneous chip "*-virtual-*" diff --git a/dockers/docker-platform-monitor/start.sh b/dockers/docker-platform-monitor/start.sh index 18541b80fe..4744110c66 100755 --- a/dockers/docker-platform-monitor/start.sh +++ b/dockers/docker-platform-monitor/start.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +declare -r EXIT_SUCCESS="0" + mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status @@ -7,6 +9,16 @@ rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd +# If this platform has synchronization script, run it +if [ -e /usr/share/sonic/platform/platform_wait ]; then + /usr/share/sonic/platform/platform_wait + EXIT_CODE="$?" + if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then + supervisorctl shutdown + exit "${EXIT_CODE}" + fi +fi + # If this platform has an lm-sensors config file, copy it to it's proper place # and start lm-sensors if [ -e /usr/share/sonic/platform/sensors.conf ]; then diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index a3cbf5adba..76f55e2234 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -126,12 +126,17 @@ start() { {%- if '--log-driver=json-file' in docker_image_run_opt or '--log-driver' not in docker_image_run_opt %} --log-opt max-size=2M --log-opt max-file=5 \ {%- endif %} -{%- if docker_container_name == "syncd" and sonic_asic_platform == "mellanox" %} +{%- if sonic_asic_platform == "mellanox" %} +{%- if docker_container_name == "syncd" %} -e SX_SNIFFER_ENABLE \ -e SX_SNIFFER_TARGET \ -e PRM_SNIFFER \ -e PRM_SNIFFER_FILE_PATH \ -v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ +{%- endif %} +{%- if docker_container_name == "pmon" %} + -v /var/run/hw-management:/var/run/hw-management:rw \ +{%- endif %} {%- endif %} -v /var/run/redis:/var/run/redis:rw \ -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ diff --git a/files/build_templates/updategraph.service.j2 b/files/build_templates/updategraph.service.j2 index e01fd0146f..8039f42531 100644 --- a/files/build_templates/updategraph.service.j2 +++ b/files/build_templates/updategraph.service.j2 @@ -4,7 +4,7 @@ After=rc-local.service After=database.service Requires=database.service {% if sonic_asic_platform == 'mellanox' -%} -Requires=msn-chassis.service +Requires=hw-management.service {% endif -%} diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 7e5ce780e0..0d43f7840f 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -94,15 +94,28 @@ start() { # start mellanox drivers regardless of # boot type - if [ x"$sonic_asic_platform" == x"mellanox" ]; then + if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then BOOT_TYPE=`getBootType` if [[ x"$WARM_BOOT" == x"true" || x"$BOOT_TYPE" == x"fast" ]]; then export FAST_BOOT=1 fi + + if [[ x"$WARM_BOOT" != x"true" ]]; then + /bin/systemctl stop pmon + /usr/bin/hw-management.sh chipdown + fi + + if [[ x"$BOOT_TYPE" == x"fast" ]]; then + /usr/bin/hw-management.sh chipupdis + fi + /usr/bin/mst start /usr/bin/mlnx-fw-upgrade.sh /etc/init.d/sxdkernel start - /sbin/modprobe i2c-dev + + if [[ x"$WARM_BOOT" != x"true" ]]; then + /bin/systemctl start pmon + fi fi if [[ x"$WARM_BOOT" != x"true" ]]; then @@ -111,11 +124,14 @@ start() { fi fi - # start service docker /usr/bin/${SERVICE}.sh start debug "Started ${SERVICE} service..." + if [[ x"$sonic_asic_platform" == x"mellanox" && x"$BOOT_TYPE" == x"fast" ]]; then + /usr/bin/hw-management.sh chipupen + fi + unlock_service_state_change } diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 10e6bcd766..4f6df40175 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,6 +1,6 @@ # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 27.09.2018 +MLNX_HW_MANAGEMENT_VERSION = 18.01.2019 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch b/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch new file mode 100644 index 0000000000..c8db798896 --- /dev/null +++ b/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch @@ -0,0 +1,51 @@ +From 45587a19ab4b69e5d1ed84d9910a6b89d0fc5520 Mon Sep 17 00:00:00 2001 +From: Kevin Wang +Date: Thu, 10 Jan 2019 07:22:31 +0200 +Subject: [PATCH] Suspend thermal control by default + +Suspend thermal control and set the default fan speed to 60% + +Signed-off-by: Kevin Wang +--- + usr/usr/bin/hw-management-thermal-control.sh | 5 +++-- + usr/usr/bin/hw-management.sh | 1 + + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/usr/usr/bin/hw-management-thermal-control.sh b/usr/usr/bin/hw-management-thermal-control.sh +index c7274a6..4c5438f 100755 +--- a/usr/usr/bin/hw-management-thermal-control.sh ++++ b/usr/usr/bin/hw-management-thermal-control.sh +@@ -116,6 +116,7 @@ max_ports=${5:-$max_ports_def} + # Local constants + pwm_noact=0 + pwm_max=1 ++pwm_def_rpm=153 + pwm_max_rpm=255 + max_amb=120000 + untrusted_sensor=0 +@@ -893,8 +894,8 @@ disable_zones_max_pwm() { + fi + fi + done +- echo $pwm_max_rpm > $pwm +- log_action_msg "Set fan speed to maximum" ++ echo $pwm_def_rpm > $pwm ++ log_action_msg "Set fan speed to 60% percent" + } + + trip_points_num=4 +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index 9214a9f..c8261a3 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -565,6 +565,7 @@ do_start() + echo $asic_bus > $config_path/asic_bus + connect_platform + ++ echo 1 > $config_path/suspend + $THERMAL_CONTROL $thermal_type $max_tachos $max_psus& + } + +-- +1.9.1 + diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index 498002ba52..ea86fcb7df 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit 498002ba528e5633bf1e9b8e488979ed731ca0f6 +Subproject commit ea86fcb7dfab5373cd982a500ac7d0b7db51d318