meta-fii: meta-mori: Add command for controlling GPIOs
Add command to allow user to control GPIOs using mori.sh instead of
having to source mori-lib.sh and use functions.
Change-Id: I3cce175a41ca13bf3e14cea49495cde561348980
Signed-off-by: Kyle Nieman <kyle.nieman@fii-na.com>
diff --git a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh
index 814c030..dc015ef 100644
--- a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh
+++ b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh
@@ -40,6 +40,12 @@
echo " status --> get status of host accessibility to rtc"
}
+function usage_gpio() {
+ echo " mori gpio [parameter]"
+ echo " get [GPIO_LINE_NAME] --> get the gpio value of GPIO_LINE_NAME"
+ echo " set [GPIO_LINE_NAME] [GPIO_VALUE] --> set the gpio of GPIO_LINE_NAME to the value of GPIO_VALUE"
+}
+
function usage() {
echo " mori BMC console system utilities"
echo " mori [optional] [parameter]"
@@ -48,6 +54,7 @@
echo " uart --> control the uart mux"
echo " led --> control the leds"
echo " rtc --> control host access to rtc"
+ echo " gpio --> control the gpios"
}
function reset() {
@@ -278,6 +285,20 @@
esac
}
+function gpioctrl() {
+ case $1 in
+ get)
+ get_gpio_ctrl "$2"
+ ;;
+ set)
+ set_gpio_ctrl "$2" "$3"
+ ;;
+ *)
+ usage_gpio
+ ;;
+ esac
+}
+
case $1 in
rst)
reset "$2"
@@ -294,6 +315,9 @@
rtc)
rtcctrl "$2"
;;
+ gpio)
+ gpioctrl "$2" "$3" "$4"
+ ;;
*)
usage
;;