meta-fii/meta-kudo: support the bios update feature
1. add kudo-bios-update package to support bios update
Signed-off-by: Lancelot Kao <lancelot.kao@fii-usa.com>
Change-Id: Ic245828ed3bb0ddf6d7363e7c2c4d3b8b538aa88
Signed-off-by: XP Chen <xiao-peng.chen@fii-na.com>
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-ver.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
new file mode 100644
index 0000000..2c50298
--- /dev/null
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
@@ -0,0 +1,27 @@
+
+#!/bin/bash
+BMC_CPLD_VER_FILE="/run/cpld0.version"
+MB_CPLD_VER_FILE="/run/cpld1.version"
+ver=''
+
+function fw_rev() {
+ case $1 in
+ cpldb)
+ rsp=($(i2cget -y -f -a 13 0x76 0x00 i 5))
+ ver=$(printf '%d.%d.%d.%d' ${rsp[6]} ${rsp[5]} ${rsp[4]} ${rsp[3]})
+ ;;
+ cpldm)
+ I2C_BUS_DEV=$(readlink "/sys/bus/i2c/devices/4-0077/channel-2" | cut -c 8-)
+ rsp=($(i2cget -y -f -a $I2C_BUS_DEV 0x76 0x00 i 5))
+ ver=$(printf '%d.%d.%d.%d' ${rsp[6]} ${rsp[5]} ${rsp[4]} ${rsp[3]})
+ ;;
+ *)
+ ;;
+ esac
+}
+fw_rev cpldb
+echo "BMC CPLD version : ${ver}"
+echo "${ver}" > "${BMC_CPLD_VER_FILE}"
+fw_rev cpldm
+echo "MB CPLD version : ${ver}"
+echo "${ver}" > "${MB_CPLD_VER_FILE}"