summaryrefslogtreecommitdiff
path: root/meta-phosphor
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor')
-rw-r--r--meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor.bb25
-rw-r--r--meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service8
-rw-r--r--meta-phosphor/conf/distro/include/phosphor-defaults.inc7
3 files changed, 40 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor.bb b/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor.bb
new file mode 100644
index 0000000000..e019ed01e8
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Phosphor GPIO monitor application"
+DESCRIPTION = "Application to monitor gpio assertions"
+HOMEPAGE = "http://github.com/openbmc/phosphor-gpio-monitor"
+PR = "r1"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
+inherit autotools pkgconfig
+inherit obmc-phosphor-dbus-service
+
+RPROVIDES_${PN} += "virtual/obmc-gpio-monitor"
+PROVIDES += "virtual/obmc-gpio-monitor"
+
+DEPENDS += "autoconf-archive-native"
+DEPENDS += "sdbusplus sdbusplus-native"
+DEPENDS += "phosphor-dbus-interfaces"
+DEPENDS += "phosphor-logging"
+RDEPENDS_${PN} += "libsystemd"
+RDEPENDS_${PN} += "phosphor-logging"
+
+SYSTEMD_SERVICE_${PN} += "phosphor-gpio-monitor@.service"
+
+SRC_URI += "git://github.com/openbmc/phosphor-gpio-monitor"
+SRCREV = "77ec47996d0c8b78d0f08d17fed8ff03107a1e03"
+S = "${WORKDIR}/git"
diff --git a/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service b/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service
new file mode 100644
index 0000000000..37d1279633
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Phosphor GPIO %I monitor
+
+[Service]
+Restart=no
+Type=oneshot
+EnvironmentFile={envfiledir}/obmc/gpio/%I
+ExecStart={sbindir}/phosphor-gpio-monitor --path=${{PATH}} --key=${{KEY}} --polarity=${{POLARITY}} --target=${{TARGET}}
diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
index 3dc3d3ce6f..870407535d 100644
--- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc
+++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc
@@ -190,5 +190,12 @@ PREFERRED_PROVIDER_virtual/phosphor-fan-control-fan-config ?= \
PREFERRED_PROVIDER_virtual/phosphor-ipmi-inventory-sel ?= \
"${@cf_enabled(d, 'obmc-mrw', 'phosphor-ipmi-inventory-sel-mrw-native', 'phosphor-ipmi-inventory-sel-native')}"
+# The phosphor-gpio-monitor application is data-driven and requires an input.
+# The application then watches the passed in input event entry for the
+# change in polarity for the value matching user input. Once the required
+# condition is met, it calls into a systemd target file if one is mentioned
+# in input.
+PREFERRED_PROVIDER_virtual/obmc-gpio-monitor ?= "phosphor-gpio-monitor"
+
OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project"
OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project"