Skip to content

Commit b3a8d15

Browse files
JimmyHuang777meta-codesync[bot]
authored andcommitted
GTI: Fix power-on issue when system is running without the SWB
Summary: Fix script termination when SWB is absent. The system cannot read data from the SWB CPLD without the SWB, causing the script to exit. X-link: https://github.com/facebookexternal/openbmc.quanta/pull/4854 Test Plan: Verfied with GTI system 1. Remove SWB and check whether the system setup correctly Reviewed By: ifel Differential Revision: D88064210 fbshipit-source-id: 2200f9f71fd39aac0128890a97bed9c3e86393ff
1 parent 83be0a9 commit b3a8d15

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

meta-facebook/meta-grandteton/recipes-grandteton/plat-utils/files/setup-common-dev.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,19 @@ if [ "$mb_product" != "GTA" ]; then
161161

162162
# SWB NIC
163163
kv set swb_nic_present 1
164-
for i in {8..15}
165-
do
164+
for i in $(seq 8 15); do
166165
output=$(i2cget -y -f 32 0x13 $i | tr -d ' \t\n\r')
167-
output=${output#0x}
168-
pres=$((16#${output} & 0x80 ))
169166
index=$((i-8))
170-
if [ "$pres" == "0" ]; then
167+
168+
if [[ ! "$output" =~ ^0x[0-9A-Fa-f]{2}$ ]]; then
169+
kv set swb_nic${index}_present 1
170+
continue
171+
fi
172+
173+
hex=${output#0x}
174+
prnt=$(( (16#$hex) & 0x80 ))
175+
176+
if [ "$prnt" -eq 0 ]; then
171177
kv set swb_nic_present 0
172178
kv set swb_nic${index}_present 0
173179
else

0 commit comments

Comments
 (0)