3 # Script to attach HCI UART devices on i.MX8MQ EVK/EVKB
6 # For the most part errors are ignored and the script returns
7 # 0/success so BlueZ will still be started if the script is somehow
8 # run on a board without the expected hardware. However, if the
9 # various probing succeeds and hciattach is run, the script returns
10 # the resulting exit code if hciattach fails.
12 COMPAT=/sys/firmware/devicetree/base/compatible
14 PCIDEV=/sys/bus/pci/devices/0000:01:00.0
16 if [ ! \( -f "$COMPAT" -a -c "$HCITTY" \) ]; then
21 for c in `cat $COMPAT | tr '\0' ' '`; do
23 if echo $c | grep -q '^fsl,imx8mq-evk$'; then
29 echo "i.MX8MQ EVK not found!"
33 if [ -f "$PCIDEV/vendor" -a -f "$PCIDEV/device" ]; then
34 vendor=`cat $PCIDEV/vendor`
35 device=`cat $PCIDEV/device`
39 if [ "$vendor" = "0x14e4" -a "$device" = "0x43ec" ]; then
40 # Broadcom 5436 on EVKB
41 hciattach $HCITTY bcm43xx
43 elif [ "$vendor" = "0x168c" -a "$device" = "0x003e" ]; then
44 # Qualcomm (nee Atheros) 6174 on EVK
45 hciattach $HCITTY qualcomm