Skip to content

Commit

Permalink
Fix 2700a1 sensors.conf and update psu_sensors.json accordingly (soni…
Browse files Browse the repository at this point in the history
…c-net#19515)

previously 2700a1 sensors.conf is missing bus section for psu,
so add it and update the psu_sensors.json with the info.

fix psu_sensors_conf_updater to treat PSR psu as same as PSF one.

Signed-off-by: Yuanzhe, Liu <[email protected]>
  • Loading branch information
yuazhe authored Aug 27, 2024
1 parent 4b39162 commit f626233
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
7 changes: 5 additions & 2 deletions device/mellanox/x86_64-mlnx_msn2700-r0/psu_sensors.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
},
"MSN2700-A1": {
"default": {
"bus": [],
"bus": [
"i2c-10",
"i2c-1-mux (chan_id 10)"
],
"chip": {
"dps460-i2c-*-58": ["2", "R"],
"dps460-i2c-*-59": ["1", "L"]
Expand Down Expand Up @@ -363,7 +366,7 @@
"MTEF-AC-G-ACBEL": {
"label": [
"in1 PSU 220V Rail (in)",
"in3 PSU 12V Rail (out)",
"in2 PSU 12V Rail (out)",
"fan1 PSU Fan 1",
"temp1 PSU Temp 1",
"temp2 PSU Temp 2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function update_psu_sensors_configuration() {
# keep looking for the rest psus
continue
else
if [ "$psu" == "MTEF-PSF-AC-G" ]; then
psu=$(echo "$psu" | sed -r 's/-PSR|-PSF//g')
if [ "$psu" == "MTEF-AC-G" ]; then
vendor=$(cat /var/run/hw-management/eeprom/psu${number}_vpd | grep "MFR_NAME:" | cut -d ' ' -f 2 2>&1)
psu="${psu}-${vendor}"
fi
psu=$(echo "$psu" | sed -r 's/-PSR|-PSF//g')

echo " chip \""$chip"\"" >> $SENSORS_CONFIG_FILE
mapfile -t opers < <(jq -r --arg psu "$psu" '.psu[$psu] | keys[]' $PSU_SENSORS_CONFIG)
Expand Down
42 changes: 21 additions & 21 deletions device/mellanox/x86_64-mlnx_msn2700a1-r0/sensors.conf
Original file line number Diff line number Diff line change
Expand Up @@ -174,27 +174,27 @@ chip "xdpe15284-i2c-*-61"
ignore curr3

# Power supplies
chip "dps460-i2c-*-58"
label in1 "PSU-2(R) 220V Rail (in)"
label in2 "PSU-2(R) 12V Rail (out)"
label fan1 "PSU-2(R) Fan 1"
label temp1 "PSU-2(R) Temp 1"
label temp2 "PSU-2(R) Temp 2"
label power1 "PSU-2(R) 220V Rail Pwr (in)"
label power2 "PSU-2(R) 12V Rail Pwr (out)"
label curr1 "PSU-2(R) 220V Rail Curr (in)"
label curr2 "PSU-2(R) 12V Rail Curr (out)"

chip "dps460-i2c-*-59"
label in1 "PSU-1(L) 220V Rail (in)"
label in2 "PSU-1(L) 12V Rail (out)"
label fan1 "PSU-1(L) Fan 1"
label temp1 "PSU-1(L) Temp 1"
label temp2 "PSU-1(L) Temp 2"
label power1 "PSU-1(L) 220V Rail Pwr (in)"
label power2 "PSU-1(L) 12V Rail Pwr (out)"
label curr1 "PSU-1(L) 220V Rail Curr (in)"
label curr2 "PSU-1(L) 12V Rail Curr (out)"
bus "i2c-10" "i2c-1-mux (chan_id 1)"
chip "dps460-i2c-*-58"
label in1 "PSU-2(R) 220V Rail (in)"
label in2 "PSU-2(R) 12V Rail (out)"
label fan1 "PSU-2(R) Fan 1"
label temp1 "PSU-2(R) Temp 1"
label temp2 "PSU-2(R) Temp 2"
label power1 "PSU-2(R) 220V Rail Pwr (in)"
label power2 "PSU-2(R) 12V Rail Pwr (out)"
label curr1 "PSU-2(R) 220V Rail Curr (in)"
label curr2 "PSU-2(R) 12V Rail Curr (out)"
chip "dps460-i2c-*-59"
label in1 "PSU-1(L) 220V Rail (in)"
label in2 "PSU-1(L) 12V Rail (out)"
label fan1 "PSU-1(L) Fan 1"
label temp1 "PSU-1(L) Temp 1"
label temp2 "PSU-1(L) Temp 2"
label power1 "PSU-1(L) 220V Rail Pwr (in)"
label power2 "PSU-1(L) 12V Rail Pwr (out)"
label curr1 "PSU-1(L) 220V Rail Curr (in)"
label curr2 "PSU-1(L) 12V Rail Curr (out)"

# Chassis fans
chip "mlxreg_fan-isa-*"
Expand Down

0 comments on commit f626233

Please sign in to comment.