diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 22:35:24 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2021-05-24 22:35:24 +0300 |
commit | 0e0df451ae365f09d5c0c766b253f23de26901f2 (patch) | |
tree | db4d7d3ce85e02ee01ad58a86ede02ac876aae77 /meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh | |
parent | e370fd750e2821620ec427f26f8efab0069824ff (diff) | |
parent | 7e10dee74964afa47859704886128dd256acf854 (diff) | |
download | openbmc-0e0df451ae365f09d5c0c766b253f23de26901f2.tar.xz |
Merge tag '0.52' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh')
-rw-r--r-- | meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh | 28 |
1 files changed, 28 insertions, 0 deletions
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 000000000..498fe7d0a --- /dev/null +++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh @@ -0,0 +1,28 @@ + +#!/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}"
\ No newline at end of file |