Merge pull request #878 from dpeddi/master
orangepi win can use ap6212-bluetooth... just need to reset cts a couple ot file..
This commit is contained in:
commit
b648cead49
@ -36,10 +36,10 @@ case "$1" in
|
||||
|
||||
# BT tweaks
|
||||
case ${BOARD} in
|
||||
cubietruck|orangepiwin)
|
||||
cubietruck)
|
||||
systemctl enable brcm40183-patch && service brcm40183-patch start
|
||||
;;
|
||||
bananapim2zero|bananapim2plus|nanopiair|nanopim1plus|orangepizeroplus2*|nanopineoplus2|nanopik2)
|
||||
bananapim2zero|bananapim2plus|nanopiair|nanopim1plus|orangepizeroplus2*|orangepiwin|nanopineoplus2|nanopik2)
|
||||
update-rc.d ap6212-bluetooth defaults
|
||||
;;
|
||||
cubox-i)
|
||||
|
||||
@ -29,6 +29,11 @@ if [ -f "/lib/firmware/ap6212/bcm43438a0.hcd" ] && [ ! -f /etc/firmware/ap6212/4
|
||||
fi
|
||||
|
||||
|
||||
if [ -f "/lib/firmware/ap6212/bcm43438a1.hcd" ] && [ ! -f /etc/firmware/ap6212/BCM43430A1.hcd ]; then
|
||||
mkdir -p /etc/firmware/ap6212
|
||||
cp /lib/firmware/ap6212/bcm43438a1.hcd /etc/firmware/ap6212/BCM43430A1.hcd
|
||||
fi
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
do_start () {
|
||||
@ -54,7 +59,12 @@ then
|
||||
rfkill unblock all
|
||||
echo "0" > /sys/class/rfkill/rfkill0/state
|
||||
echo "1" > /sys/class/rfkill/rfkill0/state
|
||||
echo " " > /dev/$PORT
|
||||
#on orangepi win following command never ends on first try... force to run with a timeout...
|
||||
timeout 5s echo " " > /dev/$PORT
|
||||
if [ $? != 0 ]; then
|
||||
#timed out... retry
|
||||
echo " " > /dev/$PORT
|
||||
fi
|
||||
hciattach /dev/$PORT bcm43xx 115200 flow bdaddr $MAC_OPTIONS
|
||||
hciconfig hci0 up
|
||||
fi
|
||||
|
||||
@ -21,7 +21,6 @@ fi
|
||||
# exit if bluetooth utils are not installed
|
||||
[ -f "/bin/hciconfig" ] || exit 0
|
||||
|
||||
. /etc/armbian-release
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
do_start () {
|
||||
@ -46,16 +45,8 @@ else
|
||||
PORT="ttyS1"
|
||||
fi
|
||||
|
||||
case ${BOARD} in
|
||||
"orangepiwin")
|
||||
PATCHRAM="/lib/firmware/ap6212/bcm43438a1.hcd"
|
||||
;;
|
||||
*)
|
||||
PATCHRAM="/lib/firmware/ap6210/bcm20710a1.hcd"
|
||||
# Different port for mainline
|
||||
if [ `uname -r | grep -v '^3.4.' ` ]; then PORT="ttyS2"; fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# reset port
|
||||
/usr/bin/brcm_bt_reset /dev/$PORT
|
||||
@ -64,7 +55,7 @@ else
|
||||
/bin/echo -en "" > /dev/$PORT # pull down RTS on UART
|
||||
log_action_begin_msg "Start pushing firmware to device and waiting max. 60sec to complete"
|
||||
|
||||
/usr/bin/timeout 20s /usr/bin/brcm_patchram_plus -d --patchram $PATCHRAM -enable_hci --no2bytes --tosleep 1000 $MAC_OPTIONS /dev/$PORT > /tmp/brcm40183.firmware 2>&1
|
||||
/usr/bin/timeout 20s /usr/bin/brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci --no2bytes --tosleep 1000 $MAC_OPTIONS /dev/$PORT > /tmp/brcm40183.firmware 2>&1
|
||||
|
||||
case "$?" in
|
||||
0) log_action_end_msg 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user