summaryrefslogtreecommitdiffstats
path: root/meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh')
-rwxr-xr-xmeta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh b/meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh
new file mode 100755
index 000000000..8e0dae38c
--- /dev/null
+++ b/meta-quanta/meta-q71l/recipes-phosphor/quanta-powerctrl/files/poweroff.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base)
+GPIO_NUM=$(($GPIO_BASE + 24 + 3))
+
+echo 1 > /sys/class/gpio/gpio${GPIO_NUM}/value
+sleep 5
+echo 0 > /sys/class/gpio/gpio${GPIO_NUM}/value
+
+exit 0;
OpenPOWER on IntegriCloud