Skip to content

Commit b22fe37

Browse files
nazariiglguohan
authored andcommitted
[mellanox]: Upgraded hw-management V.2.0.0160. (#2643)
Signed-off-by: Nazarii Hnydyn <[email protected]>
1 parent 419c69b commit b22fe37

26 files changed

Lines changed: 360 additions & 55 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../x86_64-mlnx_msn2700-r0/platform_wait
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../x86_64-mlnx_msn2700-r0/platform_wait

device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ class PsuUtil(PsuBase):
2020

2121
def __init__(self):
2222
PsuBase.__init__(self)
23-
self.psu_path = ""
24-
for index in range(0, 100):
25-
hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index)
26-
if os.path.exists(hwmon_path):
27-
self.psu_path = hwmon_path
28-
break
29-
self.psu_presence = "pwr{}"
30-
self.psu_oper_status = "pwr{}"
23+
24+
self.psu_path = "/var/run/hw-management/thermal/"
25+
self.psu_presence = "psu{}_pwr_status"
26+
self.psu_oper_status = "psu{}_pwr_status"
3127

3228
def get_num_psus(self):
3329
"""

device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,76 @@ chip "tps53679-*"
1717
label pout2 "TPS pout2"
1818
label iout1 "TPS iout1"
1919
label iout2 "TPS iout2"
20+
21+
chip "mlxsw-*"
22+
ignore temp2
23+
ignore temp3
24+
ignore temp4
25+
ignore temp5
26+
ignore temp6
27+
ignore temp7
28+
ignore temp8
29+
ignore temp9
30+
ignore temp10
31+
ignore temp11
32+
ignore temp12
33+
ignore temp13
34+
ignore temp14
35+
ignore temp15
36+
ignore temp16
37+
ignore temp17
38+
ignore temp18
39+
ignore temp19
40+
ignore temp20
41+
ignore temp21
42+
ignore temp22
43+
ignore temp23
44+
ignore temp24
45+
ignore temp25
46+
ignore temp26
47+
ignore temp27
48+
ignore temp28
49+
ignore temp29
50+
ignore temp30
51+
ignore temp31
52+
ignore temp32
53+
ignore temp33
54+
ignore temp34
55+
ignore temp35
56+
ignore temp36
57+
ignore temp37
58+
ignore temp38
59+
ignore temp39
60+
ignore temp40
61+
ignore temp41
62+
ignore temp42
63+
ignore temp43
64+
ignore temp44
65+
ignore temp45
66+
ignore temp46
67+
ignore temp47
68+
ignore temp48
69+
ignore temp49
70+
ignore temp50
71+
ignore temp51
72+
ignore temp52
73+
ignore temp53
74+
ignore temp54
75+
ignore temp55
76+
ignore temp56
77+
ignore temp57
78+
ignore temp58
79+
ignore temp59
80+
ignore temp60
81+
ignore temp61
82+
ignore temp62
83+
ignore temp63
84+
ignore temp64
85+
86+
chip "*-virtual-*"
87+
ignore temp1
88+
ignore temp2
89+
90+
chip "dps460-*"
91+
ignore fan2
92+
ignore fan3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../x86_64-mlnx_msn2700-r0/platform_wait

device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ class PsuUtil(PsuBase):
2121
def __init__(self):
2222
PsuBase.__init__(self)
2323

24-
self.psu_path = ""
25-
for index in range(0, 100):
26-
hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index)
27-
if os.path.exists(hwmon_path):
28-
self.psu_path = hwmon_path
29-
break
30-
self.psu_presence = "pwr{}"
31-
self.psu_oper_status = "pwr{}"
24+
self.psu_path = "/var/run/hw-management/thermal/"
25+
self.psu_presence = "psu{}_status"
26+
self.psu_oper_status = "psu{}_pwr_status"
3227

3328
def get_num_psus(self):
3429
"""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../x86_64-mlnx_msn2700-r0/platform_wait

device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ class PsuUtil(PsuBase):
2121
def __init__(self):
2222
PsuBase.__init__(self)
2323

24-
self.psu_path = ""
25-
for index in range(0, 100):
26-
hwmon_path = "/sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon/hwmon{}/".format(index)
27-
if os.path.exists(hwmon_path):
28-
self.psu_path = hwmon_path
29-
break
30-
self.psu_presence = "psu{}"
31-
self.psu_oper_status = "pwr{}"
24+
self.psu_path = "/var/run/hw-management/thermal/"
25+
self.psu_presence = "psu{}_status"
26+
self.psu_oper_status = "psu{}_pwr_status"
3227

3328
def get_num_psus(self):
3429
"""
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
declare -r EXIT_SUCCESS="0"
4+
declare -r EXIT_TIMEOUT="1"
5+
6+
declare -r QSFP_PATH="/var/run/hw-management/qsfp"
7+
8+
function WaitForQsfpReady() {
9+
local -r _QSFP_PATH="${1}"
10+
11+
local -i _WDOG_CNT="1"
12+
local -ir _WDOG_MAX="300"
13+
14+
local -r _TIMEOUT="1s"
15+
16+
while [[ "${_WDOG_CNT}" -le "${_WDOG_MAX}" ]]; do
17+
for _QSFP in ${_QSFP_PATH}/qsfp*; do
18+
if [[ -e "${_QSFP}" ]]; then
19+
return "${EXIT_SUCCESS}"
20+
fi
21+
done
22+
23+
let "_WDOG_CNT++"
24+
sleep "${_TIMEOUT}"
25+
done
26+
27+
return "${EXIT_TIMEOUT}"
28+
}
29+
30+
echo "Wait for QSFP I2C interface is ready"
31+
32+
WaitForQsfpReady "${QSFP_PATH}"
33+
EXIT_CODE="$?"
34+
if [[ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]]; then
35+
echo "QSFP I2C interface is not ready: timeout"
36+
exit "${EXIT_CODE}"
37+
fi
38+
39+
echo "QSFP I2C interface is ready: mlxsw_minimal has finished initialization"
40+
exit "${EXIT_SUCCESS}"

device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
raise ImportError (str(e) + "- required module not found")
2727

2828
SYSLOG_IDENTIFIER = "eeprom.py"
29-
EEPROM_SYMLINK = "/bsp/eeprom/vpd_info"
29+
EEPROM_SYMLINK = "/var/run/hw-management/eeprom/vpd_info"
3030
CACHE_FILE = "/var/cache/sonic/decode-syseeprom/syseeprom_cache"
3131

3232
def log_error(msg):

0 commit comments

Comments
 (0)