#!/bin/bash
spi_addr=0x86000000
get_al=0
X86_64=0
idx=0
result=`uname
-a`
array=(${result// / })
while [ 1 ]
do
if [ "${array[$idx]}" == "x86_64" ]; then
X86_64=1
break
fi
idx=$[$idx+1]
if [ $idx
> 20 ]; then
break;
fi
done
if [ $X86_64 == 1 ]; then
cp ./tool.x64 ./mvf
else
cp ./ tool.x86
./mvf
fi
chmod 777 mvf
./tool -l > /dev/null
if [ $? != 0 ] ;then
echo "No Adpater Found"
exit
fi
while [ 1 ]
do
`./tool -mmw
4 -addr 0xa8 -data $spi_addr
> /dev/null`
result=`./tool -mmr 4 -addr 0xaC -sz 4 | grep 0x000000AC`
array=(${result// / })
#echo
"${array[1]}"
if [ $get_al
== 1 ]; then
echo
"+------------------------------+"
echo "|
Firmware Version : ${array[1]} |"
echo
"+------------------------------+"
exit
fi
if [ "${array[1]}"
== "FFFFFFFF" ]; then
get_al=1
fi
spi_addr=$[$spi_addr+4]
done
沒有留言:
張貼留言