[mellanox]: Upgraded hw-management V.2.0.0160. (#2643)

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
This commit is contained in:
Nazarii Hnydyn 2019-03-07 04:51:46 +02:00 committed by lguohan
parent 419c69b289
commit b22fe37670
26 changed files with 360 additions and 55 deletions

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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):
"""

View File

@ -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

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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):
"""

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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):
"""

View File

@ -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}"

View File

@ -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):

View File

@ -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):
"""

View File

@ -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):

View File

@ -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

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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):
"""

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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"

View File

@ -0,0 +1 @@
../x86_64-mlnx_msn2700-r0/platform_wait

View File

@ -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-*"

View File

@ -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

View File

@ -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 \

View File

@ -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 -%}

View File

@ -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
}

View File

@ -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

View File

@ -0,0 +1,51 @@
From 45587a19ab4b69e5d1ed84d9910a6b89d0fc5520 Mon Sep 17 00:00:00 2001
From: Kevin Wang <kevinw@mellanox.com>
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 <kevinw@mellanox.com>
---
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

@ -1 +1 @@
Subproject commit 498002ba528e5633bf1e9b8e488979ed731ca0f6
Subproject commit ea86fcb7dfab5373cd982a500ac7d0b7db51d318