Add the bluetooth exynos7270 firmware package for TM2 device
[platform/adaptation/bluetooth-firmware-bcm.git] / scripts / bt-dev-start-exynos7270.sh
1 #!/bin/sh
2
3 #
4 # Script for registering Marvell 8977 and BCM43012 SDIO BT device
5 #
6
7 # COMMON NODE
8 # Currently we can't use rfkill list due to lack of marvel
9 SETBD=/usr/bin/setbd
10 RFKILL=/usr/sbin/rfkill
11 GREP=/usr/bin/pgrep
12 MATCH_BCM="bcm43012"
13 HCI_CONFIG=/usr/bin/hciconfig
14 CP="/bin/cp"
15 SYSLOG_PATH=/var/log/messages
16 BT_MAC_FILE=/csa/bluetooth/.bd_addr
17 MAC_PRE="00:05:b5:"
18 PARAM_BDADDR="management_socket"
19 WLAN=/usr/bin/wlan.sh
20
21 # BCM43012 dependent bt start code
22 echo "BCM43012 SOLIS BT START"
23 echo "create bd address and write bd address via management socket"
24 #${SETBD} ${MAC_PRE} ${BT_MAC_FILE} ${PARAM_BDADDR}
25 ${SETBD} ${MAC_PRE} ${BT_MAC_FILE}
26 if [ $? -ne 0 ]
27 then
28         exit 1
29 fi
30
31 ${WLAN} start
32 ${RFKILL} unblock bluetooth
33
34 TIMEOUT=20
35 BT_FW_NAME=`basename $(readlink /lib/firmware/43012B0.hex)`
36 for (( i=1; i<=$TIMEOUT; i++))
37 do
38         /bin/sleep 0.1
39
40         if [ $i -eq $TIMEOUT ]
41         then
42                 echo "time expired happen $i"
43                 ${RFKILL} block bluetooth
44                 ${CP} $SYSLOG_PATH /var/lib/bluetooth/
45                 exit 1
46         fi
47
48         if (${HCI_CONFIG} | ${GREP} hci); then
49                 echo "Bluetooth device is made with "${BT_FW_NAME}
50                 break
51         fi
52         echo "Continue...$i"
53 done
54 exit 0
55
56
57
58