Cubietruck/Bluetooth

Given that you see this in dmesg: sunxi-uart.2: ttyS1 at MMIO 0x1c28800 (irq = 35) is a U6_16550A

You can upload the firmware and activate the hci device like that: ./brcm_patchram_plus -d --patchram /lib/firmware/ap6210/bcm20710a1.hcd --enable_hci --bd_addr 11:22:33:44:55:66 --no2bytes --tosleep 1000 /dev/ttyS1

You will see lots of hex dumps flying through the screen and at the end: received 7 04 0e 04 01 03 0c 00 writing 01 01 fc 06 66 55 44 33 22 11 received 7 04 0e 04 01 01 fc 00 Done setting line discpline

The program doesn't detach itself - goes into infinite sleep. Must investigate why.

Confirm the device has been created: root@cubietruck:~# hcitool dev Devices: hci0   11:22:33:44:55:66 root@cubietruck:~# hciconfig -a hci0:  Type: BR/EDR  Bus: UART BD Address: 11:22:33:44:55:66 ACL MTU: 1021:8  SCO MTU: 64:1 UP RUNNING PSCAN RX bytes:4479 acl:66 sco:0 events:130 errors:0 TX bytes:3593 acl:65 sco:0 commands:51 errors:0 Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: SLAVE ACCEPT Name: 'cubietruck-0' Class: 0x620100 Service Classes: Networking, Audio, Telephony Device Class: Computer, Uncategorized HCI Version: 4.0 (0x6) Revision: 0x1000 LMP Version: 4.0 (0x6) Subversion: 0x220e Manufacturer: Broadcom Corporation (15)

You might also need to preload bluetooth and hci-uart modules.

The program can be downloaded from https://code.google.com/p/broadcom-bluetooth/ The firmware can be grabbed from various places, e.g. cubietech images.

Update
There's been some complaints about the results being irreproducible. It is true that sometimes the firmware fails to load. And if it failed once, you most likely won't be able to activate the chip until next reboot (fixme: Someone more competent, explain how to reset the chip circuitry).

I have the following modules loaded before uploading the firmware: g2d_23 37275 2 - Live 0xbf16e000 rfcomm 57752 14 - Live 0xbf157000 bnep 13796 2 - Live 0xbf14f000 hci_uart 23588 1 - Live 0xbf144000 bluetooth 264130 31 hidp,rfcomm,bnep,hci_uart, Live 0xbf0ef000 sunxi_cedar_mod 9600 0 - Live 0xbf0e8000 snd_hwdep 5278 0 - Live 0xbf0e3000 snd_usbmidi_lib 17980 0 - Live 0xbf0da000 snd_rawmidi 18863 1 snd_usbmidi_lib, Live 0xbf0d0000 mali_drm 2533 2 - Live 0xbf0c4000 mali 224497 1 - Live 0xbf07d000 drm 208545 3 mali_drm, Live 0xbf034000 disp_ump 788 0 - Live 0xbf030000 ump 50814 6 mali,disp_ump, Live 0xbf01d000 lcd 3693 0 - Live 0xbf019000 sunxi_gmac 30577 0 - Live 0xbf00c000 pwm_sunxi 9138 0 - Live 0xbf005000 rtc_sun4i 5440 0 - Live 0xbf000000 After uploading the firmware I do: modprobe hidp hidd --server hciconfig hci0 up

This is probably not the cleanest way to do things, but I've been able to use a e.g. BT keyboard for a week long without any trouble.