diff options
author | Chanh Nguyen <chanh@os.amperecomputing.com> | 2021-03-23 07:50:26 +0300 |
---|---|---|
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2021-06-13 16:40:40 +0300 |
commit | b0da1bf01417170cef474f4262445c56d949de76 (patch) | |
tree | b39bfa39ead7a944d776236f26407f1ac58d687b /meta-ampere/meta-jade/recipes-phosphor | |
parent | cf71ae0b18d0526b54d167139d6ea092655d2dd4 (diff) | |
download | openbmc-b0da1bf01417170cef474f4262445c56d949de76.tar.xz |
meta-ampere: mtjade: support PSU present detection via GPIO
It checks GPIO key for powersupply presence, and creates
the inventory object.
Tested:
1. Plug the PSU, check busctl command for Present attribute
2. Plug out the PSU, check busctl command for Present attribute
$ busctl --no-pager introspect xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/powersupply0
Signed-off-by: Chanh Nguyen <chanh@os.amperecomputing.com>
Change-Id: I4520d537d425249debe5c0d8c6bf8b0f6e3c5b34
Diffstat (limited to 'meta-ampere/meta-jade/recipes-phosphor')
3 files changed, 24 insertions, 0 deletions
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-0.conf b/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-0.conf new file mode 100644 index 000000000..c5fc23ace --- /dev/null +++ b/meta-ampere/meta-jade/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=64 +NAME=powersupply0 +DRIVERS=/sys/bus/i2c/drivers/pmbus,6-0058 +EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-1.conf b/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/phosphor-power-supply-1.conf new file mode 100644 index 000000000..e591227d2 --- /dev/null +++ b/meta-ampere/meta-jade/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=65 +NAME=powersupply1 +DRIVERS=/sys/bus/i2c/drivers/pmbus,6-0059 +EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-ampere/meta-jade/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend new file mode 100644 index 000000000..0bff1c777 --- /dev/null +++ b/meta-ampere/meta-jade/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_mtjade = " ${@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_mtjade = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}" |