summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-jade/recipes-phosphor
diff options
context:
space:
mode:
authorThuBaNguyen <thu@os.amperecomputing.com>2021-07-08 10:20:43 +0300
committerThang Q. Nguyen <thang@os.amperecomputing.com>2021-08-04 11:03:33 +0300
commitfb214784edbc1da7ba155a1cddf7b3f6d0bbfb66 (patch)
tree6f5f53085fdf7b83d043926b2bbefc4a50ac33a3 /meta-ampere/meta-jade/recipes-phosphor
parent2f952142e9ed8b436a0e702a0f46ac88842dd51e (diff)
downloadopenbmc-fb214784edbc1da7ba155a1cddf7b3f6d0bbfb66.tar.xz
meta-ampere: power control: restructure source code
ampere-hostctrl package includes the generic codes and the platform specific codes. The generic sources are applied for all of the Ampere platforms, they are the service files and the scripts to setting the GPIO pins. The platform specific sources are the GPIO pin config file and the gpio monitor config files. This commit moves the platform specific files to the platform code. Tested: 1. Do the power control actions use ipmitool, BMC web and Redfish. 2. Make sure the server states are changed as expected. Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com> Change-Id: Ic0e261109f7a5dfaf38c883bff0afedab763a0b6
Diffstat (limited to 'meta-ampere/meta-jade/recipes-phosphor')
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb23
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/ampere-host-shutdown-ack@.service8
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/reboot_ack4
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/shutdown_ack4
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend4
5 files changed, 43 insertions, 0 deletions
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb
new file mode 100644
index 0000000000..4358b1242a
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Ampere Computing LLC Host Gpio Handling"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit obmc-phosphor-systemd
+
+DEPENDS += "virtual/obmc-gpio-monitor"
+RDEPENDS_${PN} += "virtual/obmc-gpio-monitor"
+
+OBMC_HOST_ACK_MONITOR_INSTANCES = "reboot_ack shutdown_ack"
+
+SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/reboot_ack \
+ obmc/gpio/shutdown_ack \
+ "
+
+TMPL = "phosphor-gpio-monitor@.service"
+INSTFMT = "phosphor-gpio-monitor@{0}.service"
+TGT = "multi-user.target"
+FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
+
+SYSTEMD_SERVICE_${PN} += "ampere-host-shutdown-ack@.service"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_ACK_MONITOR_INSTANCES')}"
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/ampere-host-shutdown-ack@.service b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/ampere-host-shutdown-ack@.service
new file mode 100644
index 0000000000..6588191aae
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/ampere-host-shutdown-ack@.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Ampere Computing LLC host shutdown ACK
+Conflicts=obmc-chassis-poweron@0.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env ampere_power_util.sh mb shutdown_ack
+SyslogIdentifier=ampere_host_shutdown_ack
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/reboot_ack b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/reboot_ack
new file mode 100644
index 0000000000..a8ad98ee75
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/reboot_ack
@@ -0,0 +1,4 @@
+DEVPATH=/dev/input/event0
+KEY=75
+POLARITY=1
+TARGET=obmc-host-force-warm-reboot@0.target
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/shutdown_ack b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/shutdown_ack
new file mode 100644
index 0000000000..18cc87246f
--- /dev/null
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/host-gpio-handling/obmc/gpio/shutdown_ack
@@ -0,0 +1,4 @@
+DEVPATH=/dev/input/event0
+KEY=50
+POLARITY=1
+TARGET=ampere-host-shutdown-ack@0.service
diff --git a/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 3af702292d..ca86a4a21e 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-ampere/meta-jade/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,2 +1,6 @@
RDEPENDS_${PN}-extras_append_mtjade = " webui-vue phosphor-image-signing phosphor-virtual-sensor"
RDEPENDS_${PN}-inventory_append_mtjade = " fault-monitor id-button psu-hotswap-reset"
+
+RDEPENDS_${PN}-inventory_append_mtjade = " \
+ host-gpio-handling \
+ "