xref: /OK3568_Linux_fs/debian/overlay-debug/usr/bin/bt_pcba_test (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#!/bin/bash
2*4882a593Smuzhiyun
3*4882a593Smuzhiyunkillall brcm_patchram_plus1
4*4882a593Smuzhiyun
5*4882a593Smuzhiyunecho 0 > /sys/class/rfkill/rfkill0/state
6*4882a593Smuzhiyunecho 0 > /proc/bluetooth/sleep/btwrite
7*4882a593Smuzhiyunsleep 2
8*4882a593Smuzhiyunecho 1 > /sys/class/rfkill/rfkill0/state
9*4882a593Smuzhiyunecho 1 > /proc/bluetooth/sleep/btwrite
10*4882a593Smuzhiyunsleep 2
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunCOMPATIBLE=$(cat /proc/device-tree/compatible)
13*4882a593Smuzhiyun
14*4882a593Smuzhiyunif [[ $(expr $COMPATIBLE : ".*rk3588") -ne 0 ]]; then
15*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS8 &
16*4882a593Smuzhiyunhciconfig hci0 up
17*4882a593Smuzhiyunsleep 1
18*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3568") -ne 0 ]]; then
19*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS8 &
20*4882a593Smuzhiyunhciconfig hci0 up
21*4882a593Smuzhiyunsleep 1
22*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3566") -ne 0 ]]; then
23*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS0 &
24*4882a593Smuzhiyunhciconfig hci0 up
25*4882a593Smuzhiyunsleep 1
26*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3562") -ne 0 ]]; then
27*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS1 &
28*4882a593Smuzhiyunhciconfig hci0 up
29*4882a593Smuzhiyunsleep 1
30*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3399") -ne 0 ]]; then
31*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS0 &
32*4882a593Smuzhiyunhciconfig hci0 up
33*4882a593Smuzhiyunsleep 1
34*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3288") -ne 0 ]]; then
35*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS0 &
36*4882a593Smuzhiyunhciconfig hci0 up
37*4882a593Smuzhiyunsleep 1
38*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*rk3326") -ne 0 ]]; then
39*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS1 &
40*4882a593Smuzhiyunhciconfig hci0 up
41*4882a593Smuzhiyunsleep 1
42*4882a593Smuzhiyunelif [[ $(expr $COMPATIBLE : ".*px30") -ne 0 ]]; then
43*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS1 &
44*4882a593Smuzhiyunhciconfig hci0 up
45*4882a593Smuzhiyunsleep 1
46*4882a593Smuzhiyunelse
47*4882a593Smuzhiyunbrcm_patchram_plus1 --bd_addr_rand --enable_hci --no2bytes --use_baudrate_for_download  --tosleep  200000 --baudrate 1500000 --patchram /system/etc/firmware/ /dev/ttyS0 &
48*4882a593Smuzhiyunhciconfig hci0 up
49*4882a593Smuzhiyunsleep 1
50*4882a593Smuzhiyunfi
51