summaryrefslogtreecommitdiff
path: root/meta-fii
diff options
context:
space:
mode:
authorVincent Chou <Vincent.Chou@fii-na.com>2022-10-13 17:30:32 +0300
committerVivekanand Veeracholan <vveerach@google.com>2023-03-29 02:11:33 +0300
commite6970b4909a288cd9f4081b7b42ab67cdeb5877b (patch)
treef556db6a4c145569e0f722391b86e267dac6ce98 /meta-fii
parentab6556b1d9ae763211659a58637607d55b12b1ea (diff)
downloadopenbmc-e6970b4909a288cd9f4081b7b42ab67cdeb5877b.tar.xz
meta-fii: meta-mori: Add watchdog support with fallback
Add watchdog service to monitor the host status and execute the expire actions when host doesn't reset the watchdog timer. Add fallback support to the watchdog with the interval set to 10 minutes. Timer is reset with changes to host boot progress. If the host fails to reset the watchdog, then the watchdog action is performed with fallback to AC cycle after 10 minutes. Signed-off-by: Vincent Chou <Vincent.Chou@fii-na.com> Change-Id: Id0905ebc72405713806bbe2d803e6ca559488495
Diffstat (limited to 'meta-fii')
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host08
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service21
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend9
3 files changed, 38 insertions, 0 deletions
diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0 b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0
new file mode 100644
index 0000000000..466f08d4b6
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/host0
@@ -0,0 +1,8 @@
+DEVPATH=/xyz/openbmc_project/watchdog/host0
+SERVICE=xyz.openbmc_project.Watchdog
+UNIT_HARD_RESET=ampere-host-power-cycle.service
+UNIT_POWER_OFF=ampere-chassis-poweroff.service
+UNIT_POWER_CYCLE=ampere-chassis-powercycle.service
+FALLBACK_ACTION=xyz.openbmc_project.State.Watchdog.Action.PowerCycle
+FALLBACK_INTERVAL=600000
+MIN_INTERVAL=60000
diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
new file mode 100644
index 0000000000..003f479223
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Phosphor Watchdog
+
+[Service]
+EnvironmentFile={envfiledir}/obmc/watchdog/host0
+
+ExecStart=phosphor-watchdog --service=${{SERVICE}} --path=${{DEVPATH}} --watch_postcodes \
+ --continue --fallback_always --min_interval=${{MIN_INTERVAL}} \
+ --fallback_action=${{FALLBACK_ACTION}} --fallback_interval=${{FALLBACK_INTERVAL}} \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=${{UNIT_HARD_RESET}} \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=${{UNIT_POWER_OFF}} \
+ --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=${{UNIT_POWER_CYCLE}} \
+
+# This should use state manager instead of the service files currently defined
+
+SyslogIdentifier=phosphor-watchdog
+BusName=xyz.openbmc_project.Watchdog
+Type=dbus
+
+[Install]
+WantedBy=basic.target
diff --git a/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
new file mode 100644
index 0000000000..6a70555723
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend:mori := "${THISDIR}/${PN}:"
+SYSTEMD_ENVIRONMENT_FILE:${PN}:append:mori = " obmc/watchdog/host0"
+
+SYSTEMD_LINK:${PN}:remove:mori = "${@compose_list(d, 'ENABLE_WATCHDOG_FMT', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK:${PN}:remove:mori = "${@compose_list(d, 'WATCHDOG_FMT', 'OBMC_HOST_WATCHDOG_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+# Remove the override to keep service running after DC cycle
+SYSTEMD_OVERRIDE_${PN}:remove:mori = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf"
+SYSTEMD_SERVICE:${PN}:mori = " phosphor-watchdog.service \
+ "