summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-common/recipes-phosphor/ipmi
diff options
context:
space:
mode:
authorThang Q. Nguyen <thang@os.amperecomputing.com>2022-03-17 05:35:04 +0300
committerThang Q. Nguyen <thang@os.amperecomputing.com>2022-03-18 11:00:51 +0300
commit05d7bed2f1ca43c12291fb36294fd89d8e90d34e (patch)
treef42876271883b9da2801a532a53f1096fec6a8ab /meta-ampere/meta-common/recipes-phosphor/ipmi
parent33812da79001c5dcdb2cc9d15e9786d8e42afddc (diff)
downloadopenbmc-05d7bed2f1ca43c12291fb36294fd89d8e90d34e.tar.xz
meta-ampere: move IPMI power soft to common
Ampere processor uses ACPI graceful shutdown which is triggered from BMC via a GPIO pin named SHD_REQ. This feature is common for all Ampere platforms. This commit moves the configuration for IPMI power soft to meta-ampere/meta-common so other platforms can use without changes Tested: 1. Do A/C power the system and boot the Host to OS. 2. Run ipmitool chassis power soft 3. Check if the Host is graceful shutdown. Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com> Change-Id: I8a3425c859c4be077075e6a51f12d50283eacdf7
Diffstat (limited to 'meta-ampere/meta-common/recipes-phosphor/ipmi')
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff5
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service13
-rw-r--r--meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend21
3 files changed, 39 insertions, 0 deletions
diff --git a/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff
new file mode 100644
index 0000000000..214aeed7ae
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff
@@ -0,0 +1,5 @@
+#!/bin/bash
+# Usage of this utility
+echo "Trigger soft off the host."
+/usr/sbin/ampere_power_util.sh mb soft_off
+exit $?;
diff --git a/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service
new file mode 100644
index 0000000000..01b31b1b3c
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Ampere Soft power off of the host
+Wants=obmc-host-stop-pre@0.target
+Before=obmc-host-stop-pre@0.target
+Conflicts=obmc-host-start@0.target
+ConditionPathExists=!/run/openbmc/host@0-request
+ConditionPathExists=!/lib/systemd/system/pldmSoftPowerOff.service
+
+[Service]
+Restart=no
+ExecStart=/usr/bin/env phosphor-softpoweroff
+SyslogIdentifier=phosphor-softpoweroff
+Type=oneshot
diff --git a/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
new file mode 100644
index 0000000000..ae4a2dff2d
--- /dev/null
+++ b/meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend
@@ -0,0 +1,21 @@
+FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
+
+RRECOMMENDS:${PN} += "ipmitool"
+RDEPENDS:${PN} += "bash"
+
+PACKAGECONFIG[dynamic-sensors] = "--enable-dynamic-sensors"
+HOSTIPMI_PROVIDER_LIBRARY += "libdynamiccmds.so"
+
+SRC_URI += "\
+ file://ampere-phosphor-softpoweroff \
+ file://ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \
+ "
+
+AMPERE_SOFTPOWEROFF_TMPL = "ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service"
+
+do_install:append(){
+ install -d ${D}${includedir}/phosphor-ipmi-host
+ install -m 0644 -D ${S}/selutility.hpp ${D}${includedir}/phosphor-ipmi-host
+ install -m 0755 ${WORKDIR}/ampere-phosphor-softpoweroff ${D}/${bindir}/phosphor-softpoweroff
+ install -m 0644 ${WORKDIR}/${AMPERE_SOFTPOWEROFF_TMPL} ${D}${systemd_unitdir}/system/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service
+}