diff options
author | Rajaganesh Rathinasabapathi <Rajaganesh.Rathinasabapathi@amd.com> | 2024-05-17 10:45:14 +0300 |
---|---|---|
committer | Jayanth Othayoth <ojayanth@gmail.com> | 2024-05-21 17:53:34 +0300 |
commit | 372e564237fb8b133026fb86865eda05d7ef37ab (patch) | |
tree | 8565d52f4c01ed4d10af7a38c49d9195de89c2fa | |
parent | 3594786faf5e2efdfed9902ec00ac558710da2c8 (diff) | |
download | openbmc-372e564237fb8b133026fb86865eda05d7ef37ab.tar.xz |
meta-amd: Add IPMI watchdog support
Added IPMI watchdog service to AMD platforms.
Change-Id: I7da12dd45eaaa5b9c92c9876cdca7cabc1f79d33
Signed-off-by: Rajaganesh Rathinasabapathi <Rajaganesh.Rathinasabapathi@amd.com>
6 files changed, 53 insertions, 0 deletions
diff --git a/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb b/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb index a6291376e0..833c15ec7a 100644 --- a/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb +++ b/meta-amd/meta-common/recipes-amd/packagegroups/packagegroup-amd-apps.bb @@ -53,4 +53,5 @@ RDEPENDS_PN_SYSTEM_EXTRAS = "" RDEPENDS_PN_SYSTEM_EXTRAS:amd-withhost = " \ amd-fpga \ phosphor-hostlogger \ + phosphor-watchdog \ " diff --git a/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service new file mode 100644 index 0000000000..92c0395014 --- /dev/null +++ b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-cycle.service @@ -0,0 +1,12 @@ +[Unit] +Description=Power Cycle Host Server +Requires=xyz.openbmc_project.Chassis.Control.Power.service +After=xyz.openbmc_project.Chassis.Control.Power.service + +[Service] +Type=oneshot +ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Off +ExecStart=busctl set-property xyz.openbmc_project.Control.Host.RestartCause /xyz/openbmc_project/control/host0/restart_cause xyz.openbmc_project.Control.Host.RestartCause RequestedRestartCause s xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer +ExecStart=sleep 6 +ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.On +SyslogIdentifier=phosphor-watchdog diff --git a/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service new file mode 100644 index 0000000000..3c87131716 --- /dev/null +++ b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-poweroff.service @@ -0,0 +1,9 @@ +[Unit] +Description=Shutdown Host Server +Requires=xyz.openbmc_project.Chassis.Control.Power.service +After=xyz.openbmc_project.Chassis.Control.Power.service + +[Service] +Type=oneshot +ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Off +SyslogIdentifier=phosphor-watchdog diff --git a/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service new file mode 100644 index 0000000000..671fde6ff7 --- /dev/null +++ b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog-host-reset.service @@ -0,0 +1,10 @@ +[Unit] +Description=Reset Host Server +Requires=xyz.openbmc_project.Chassis.Control.Power.service +After=xyz.openbmc_project.Chassis.Control.Power.service + +[Service] +Type=oneshot +ExecStart=busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Reset +ExecStart=busctl set-property xyz.openbmc_project.Control.Host.RestartCause /xyz/openbmc_project/control/host0/restart_cause xyz.openbmc_project.Control.Host.RestartCause RequestedRestartCause s xyz.openbmc_project.State.Host.RestartCause.WatchdogTimer +SyslogIdentifier=phosphor-watchdog diff --git a/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service new file mode 100644 index 0000000000..f7e93b82f2 --- /dev/null +++ b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor Watchdog + +[Service] +ExecStart=/usr/bin/env phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \ + --path=/xyz/openbmc_project/watchdog/host0 \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=phosphor-watchdog-host-reset.service \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=host-phosphor-watchdog-host-poweroff.service \ + --action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=phosphor-watchdog-host-cycle.service \ + +SyslogIdentifier=phosphor-watchdog +BusName =xyz.openbmc_project.Watchdog +Type=dbus + +[Install] +WantedBy=basic.target diff --git a/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend new file mode 100644 index 0000000000..7cada9029d --- /dev/null +++ b/meta-amd/meta-common/recipes-phosphor/watchdog/phosphor-watchdog_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" + +# Remove the override to keep service running after DC cycle +SYSTEMD_OVERRIDE_${PN}:remove = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" +SYSTEMD_SERVICE_${PN} = "phosphor-watchdog.service phosphor-watchdog-host-poweroff.service phosphor-watchdog-host-reset.service phosphor-watchdog-host-cycle.service" |