From 05d7bed2f1ca43c12291fb36294fd89d8e90d34e Mon Sep 17 00:00:00 2001 From: "Thang Q. Nguyen" Date: Thu, 17 Mar 2022 02:35:04 +0000 Subject: 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 Change-Id: I8a3425c859c4be077075e6a51f12d50283eacdf7 --- .../phosphor-ipmi-host/ampere-phosphor-softpoweroff | 5 +++++ ...enbmc_project.Ipmi.Internal.SoftPowerOff.service | 13 +++++++++++++ .../ipmi/phosphor-ipmi-host_%.bbappend | 21 +++++++++++++++++++++ .../phosphor-ipmi-host/ampere-phosphor-softpoweroff | 5 ----- ...enbmc_project.Ipmi.Internal.SoftPowerOff.service | 13 ------------- .../ipmi/phosphor-ipmi-host_%.bbappend | 19 ------------------- 6 files changed, 39 insertions(+), 37 deletions(-) create mode 100644 meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff create mode 100644 meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service create mode 100644 meta-ampere/meta-common/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend delete mode 100644 meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff delete mode 100644 meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service (limited to 'meta-ampere') 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 +} diff --git a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff deleted file mode 100644 index 214aeed7ae..0000000000 --- a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere-phosphor-softpoweroff +++ /dev/null @@ -1,5 +0,0 @@ -#!/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-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service deleted file mode 100644 index 01b31b1b3c..0000000000 --- a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host/ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service +++ /dev/null @@ -1,13 +0,0 @@ -[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-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend index 04fff3d631..910b99f3fc 100644 --- a/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend +++ b/meta-ampere/meta-jade/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -2,26 +2,7 @@ FILESEXTRAPATHS:append := "${THISDIR}/${PN}:" DEPENDS:append = " ${MACHINE}-yaml-config" -RRECOMMENDS:${PN} += "ipmitool" -RDEPENDS:${PN} += "bash" - -SRC_URI += " \ - file://ampere-phosphor-softpoweroff \ - file://ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \ - " - EXTRA_OECONF = " \ SENSOR_YAML_GEN=${STAGING_DIR_HOST}${datadir}/${MACHINE}-yaml-config/ipmi-sensors.yaml \ " -AMPERE_SOFTPOWEROFF_TMPL = "ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" - -PACKAGECONFIG:append = " dynamic-sensors" -HOSTIPMI_PROVIDER_LIBRARY += "libdynamiccmds.so" - -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 -} -- cgit v1.2.3