summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Boyer <Charles.Boyer@fii-usa.com>2022-02-04 00:11:38 +0300
committerVivekanand Veeracholan <vveerach@google.com>2022-04-21 22:42:58 +0300
commit3d071ee73fe297f86833ac2db25384852255ac01 (patch)
tree7b1938d3ba9c96e55e65e5af85be4cf5080e78d4
parent7b2123ff805f73e61fb407b651a866b134486ebb (diff)
downloadopenbmc-3d071ee73fe297f86833ac2db25384852255ac01.tar.xz
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 <Charles.Boyer@fii-usa.com> Change-Id: I34541c0f56887962ad780b811eae44f1d851059d
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh24
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/packagegroups/packagegroup-kudo-apps.bb2
-rw-r--r--meta-fii/meta-kudo/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json10
3 files changed, 13 insertions, 23 deletions
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"
}
]
}