meta-fii/meta-kudo: configure kudo system during bmc boot
1. do initialize during BMC boot
Signed-off-by: Lancelot Kao <lancelot.kao@fii-usa.com>
Change-Id: I5d3ff526a973152a96d00433eb86f7d7dd59e2d3
Signed-off-by: Mohaimen Alsamarai <Mohaimen.Alsamarai@fii-na.com>
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-lib.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-lib.sh
new file mode 100644
index 0000000..377257e
--- /dev/null
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-lib.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# set_gpio_ctrl
+# pin #, direction, high(1)/low(0)
+function set_gpio_ctrl() {
+ echo $1 > /sys/class/gpio/export
+ echo $2 > /sys/class//gpio/gpio$1/direction
+ echo $3 > /sys/class/gpio/gpio$1/value
+ echo $1 > /sys/class/gpio/unexport
+ sleep 1
+}
+
+# get_gpio_ctrl
+# pin #
+function get_gpio_ctrl() {
+ echo $1 > /sys/class/gpio/export
+ echo $(cat /sys/class/gpio/gpio$1/value)
+ echo $1 > /sys/class/gpio/unexport
+}