fp5280g2: Add recipe file for phosphor-gpio-monitor
Add the power supply monitor application and configuration files
Tested: Built phosphor-gpio-monitor and ran successfully on the fp5280g2
via dbus interfaces.
(From meta-inspur rev: ea9932d3b56af3ff9a12689731bd8081b66af856)
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I5e365d7a979834f093b2a1b978ce22624be5bd8a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf b/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
index 22eedaf..233f6ab 100644
--- a/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
+++ b/meta-inspur/meta-fp5280g2/conf/machine/fp5280g2.conf
@@ -3,6 +3,8 @@
UBOOT_MACHINE = "ast_g5_ncsi_config"
+OBMC_POWER_SUPPLY_INSTANCES = "0 1"
+
PREFERRED_PROVIDER_virtual/p9-vcs-workaround = ''
PREFERRED_PROVIDER_virtual/openpower-fru-vpd-layout = "fp5280g2-openpower-fru-vpd-layout-native"
PREFERRED_PROVIDER_virtual/openpower-fru-inventory = "fp5280g2-openpower-fru-inventory-native"
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-0.conf b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-0.conf
new file mode 100644
index 0000000..f97d839
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-0.conf
@@ -0,0 +1,6 @@
+INVENTORY=/system/chassis/motherboard/powersupply0
+DEVPATH=/dev/input/by-path/platform-gpio-keys-event
+KEY=40
+NAME=powersupply0
+DRIVERS=/sys/bus/i2c/drivers/pmbus,11-0058
+EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-1.conf b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-1.conf
new file mode 100644
index 0000000..78c6658
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-1.conf
@@ -0,0 +1,6 @@
+INVENTORY=/system/chassis/motherboard/powersupply1
+DEVPATH=/dev/input/by-path/platform-gpio-keys-event
+KEY=41
+NAME=powersupply1
+DRIVERS=/sys/bus/i2c/drivers/pmbus,11-0059
+EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
new file mode 100644
index 0000000..04d1c07
--- /dev/null
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -0,0 +1,12 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+TMPL_POWERSUPPLY = "phosphor-gpio-presence@.service"
+INSTFMT_POWERSUPPLY = "phosphor-gpio-presence@{0}.service"
+POWERSUPPLY_TGT = "multi-user.target"
+FMT_POWERSUPPLY = "../${TMPL_POWERSUPPLY}:${POWERSUPPLY_TGT}.requires/${INSTFMT_POWERSUPPLY}"
+
+SYSTEMD_LINK_${PN}-presence_append_fp5280g2 = " ${@compose_list(d, 'FMT_POWERSUPPLY', 'OBMC_POWER_SUPPLY_INSTANCES')}"
+
+POWERSUPPLY_ENV_FMT = "obmc/gpio/phosphor-power-supply-{0}.conf"
+
+SYSTEMD_ENVIRONMENT_FILE_${PN}-presence_append_fp5280g2 = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"
diff --git a/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index 220f7b4..0cd358a 100644
--- a/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-inspur/meta-fp5280g2/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -1,2 +1,2 @@
-RDEPENDS_${PN}-inventory_append_fp5280g2 = " openpower-fru-vpd openpower-occ-control phosphor-cooling-type"
+RDEPENDS_${PN}-inventory_append_fp5280g2 = " openpower-fru-vpd openpower-occ-control phosphor-cooling-type virtual/obmc-gpio-presence"
RDEPENDS_${PN}-extras_append_fp5280g2 = " phosphor-webui"