Skip to content

Commit

Permalink
[mellanox]: Upgraded hw-management V.2.0.0160. (#2643)
Browse files Browse the repository at this point in the history
Signed-off-by: Nazarii Hnydyn <[email protected]>
  • Loading branch information
nazariig authored and lguohan committed Mar 7, 2019
1 parent 419c69b commit b22fe37
Show file tree
Hide file tree
Showing 26 changed files with 360 additions and 55 deletions.
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_lssn2700-r0/platform_wait
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn2010-r0/platform_wait
12 changes: 4 additions & 8 deletions device/mellanox/x86_64-mlnx_msn2010-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
73 changes: 73 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2010-r0/sensors.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn2100-r0/platform_wait
11 changes: 3 additions & 8 deletions device/mellanox/x86_64-mlnx_msn2100-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn2410-r0/platform_wait
11 changes: 3 additions & 8 deletions device/mellanox/x86_64-mlnx_msn2410-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
40 changes: 40 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2700-r0/platform_wait
Original file line number Diff line number Diff line change
@@ -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}"
2 changes: 1 addition & 1 deletion device/mellanox/x86_64-mlnx_msn2700-r0/plugins/eeprom.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
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):
Expand Down
11 changes: 3 additions & 8 deletions device/mellanox/x86_64-mlnx_msn2700-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
74 changes: 74 additions & 0 deletions device/mellanox/x86_64-mlnx_msn2700-r0/sensors.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn2740-r0/platform_wait
12 changes: 4 additions & 8 deletions device/mellanox/x86_64-mlnx_msn2740-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn3700-r0/platform_wait
29 changes: 28 additions & 1 deletion device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
################################################################################
# Copyright (c) 2019 Mellanox Technologies
#
# Platform specific sensors config for MSN3700
# Platform specific sensors config for SN3700
################################################################################

# Temperature sensors
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions device/mellanox/x86_64-mlnx_msn3700c-r0/platform_wait
Loading

0 comments on commit b22fe37

Please sign in to comment.