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-fw.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
index e42795f..1ef73cc 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
@@ -2,15 +2,7 @@
 
 devpath="/sys/bus/i2c/devices/13-0077/driver"
 
-# 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
-}
+source /usr/sbin/kudo-lib.sh
 
 function fwbios() {
   KERNEL_FIU_ID="c0000000.spi"
@@ -32,8 +24,8 @@
   if [ ! -f $1 ]; then
     echo " Cannot find the" $1 "image file"
     exit 1
-  fi
 
+  fi
   echo "Flashing BIOS @/dev/$BIOS_MTD"
   flashcp -v $1 /dev/$BIOS_MTD
   wait
@@ -52,7 +44,6 @@
   rm -f $1
 }
 
-
 function fwbmccpld() {
   # BMC_JTAG_MUX_1 #218 0:BMC 1:MB
   set_gpio_ctrl 218 out 0