diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 4f6df401758a..f473d4da2319 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,6 +1,6 @@ # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 18.01.2019 +MLNX_HW_MANAGEMENT_VERSION = 2.0.0.0172 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch b/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch new file mode 100644 index 000000000000..31a85434fb49 --- /dev/null +++ b/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch @@ -0,0 +1,53 @@ +From 051938b7c49cc18aaddd699939353f591554d635 Mon Sep 17 00:00:00 2001 +From: Mykola Faryma +Date: Wed, 3 Apr 2019 14:09:26 +0000 +Subject: [PATCH] Make hw-mgmt SimX compatiable. + +Signed-off-by: Mykola Faryma +--- + usr/usr/bin/hw-management.sh | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index fdb3013..68da9bc 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -646,6 +646,35 @@ do_chip_down() + /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p + } + ++handle_simx() ++{ ++ local -r onie_platform="$(cat /host/machine.conf | grep onie_platform | cut -d= -f2)" ++ ++ local -r syseeprom_cache_path="/var/cache/sonic/decode-syseeprom/syseeprom_cache" ++ local -r syseeprom_hex_path="/usr/share/sonic/device/${onie_platform}/syseeprom.hex" ++ local -r syseeprom_vpd_path="/var/run/hw-management/eeprom/vpd_info" ++ ++ case $ACTION in ++ start) ++ /bin/bash -c "/bin/rm -f ${syseeprom_cache_path}" ++ /bin/bash -c "/bin/mkdir -p ${eeprom_path}" ++ /bin/bash -c "/usr/bin/xxd -r -p ${syseeprom_hex_path} ${syseeprom_vpd_path}" ++ ;; ++ stop) ++ /bin/bash -c "/bin/rm -fr ${hw_management_path}" ++ ;; ++ *) ++ echo "Usage: `basename $0` {start|stop}" ++ exit 1 ++ ;; ++ esac ++} ++ ++if [[ "$(cat /sys/devices/virtual/dmi/id/chassis_vendor)" = "QEMU" ]]; then ++ handle_simx ++ exit 0 ++fi ++ + case $ACTION in + start) + do_start +-- +1.9.1 + 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 deleted file mode 100644 index c8db79889610..000000000000 --- a/platform/mellanox/hw-management/0001-Suspend-thermal-control-by-default.patch +++ /dev/null @@ -1,51 +0,0 @@ -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/0002-make-hw-mgmt-SimX-compatiable.patch b/platform/mellanox/hw-management/0002-make-hw-mgmt-SimX-compatiable.patch deleted file mode 100644 index 327023899d76..000000000000 --- a/platform/mellanox/hw-management/0002-make-hw-mgmt-SimX-compatiable.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 2fef49112421ec875029d005069495bca77ab4a3 Mon Sep 17 00:00:00 2001 -From: Mykola Faryma -Date: Wed, 3 Apr 2019 14:09:26 +0000 -Subject: [PATCH 2/2] make hw-mgmt SimX compatiable - -Signed-off-by: Mykola Faryma ---- - usr/usr/bin/hw-management.sh | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh -index c8261a3..bb27493 100755 ---- a/usr/usr/bin/hw-management.sh -+++ b/usr/usr/bin/hw-management.sh -@@ -644,6 +644,26 @@ do_chip_down() - /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p - } - -+handle_simx() -+{ -+ ONIE_PLATFORM=$(cat /host/machine.conf | grep onie_platform | cut -d= -f2) -+ case $ACTION in -+ start) -+ /bin/bash -c "/bin/rm -f /var/cache/sonic/decode-syseeprom/syseeprom_cache" -+ /bin/bash -c "/bin/mkdir -p /var/run/hw-management/eeprom" -+ /bin/bash -c "/usr/bin/xxd -r -p /usr/share/sonic/device/${ONIE_PLATFORM}/syseeprom.hex /var/run/hw-management/eeprom/vpd_info" -+ ;; -+ stop) -+ /bin/bash -c "/bin/rm -fr /var/run/hw-management" -+ ;; -+ esac -+} -+ -+if [[ $(cat /sys/devices/virtual/dmi/id/chassis_vendor) = "QEMU" ]]; then -+ handle_simx -+ exit 0 -+fi -+ - case $ACTION in - start) - do_start --- -1.9.1 - diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index ea86fcb7dfab..425a653ea0d7 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit ea86fcb7dfab5373cd982a500ac7d0b7db51d318 +Subproject commit 425a653ea0d7b27d4502c3ebdc9bb720b6c34bee