Skip to content

Commit 250ddb1

Browse files
committed
hw-mgmt: scripts: Fix detection of PDB devices on Q3450 systems
On Q3450 systems PDB devices are part of switch boards, they do not reside on separate boards as on other systems. Unlike switch board VR devices, PDB devices on different switch boards have adjacent i2c bus numbers, so using swb_brd_bus_offset parameter, which has value of 32, does not work. Introduce swb_brd_pdb_bus_offset parameter to describe the i2c bus number offset of PDB devices. Bug: 4818028 Signed-off-by: Felix Radensky <fradensky@nvidia.com>
1 parent e1d9cf2 commit 250ddb1

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

usr/usr/bin/hw-management-devtree.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
################################################################################
33
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
4-
# Copyright (c) 2022-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
# Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
55
#
66
# Redistribution and use in source and binary forms, with or without
77
# modification, are permitted provided that the following conditions are met:
@@ -1214,6 +1214,7 @@ devtr_check_board_components()
12141214
local board_str=$1
12151215
local board_num=1
12161216
local board_bus_offset=0
1217+
local board_pdb_bus_offset=
12171218
local board_vr_num=
12181219
local board_pwr_conv_num=
12191220
local board_hotswap_num=
@@ -1261,6 +1262,9 @@ devtr_check_board_components()
12611262
if [ -e "$config_path"/swb_brd_bus_offset ]; then
12621263
board_bus_offset=$(< $config_path/swb_brd_bus_offset)
12631264
fi
1265+
if [ -e "$config_path"/swb_brd_pdb_bus_offset ]; then
1266+
board_pdb_bus_offset=$(< $config_path/swb_brd_pdb_bus_offset)
1267+
fi
12641268
if [ -e "$config_path"/swb_brd_vr_num ]; then
12651269
board_vr_num=$(< $config_path/swb_brd_vr_num)
12661270
fi
@@ -1537,7 +1541,11 @@ devtr_check_board_components()
15371541
for ((brd=0, n=1; brd<board_num; brd++, n++)) do
15381542
curr_component=(${board_alternatives[$alternative_key]})
15391543
if [ $board_bus_offset -ne 0 ]; then
1540-
curr_component[2]=$((curr_component[2]+board_bus_offset*brd))
1544+
if [ ! -z "$board_pdb_bus_offset" ]; then
1545+
curr_component[2]=$((curr_component[2]+board_pdb_bus_offset*brd))
1546+
else
1547+
curr_component[2]=$((curr_component[2]+board_bus_offset*brd))
1548+
fi
15411549
fi
15421550
if [ ! -z "${board_name_pfx}" ]; then
15431551
if [ -z "${board_pwr_conv_num}" ]; then
@@ -1583,7 +1591,11 @@ devtr_check_board_components()
15831591
for ((brd=0, n=1; brd<board_num; brd++, n++)) do
15841592
curr_component=(${board_alternatives[$alternative_key]})
15851593
if [ $board_bus_offset -ne 0 ]; then
1586-
curr_component[2]=$((curr_component[2]+board_bus_offset*brd))
1594+
if [ ! -z "$board_pdb_bus_offset" ]; then
1595+
curr_component[2]=$((curr_component[2]+board_pdb_bus_offset*brd))
1596+
else
1597+
curr_component[2]=$((curr_component[2]+board_bus_offset*brd))
1598+
fi
15871599
fi
15881600
if [ ! -z "${board_name_pfx}" ]; then
15891601
if [ -z "${board_hotswap_num}" ]; then

usr/usr/bin/hw-management.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
################################################################################
33
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
4-
# Copyright (c) 2018-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
# Copyright (c) 2018-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
55
#
66
# Redistribution and use in source and binary forms, with or without
77
# modification, are permitted provided that the following conditions are met:
@@ -3512,10 +3512,15 @@ pre_devtr_init()
35123512
VMOD0018)
35133513
cpu_bus_offset=$xdr_cpu_bus_offset
35143514
case $sku in
3515-
HI158|HI175|HI178)
3515+
HI158)
35163516
echo 2 > "$config_path"/swb_brd_num
35173517
echo 32 > "$config_path"/swb_brd_bus_offset
35183518
;;
3519+
HI175|HI178)
3520+
echo 2 > "$config_path"/swb_brd_num
3521+
echo 32 > "$config_path"/swb_brd_bus_offset
3522+
echo 1 > "$config_path"/swb_brd_pdb_bus_offset
3523+
;;
35193524
HI179)
35203525
echo 2 > "$config_path"/swb_brd_num
35213526
echo 32 > "$config_path"/swb_brd_bus_offset

0 commit comments

Comments
 (0)