warm reboot: stop instructions support
When shutting down the host it is good to always stop instructions on
the processors to ensure all activity has halted prior to starting a
shutdown or reboot.
Eventually this service will migrate over to using an ecmd API but until
that is ready, just use pdbg
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I1b81aa16c37124d7671eb84bbbc22cddd0a05e3f
diff --git a/Makefile.am b/Makefile.am
index 8f72036..70a2552 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,8 @@
systemdsystemunit_DATA = \
pcie-poweroff@.service \
- xyz.openbmc_project.Control.Host.NMI.service
+ xyz.openbmc_project.Control.Host.NMI.service \
+ op-stop-instructions@.service
if ENABLE_PHAL
systemdsystemunit_DATA += set-spi-mux.service
diff --git a/configure.ac b/configure.ac
index ee62a9a..c6584f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,4 +100,5 @@
AC_CONFIG_FILES([Makefile test/Makefile])
AC_CONFIG_FILES([pcie-poweroff@.service])
AC_CONFIG_FILES([xyz.openbmc_project.Control.Host.NMI.service])
+AC_CONFIG_FILES([op-stop-instructions@.service])
AC_OUTPUT
diff --git a/op-stop-instructions@.service.in b/op-stop-instructions@.service.in
new file mode 100644
index 0000000..38a3e7e
--- /dev/null
+++ b/op-stop-instructions@.service.in
@@ -0,0 +1,17 @@
+[Unit]
+Description=Stop instructions for host%i
+Wants=obmc-host-stop-pre@%i.target
+Before=obmc-host-stop-pre@%i.target
+After=op-occ-disable@%i.service
+After=xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service
+Conflicts=obmc-host-startmin@%i.target
+ConditionPathExists=/sys/class/fsi-master/fsi0/slave@00:00/cfam_id
+
+[Service]
+RemainAfterExit=yes
+Type=oneshot
+# TODO - Replace with official istep stopinstructions once available
+ExecStart=/usr/bin/pdbg -a stop
+
+[Install]
+WantedBy=obmc-host-stop@%i.target