sysinfo: Add information about I/O Expander if present

Print the HW and FW versions for the I/O Expander in the CC6UL SBC platform.

https://jira.digi.com/browse/DEL-3958

Signed-off-by: Sebastian Pastor <sebastian.pastor@digi.com>
This commit is contained in:
Sebastian Pastor 2017-03-23 19:07:20 +01:00
parent d1724ef6ff
commit da6e2198b1
1 changed files with 8 additions and 0 deletions

View File

@ -251,6 +251,13 @@ if grep -qs '\<digi,ccimx6ul\>' /proc/device-tree/compatible; then
MCA_VERSION="HW_VERSION=${MCA_HW_VERSION} FW_VERSION=${MCA_FW_VERSION}"
fi
IOEXP_NODE="/sys/devices/platform/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-006e"
if [ -d "$IOEXP_NODE" ]; then
IOEXP_HW_VERSION=$(cat ${IOEXP_NODE}/hw_version) || IOEXP_HW_VERSION="??"
IOEXP_FW_VERSION=$(cat ${IOEXP_NODE}/fw_version) || IOEXP_FW_VERSION="??"
IOEXP_VERSION="HW_VERSION=${IOEXP_HW_VERSION} FW_VERSION=${IOEXP_FW_VERSION}"
fi
DATE="$(date "+%Y%m%d%H%M%S")"
FILE="/tmp/sysinfo-${DEY_VERSION}-${BOARD_SN}-${DATE}.txt"
printf "\n\n"
@ -269,6 +276,7 @@ printf "\n\n"
echo "|| Firmware | ${DISTRO}-${DEY_VERSION}-$(cat /etc/version)"
echo "|| Kernel | $(uname -a)"
[ -n "${MCA_VERSION}" ] && echo "|| Kinetis | ${MCA_VERSION}"
[ -n "${IOEXP_VERSION}" ] && echo "|| I/O Expander | ${IOEXP_VERSION}"
printf "\n\n"
) | tee ${FILE}