summaryrefslogtreecommitdiff
path: root/meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
diff options
context:
space:
mode:
authorP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2022-03-30 23:46:16 +0300
committerP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2022-03-30 23:46:16 +0300
commit2af35ee50ce9918ee3626c59f2cff62cd3ab9568 (patch)
treebcc218f953c63222bff793a788b7922b9e39fb88 /meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh
parent7cf0c1cd0ce835d1833509b7b911e8a97380278b (diff)
parent9248c75b142fa11243c20f4d200a04e4f6395b51 (diff)
downloadopenbmc-2af35ee50ce9918ee3626c59f2cff62cd3ab9568.tar.xz
Merge tag '1-0.91' of github.com:intel-innersource/firmware.bmc.openbmc.yocto.openbmc into update
Diffstat (limited to 'meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh')
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/host/files/ampere_power_util.sh17
1 files changed, 13 insertions, 4 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 19ccc0e8e..d9bcb0cf2 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
@@ -4,7 +4,7 @@ source /usr/sbin/kudo-lib.sh
# Usage of this utility
function usage() {
- echo "usage: power-util mb [on|off|graceful_shutdown|force_reset|shutdown_ack|hotswap|power_button]";
+ echo "usage: power-util mb [on|off|graceful_shutdown|host_reset|host_cycle|shutdown_ack|hotswap|power_button]";
}
hotswap() {
@@ -70,7 +70,7 @@ graceful_shutdown() {
fi
}
-force_reset() {
+host_reset() {
if [ $(host_status) == "on" ]; then
echo "Triggering sysreset pin"
busctl set-property xyz.openbmc_project.Watchdog /xyz/openbmc_project/watchdog/host0 xyz.openbmc_project.State.Watchdog ExpireAction s xyz.openbmc_project.State.Watchdog.Action.None
@@ -82,6 +82,13 @@ force_reset() {
fi
}
+host_cycle() {
+ echo "DC cycling host"
+ force_off
+ sleep 2
+ power_on
+}
+
shutdown_ack() {
echo "Receive shutdown ACK triggered"
power_off
@@ -141,8 +148,10 @@ elif [[ $2 == "hotswap" ]]; then
hotswap
elif [[ $2 == "graceful_shutdown" ]]; then
graceful_shutdown
-elif [ $2 == "force_reset" ]; then
- force_reset
+elif [ $2 == "host_reset" ]; then
+ host_reset
+elif [ $2 == "host_cycle" ]; then
+ host_cycle
elif [ $2 == "shutdown_ack" ]; then
shutdown_ack
elif [ $2 == "power_button" ]; then