rainier: Add fan watchdog BMC protection

Configure and include the fan watchdog services to drive the fans to
100% PWM if the BMC loses communication to the fan controller chip at
any time (i.e. BMC reset while powered on).

(From meta-ibm rev: 1264216bc2f10cf08f697bc1c95f10237c95515a)

Change-Id: I18865bdc06c1a2be0c2a83d5e83402b9316ee845
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/fan-watchdog.conf b/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/fan-watchdog.conf
new file mode 100644
index 0000000..ce7824c
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/fan-watchdog.conf
@@ -0,0 +1,3 @@
+TIMEOUT=5
+INTERVAL=1
+DEVICE=/dev/watchdog0
diff --git a/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/reset-fan-watchdog.conf b/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/reset-fan-watchdog.conf
new file mode 100644
index 0000000..98cb602
--- /dev/null
+++ b/meta-ibm/recipes-phosphor/fans/fan-watchdog/rainier/obmc/fan-watchdog/reset-fan-watchdog.conf
@@ -0,0 +1,4 @@
+GPIO_PATH=/dev/gpiochip0
+GPIO=114
+DELAY=1
+ACTION=low_high
diff --git a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 96a99b3..d031184 100644
--- a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -22,6 +22,7 @@
 RDEPENDS_${PN}-inventory_append_rainier = " openpower-fru-vpd openpower-occ-control virtual/obmc-gpio-presence"
 RDEPENDS_${PN}-inventory_append_mihawk = " openpower-fru-vpd openpower-occ-control virtual/obmc-gpio-presence id-button phosphor-cooling-type"
 RDEPENDS_${PN}-fan-control_append_ibm-ac-server = " fan-watchdog"
+RDEPENDS_${PN}-fan-control_append_rainier = " fan-watchdog"
 RDEPENDS_${PN}-extras_append_ibm-ac-server = " ${POWER_SERVICE_PACKAGES_AC_SERVER} witherspoon-power-supply-sync phosphor-webui"
 RDEPENDS_${PN}-extras_append_rainier = " ${POWER_SERVICE_PACKAGES_RAINIER} phosphor-webui"
 RDEPENDS_${PN}-extras_append_mihawk = " phosphor-webui phosphor-image-signing wistron-ipmi-oem"