PKGBUILDs/alarm/firmware-brcm43xx/start-brcm-patchram-plus

46 lines
874 B
Text
Raw Normal View History

#!/bin/sh
MAC_OPTIONS=""
if [ -z "$MAC_ADDR" ]; then
echo "MAC_ADDR in /etc/conf.d/bcm4329 not set, will use MAC set by device (expect this to be buggy)"
else
MAC_OPTIONS="--bd_addr $MAC_ADDR"
fi
a=`cat /sys/class/mmc_host/mmc0/mmc0\:0001/mmc0\:0001\:1/device`
HCD=""
EXTRA=""
if [ "$a" = "0x4329" ] ; then
HCD="bcm4329.hcd"
fi
if [ "$a" = "0x4330" ] ; then
HCD="bcm4330.hcd"
EXTRA="--no2bytes --enable_lpm --tosleep=50000 "
fi
if [ -n "$HCD" ] ; then
echo "Found chip version $a."
/usr/bin/brcm_patchram_plus -d --patchram /usr/lib/firmware/brcm/$HCD --baudrate 3000000 --use_baudrate_for_download /dev/ttymxc3 --enable_hci $EXTRA $MAC_OPTIONS &
else
echo " No device Found."
exit 1
fi
for i in 1 2 3 4 5 ; do
b=`hciconfig | grep UART | cut -d: -f1`
if [ -n "$b" ] ; then
hciconfig $b up
break
else
sleep $i
fi
done
exit 0