Skip to content

Commit 6f2e2f3

Browse files
[202012][Dell]S6100 - iTCO watchdog support and reboot cause determination changes (#16726)
To support iTCO watchdog in Dell S6100. [Backport PR [DellEMC] S6100 - iTCO watchdog support and reboot cause determination changes #9149] Microsoft ADO (25153914): Update installer.conf for initializing the required drivers. Update the reboot cause determination logic to check for iTCO watchdog reset if the BIOS version supports iTCO watchdog.
1 parent 2042f44 commit 6f2e2f3

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CONSOLE_PORT=0x2f8
22
CONSOLE_DEV=1
3-
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nos-config-part=/dev/sda12 logs_inram=on"
3+
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich,wdat_wdt acpi_no_watchdog=1 nos-config-part=/dev/sda12 logs_inram=on"

platform/broadcom/sonic-platform-modules-dell/s6100/scripts/track_reboot_reason.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ MAILBOX_POWERON_REASON=/sys/devices/platform/SMF.512/hwmon/*/mb_poweron_reason
1515
NVRAM_DEVICE_FILE=/dev/nvram
1616
RESET_REASON_FILE=/host/reboot-cause/platform/reset_reason
1717
SMF_DIR=/sys/devices/platform/SMF.512/hwmon/
18+
TCO_RESET_NVRAM_OFFSET=0x59
1819

1920
while [[ ! -d $SMF_DIR ]]
2021
do
@@ -27,6 +28,7 @@ do
2728
done
2829

2930
SMF_RESET=$(cat $SMF_RESET_REASON)
31+
TCO_WD_RESET=0
3032

3133
if [[ -d /host/reboot-cause/platform ]]; then
3234
reboot_dir_found=true
@@ -80,6 +82,18 @@ _get_smf_reset_register(){
8082
echo "Fourth reset - $fourth_reset" >> $RESET_REASON_FILE
8183
fi
8284
logger -p user.info -t DELL_S6100_REBOOT_CAUSE "RST value in NVRAM: $first_reset, $second_reset, $third_reset, $fourth_reset"
85+
86+
if [[ $BIOS_VERSION_MINOR -gt 8 ]]; then
87+
# Retrieve TCO reset status
88+
tco_nvram=$((16#$(nvram_rd_wr.py --get --offset $TCO_RESET_NVRAM_OFFSET | cut -d " " -f 2)))
89+
TCO_WD_RESET=$(($tco_nvram & 1))
90+
logger -p user.info -t DELL_S6100_REBOOT_CAUSE "TCO status value in NVRAM: $TCO_WD_RESET"
91+
92+
# Clear TCO reset status in NVRAM
93+
tco_nvram=$(printf "%x" $(($tco_nvram & 0xfe)))
94+
nvram_rd_wr.py --set --val $tco_nvram --offset $TCO_RESET_NVRAM_OFFSET
95+
fi
96+
8397
# Clearing NVRAM values to holding next reset values
8498
nvram_rd_wr.py --set --val 0xee --offset 0x58
8599
nvram_rd_wr.py --set --val 0xee --offset 0x5c
@@ -131,7 +145,6 @@ _is_unknown_reset(){
131145
mb_poweron_reason=$(cat $MAILBOX_POWERON_REASON)
132146
echo "Unknown POR: $curr_poweron_reason RST: $curr_reset_reason MBR: $mb_poweron_reason" > $REBOOT_CAUSE_FILE
133147
fi
134-
135148
}
136149

137150
update_mailbox_register(){
@@ -161,7 +174,9 @@ update_mailbox_register(){
161174
&& [[ $SMF_MSS_VERSION_MAJOR -ge 2 ]] && [[ $SMF_MSS_VERSION_MINOR -ge 7 ]] \
162175
&& [[ $SMF_FPGA_VERSION_MAJOR -ge 1 ]] && [[ $SMF_FPGA_VERSION_MINOR -ge 4 ]]; then
163176

164-
if [[ $reason = "cc" ]]; then
177+
if [[ $TCO_WD_RESET = 1 ]]; then
178+
echo 0xdd > $MAILBOX_POWERON_REASON
179+
elif [[ $reason = "cc" ]]; then
165180
echo 0xaa > $MAILBOX_POWERON_REASON
166181
elif [[ $SMF_RESET = "11" ]]; then
167182
echo 0xee > $MAILBOX_POWERON_REASON
@@ -184,6 +199,8 @@ update_mailbox_register(){
184199
echo 0xee > $MAILBOX_POWERON_REASON
185200
elif [[ $is_wd_reboot = 1 ]] && [[ $reason != "cc" ]]; then
186201
echo 0xdd > $MAILBOX_POWERON_REASON
202+
elif [[ $TCO_WD_RESET = 1 ]]; then
203+
echo 0xdd > $MAILBOX_POWERON_REASON
187204
elif [[ $reason = "cc" ]]; then
188205
echo 0xaa > $MAILBOX_POWERON_REASON
189206
else

0 commit comments

Comments
 (0)