From 3d071ee73fe297f86833ac2db25384852255ac01 Mon Sep 17 00:00:00 2001 From: Charles Boyer Date: Thu, 3 Feb 2022 15:11:38 -0600 Subject: meta-fii: meta-kudo: Use phosphor-buttons package The method to monitor the power and reset buttons through the ampere_power_util.sh with phosphor-gpio-monitor was a temporary solution. It was a temporary workaround until there is support for Nuvoton GPIO in phosphor-buttons. Signed-off-by: Charles Boyer Change-Id: I34541c0f56887962ad780b811eae44f1d851059d --- .../recipes-kudo/host/files/ampere_power_util.sh | 24 +--------------------- .../packagegroups/packagegroup-kudo-apps.bb | 2 ++ .../skeleton/obmc-libobmc-intf/gpio_defs.json | 10 +++++++++ 3 files changed, 13 insertions(+), 23 deletions(-) (limited to 'meta-fii/meta-kudo') diff --git a/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh b/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh index 934af16d43..d6cfea498a 100644 --- a/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh +++ b/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh @@ -6,7 +6,7 @@ source /usr/libexec/kudo-fw/kudo-lib.sh # Usage of this utility function usage() { - echo "usage: power-util mb [on|off|graceful_shutdown|host_reset|host_cycle|shutdown_ack|hotswap|power_button]"; + echo "usage: power-util mb [on|off|graceful_shutdown|host_reset|host_cycle|shutdown_ack|hotswap]"; } hotswap() { @@ -100,26 +100,6 @@ shutdown_ack() { fi } -power_button() { - echo "Power button trigger event." - current_time="$(timestamp)" - if [ -f "/run/openbmc/power-button" ]; then - echo "Power button released" - press_time="$(cat /run/openbmc/power-button)" - if [[ "$current_time" -le "(($press_time + 1))" ]]; then - power_on - elif [[ "$current_time" -ge "(($press_time + 5))" ]]; then - power_off - else - echo "Button press did not match interval." - fi - rm "/run/openbmc/power-button" - else - echo "Power button pressed" - timestamp > "/run/openbmc/power-button" - fi -} - if [ $# -lt 2 ]; then echo "Total number of parameter=$#" echo "Insufficient parameter" @@ -156,8 +136,6 @@ elif [ "$2" == "host_cycle" ]; then host_cycle elif [ "$2" == "shutdown_ack" ]; then shutdown_ack -elif [ "$2" == "power_button" ]; then - power_button else echo "Invalid parameter2=$2" usage; diff --git a/meta-fii/meta-kudo/recipes-kudo/packagegroups/packagegroup-kudo-apps.bb b/meta-fii/meta-kudo/recipes-kudo/packagegroups/packagegroup-kudo-apps.bb index 1df52418f1..60729e61e3 100644 --- a/meta-fii/meta-kudo/recipes-kudo/packagegroups/packagegroup-kudo-apps.bb +++ b/meta-fii/meta-kudo/recipes-kudo/packagegroups/packagegroup-kudo-apps.bb @@ -23,6 +23,8 @@ RPROVIDES:${PN}-fan-mgmt += "virtual-obmc-fan-mgmt" SUMMARY:${PN}-kudo-chassis = "kudo chassis" RDEPENDS:${PN}-kudo-chassis = " \ obmc-op-control-power \ + obmc-phosphor-buttons-signals \ + obmc-phosphor-buttons-handler \ " SUMMARY:${PN}-kudo-system = "kudo System" diff --git a/meta-fii/meta-kudo/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json b/meta-fii/meta-kudo/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json index 47cb2cc60f..ad03a73cb6 100644 --- a/meta-fii/meta-kudo/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json +++ b/meta-fii/meta-kudo/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json @@ -15,6 +15,16 @@ "name": "PGOOD", "num": 200, "direction": "in" + }, + { + "name": "POWER_BUTTON", + "num": 192, + "direction": "both" + }, + { + "name": "RESET_BUTTON", + "num": 13, + "direction": "both" } ] } -- cgit v1.2.3