summaryrefslogtreecommitdiffstats
path: root/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh')
-rw-r--r--meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
new file mode 100644
index 0000000..1f22dcf
--- /dev/null
+++ b/meta-facebook/meta-wedge100/recipes-utils/openbmc-utils/files/power-on.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Copyright 2014-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+
+### BEGIN INIT INFO
+# Provides: power-on
+# Required-Start:
+# Required-Stop:
+# Default-Start: S
+# Default-Stop:
+# Short-Description: Power on micro-server
+### END INIT INFO
+. /usr/local/bin/openbmc-utils.sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+
+# make power button high to prepare for power on sequence
+gpio_set BMC_PWR_BTN_OUT_N 1
+
+# First power on TH, and if Panther+ is used,
+# provide standby power to Panther+.
+wedge_power_on_board
+
+echo -n "Checking microserver power status ... "
+if wedge_is_us_on 10 "."; then
+ echo "on"
+ on=1
+else
+ echo "off"
+ on=0
+fi
+
+if [ $on -eq 0 ]; then
+ # Power on now
+ wedge_power.sh on -f
+fi
OpenPOWER on IntegriCloud