From a033366ae2fed1e21347342b9ad27c79599a5114 Mon Sep 17 00:00:00 2001 From: paavaanan Date: Tue, 2 Apr 2019 06:18:19 -0400 Subject: [PATCH 1/3] watchdog enable/disable scripts --- .../s6100/scripts/platform_watchdog_disable.sh | 13 +++++++++++++ .../s6100/scripts/platform_watchdog_enable.sh | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100755 platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_disable.sh create mode 100755 platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_enable.sh diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_disable.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_disable.sh new file mode 100755 index 000000000000..c3a90f3e89b2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_disable.sh @@ -0,0 +1,13 @@ +#!/bin/bash +#This script is used to disable SMF Watchdog Timer + +wd_status=-1 +enabled=0 + +# Disable Watchdog if enabled +wd_status=$(io_rd_wr.py --get --offset 0x207 | cut -d " " -f3) + +if [[ $wd_status -eq $enabled ]]; then + echo "Disabling Watchdog Timer.." + io_rd_wr.py --set --val 1 --offset 0x207 +fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_enable.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_enable.sh new file mode 100755 index 000000000000..804627b5e2fc --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_watchdog_enable.sh @@ -0,0 +1,8 @@ +#!/bin/bash +#This script is used to enable SMF Watchdog Timer + +# Set watchdog to 180 seconds +io_rd_wr.py --set --val 3 --offset 0x206 + +# Enable watchdog timer +io_rd_wr.py --set --val 0 --offset 0x207 From 3cf23dc4aa86f2aaf06f67eb4ead035122090355 Mon Sep 17 00:00:00 2001 From: paavaanan Date: Tue, 2 Apr 2019 06:28:58 -0400 Subject: [PATCH 2/3] watchdog enable/disable scripts --- .../debian/platform-modules-s6100.install | 2 ++ .../s6100/scripts/s6100_platform.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index 9be9da0ab428..a54e5b092642 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -6,5 +6,7 @@ common/fstrim.timer etc/systemd/system common/fstrim.service etc/systemd/system common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/platform_sensors.py usr/local/bin +s6100/scripts/platform_watchdog_enable.sh usr/local/bin +s6100/scripts/platform_watchdog_disable.sh usr/local/bin s6100/scripts/sensors usr/bin s6100/systemd/platform-modules-s6100.service etc/systemd/system diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index 1ac6ce93bc1d..b4d1dbaf68f3 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh @@ -226,6 +226,11 @@ if [[ "$1" == "init" ]]; then modprobe dell_s6100_iom_cpld modprobe dell_s6100_lpc + # Disable Watcdog Timer + if [[ -e /usr/local/bin/platform_watchdog_disable.sh ]]; then + exec /usr/local/bin/platform_watchdog_disable.sh + fi + cpu_board_mux "new_device" switch_board_mux "new_device" sys_eeprom "new_device" From 0a8b773aea5ac5383a53321e474ee7ca94e8196e Mon Sep 17 00:00:00 2001 From: paavaanan Date: Mon, 15 Apr 2019 06:53:01 -0400 Subject: [PATCH 3/3] Typo error --- .../sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index b4d1dbaf68f3..f8480f567380 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh @@ -226,7 +226,7 @@ if [[ "$1" == "init" ]]; then modprobe dell_s6100_iom_cpld modprobe dell_s6100_lpc - # Disable Watcdog Timer + # Disable Watchdog Timer if [[ -e /usr/local/bin/platform_watchdog_disable.sh ]]; then exec /usr/local/bin/platform_watchdog_disable.sh fi