[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.
This commit is contained in:
Arun Saravanan Balachandran 2023-09-29 01:55:12 +05:30 committed by GitHub
parent 2042f44d97
commit 6f2e2f353b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,3 @@
CONSOLE_PORT=0x2f8
CONSOLE_DEV=1
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich nos-config-part=/dev/sda12 logs_inram=on"
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="module_blacklist=gpio_ich,wdat_wdt acpi_no_watchdog=1 nos-config-part=/dev/sda12 logs_inram=on"

View File

@ -15,6 +15,7 @@ MAILBOX_POWERON_REASON=/sys/devices/platform/SMF.512/hwmon/*/mb_poweron_reason
NVRAM_DEVICE_FILE=/dev/nvram
RESET_REASON_FILE=/host/reboot-cause/platform/reset_reason
SMF_DIR=/sys/devices/platform/SMF.512/hwmon/
TCO_RESET_NVRAM_OFFSET=0x59
while [[ ! -d $SMF_DIR ]]
do
@ -27,6 +28,7 @@ do
done
SMF_RESET=$(cat $SMF_RESET_REASON)
TCO_WD_RESET=0
if [[ -d /host/reboot-cause/platform ]]; then
reboot_dir_found=true
@ -80,6 +82,18 @@ _get_smf_reset_register(){
echo "Fourth reset - $fourth_reset" >> $RESET_REASON_FILE
fi
logger -p user.info -t DELL_S6100_REBOOT_CAUSE "RST value in NVRAM: $first_reset, $second_reset, $third_reset, $fourth_reset"
if [[ $BIOS_VERSION_MINOR -gt 8 ]]; then
# Retrieve TCO reset status
tco_nvram=$((16#$(nvram_rd_wr.py --get --offset $TCO_RESET_NVRAM_OFFSET | cut -d " " -f 2)))
TCO_WD_RESET=$(($tco_nvram & 1))
logger -p user.info -t DELL_S6100_REBOOT_CAUSE "TCO status value in NVRAM: $TCO_WD_RESET"
# Clear TCO reset status in NVRAM
tco_nvram=$(printf "%x" $(($tco_nvram & 0xfe)))
nvram_rd_wr.py --set --val $tco_nvram --offset $TCO_RESET_NVRAM_OFFSET
fi
# Clearing NVRAM values to holding next reset values
nvram_rd_wr.py --set --val 0xee --offset 0x58
nvram_rd_wr.py --set --val 0xee --offset 0x5c
@ -131,7 +145,6 @@ _is_unknown_reset(){
mb_poweron_reason=$(cat $MAILBOX_POWERON_REASON)
echo "Unknown POR: $curr_poweron_reason RST: $curr_reset_reason MBR: $mb_poweron_reason" > $REBOOT_CAUSE_FILE
fi
}
update_mailbox_register(){
@ -161,7 +174,9 @@ update_mailbox_register(){
&& [[ $SMF_MSS_VERSION_MAJOR -ge 2 ]] && [[ $SMF_MSS_VERSION_MINOR -ge 7 ]] \
&& [[ $SMF_FPGA_VERSION_MAJOR -ge 1 ]] && [[ $SMF_FPGA_VERSION_MINOR -ge 4 ]]; then
if [[ $reason = "cc" ]]; then
if [[ $TCO_WD_RESET = 1 ]]; then
echo 0xdd > $MAILBOX_POWERON_REASON
elif [[ $reason = "cc" ]]; then
echo 0xaa > $MAILBOX_POWERON_REASON
elif [[ $SMF_RESET = "11" ]]; then
echo 0xee > $MAILBOX_POWERON_REASON
@ -184,6 +199,8 @@ update_mailbox_register(){
echo 0xee > $MAILBOX_POWERON_REASON
elif [[ $is_wd_reboot = 1 ]] && [[ $reason != "cc" ]]; then
echo 0xdd > $MAILBOX_POWERON_REASON
elif [[ $TCO_WD_RESET = 1 ]]; then
echo 0xdd > $MAILBOX_POWERON_REASON
elif [[ $reason = "cc" ]]; then
echo 0xaa > $MAILBOX_POWERON_REASON
else