Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202012][Dell] S6100 - Add iTCO watchdog support #16726

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion device/dell/x86_64-dell_s6100_c2538-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(){
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down