systemd: enable watchdog and set watchdog device to wdt2

Should only enable this for specific machines, since the watchdog
configuration is machine-dependent.

Resolves openbmc/openbmc#2427

Change-Id: I03169b5dca6dccabe5eef2b5c759fe9b075450ac
Signed-off-by: Eddie James <eajames@us.ibm.com>
diff --git a/meta-witherspoon/recipes-core/systemd/systemd/0001-Enable-watchdog-and-set-watchdog-device-to-watchdog1.patch b/meta-witherspoon/recipes-core/systemd/systemd/0001-Enable-watchdog-and-set-watchdog-device-to-watchdog1.patch
new file mode 100644
index 0000000..f9a15ca
--- /dev/null
+++ b/meta-witherspoon/recipes-core/systemd/systemd/0001-Enable-watchdog-and-set-watchdog-device-to-watchdog1.patch
@@ -0,0 +1,27 @@
+From 5ebfe83e2d407e946d47cbe3b589b638fc62f1ab Mon Sep 17 00:00:00 2001
+From: Eddie James <eajames@us.ibm.com>
+Date: Thu, 5 Apr 2018 12:40:20 -0500
+Subject: [PATCH] Enable watchdog and set watchdog device to watchdog1
+
+---
+ src/core/system.conf | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/core/system.conf b/src/core/system.conf
+index 746572b..d012216 100644
+--- a/src/core/system.conf
++++ b/src/core/system.conf
+@@ -24,8 +24,9 @@
+ #CtrlAltDelBurstAction=reboot-force
+ #CPUAffinity=1 2
+ #JoinControllers=cpu,cpuacct net_cls,net_prio
+-#RuntimeWatchdogSec=0
++RuntimeWatchdogSec=20
+ #ShutdownWatchdogSec=10min
++WatchdogDevice=/dev/watchdog1
+ #CapabilityBoundingSet=
+ #SystemCallArchitectures=
+ #TimerSlackNSec=
+-- 
+1.8.3.1
+
diff --git a/meta-witherspoon/recipes-core/systemd/systemd_%.bbappend b/meta-witherspoon/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 0000000..ca8e652
--- /dev/null
+++ b/meta-witherspoon/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_append := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-Enable-watchdog-and-set-watchdog-device-to-watchdog1.patch"