Add occ-disable dependency to host-crash and host-timeout

We need to unbind the occ-hmwon devices when either the host crashes or
we get a watchdog timeout on the host. This is so that OCC code can
start using the SBE FIFO without contention in the case of a checkstop
or other host problem.

Change-Id: I9ae3b1539a9eb4240cef74f2198c05b7a1b68380
Signed-off-by: Edward A. James <eajames@us.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb
index 33dac2f..9f7e52f 100644
--- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb
@@ -57,4 +57,14 @@
 SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}"
 SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}"
 
+# Set the occ disable service to be executed on host error
+HOST_ERROR_TARGETS = "crash timeout"
+
+OCC_DISABLE_TMPL = "op-occ-disable@.service"
+HOST_ERROR_TGTFMT = "obmc-host-{0}@{1}.target"
+OCC_DISABLE_INSTFMT = "op-occ-disable@{1}.service"
+HOST_ERROR_FMT = "../${OCC_DISABLE_TMPL}:${HOST_ERROR_TGTFMT}.wants/${OCC_DISABLE_INSTFMT}"
+
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'HOST_ERROR_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"
+
 S = "${WORKDIR}/git"