Tronsmart/Allwinner AW80 Bluetooth

242 views
Skip to first unread message

gusz

unread,
Jun 20, 2015, 11:22:36 AM6/20/15
to linux...@googlegroups.com
I have a Tronsmart/Allwinner AW80 mediabox running Tronsmart's Ubuntu_20150204 firmware (Lubuntu 14.04). This box uses the AMPAK AP6335 Wifi/Bluetooth chip, which I believe is based on a Broadcomm design. Wifi works but bluetooth doesn't.

I believe I've installed the correct bluetooth packages from the repository. On boot the bluetoothd daemon comes up, but when I use tools like hcitool, no local bluetooth devices are discovered. I believe I need a driver or module to support the bluetooth side of the AP6335 chip.

Can anyone help me on this? Is this supposed to work? Known not to work? What driver/module(s) do I need? How can I get them?

[Or .... is it a configuration problem?]

Thx, gus

Al Thomas

unread,
Jun 20, 2015, 11:53:18 AM6/20/15
to linux...@googlegroups.com
> From: gusz <randy....@gmail.com>
> Sent: Saturday, 20 June 2015, 16:17
> Subject: [linux-sunxi] Tronsmart/Allwinner AW80 Bluetooth
Unfortunately I can't tell you if it works or not, but I can give a little guidance.

You need to get the interface between the AW80 host and the AP6335 controller up first.
From the datasheet it looks as though there is only a UART serial interface to talk over, so
you need to figure out which UART it is and make sure it is configured in you DTS file
if you are using mainline kernel.

From what I understand Broadcom chips have a basic set of functionality and require firmware
to be uploaded. To test you are talking to the chip send an HCI reset command over the
serial line.

Once you are talking to the chip you will need to upload the firmware, this is different
firmware to the Wifi. It will be an .hcd file. A quick search found this:

https://github.com/gouwa/hwpacks/blob/master/system/vendor/firmware/bcm4339a0.hcd

used by this loader script:

https://github.com/gouwa/hwpacks/blob/master/wifibt/bluetooth-ap6335.conf

This should now be a similar procedure to the AP6210 bluetooth. See the wiki,
http://linux-sunxi.org/Bluetooth for more details.

It would be useful if you can confirm any of this works so the wiki page can be updated.

Good luck,

Al

rbr...@bayarea.net

unread,
Jun 23, 2015, 12:20:16 AM6/23/15
to linux...@googlegroups.com, asta...@yahoo.co.uk
Hi Al: thanks for your guidance. As it turns out the bcm4339a0.hcd file is in /lib/firmware/ap6335 on the Tronsmart AW80 box. But I've tried installing it with no luck ... and I admit I don't understand how to communicate with the ap6335 very well.

The modules I have loaded on the box are:

Module Size Used by
rtl_bluesleep 4150 0
bcm_btlpm 8334 0
pvrsrvkm 442746 0
dc_drmfbdev 16389 1 pvrsrvkm
bcmdhd 598110 0

I've installed the bluez package, which I think I need, and tried loading the bluez module, but I can't seem to do so.

In dmesg I see this

dmesg | grep tty
[ 1.403709] uart0: ttyS0 at MMIO 0x7000000 (irq = 32) is a SUNXI
[ 1.420801] console [ttyS0] enabled
[ 1.421632] uart2: ttyS2 at MMIO 0x7000800 (irq = 34) is a SUNXI

I've tried communicating thru ttyS2 to the ap6335, but I don't know if I'm doing it right and I don't know how to confirm that is the correct line to the ap6335.

As far as I can tell, Tronsmart has not released the kernel source or config file for their kernel (called version 3.4.39+). I have the impression Allwinner has released a kernel source, but figuring out the Tronsmart config options, and adding another tty/UART, and compiling the kernel, sounds tricky.

I'm not a complete linux novice, but I'm admittedly somewhat over my head. If you have further guidance based on the above, I'd be most appreciative.

Gus

Al Thomas

unread,
Jun 23, 2015, 6:33:18 AM6/23/15
to rbr...@bayarea.net, linux...@googlegroups.com

From: "rbr...@bayarea.net" <rbr...@bayarea.net>
Sent: Tuesday, 23 June 2015, 0:33
Subject: Re: [linux-sunxi] Tronsmart/Allwinner AW80 Bluetooth

As it turns out the bcm4339a0.hcd file is in /lib/firmware/ap6335 on the Tronsmart AW80 box.

That's a good sign.

The modules I have loaded on the box are:

Module                  Size  Used by
rtl_bluesleep          4150  0
bcm_btlpm              8334  0
pvrsrvkm              442746  0
dc_drmfbdev            16389  1 pvrsrvkm
bcmdhd                598110  0

For Linux you need hci_uart in there as well. This module sends HCI commands over the UART.

I've installed the bluez package, which I think I need, and tried loading the bluez module, but I can't seem to do so.

I can't help there.

dmesg | grep tty
[    1.403709] uart0: ttyS0 at MMIO 0x7000000 (irq = 32) is a SUNXI
[    1.420801] console [ttyS0] enabled
[    1.421632] uart2: ttyS2 at MMIO 0x7000800 (irq = 34) is a SUNXI

I've tried communicating thru ttyS2 to the ap6335, but I don't know if I'm doing it right and I don't know how to confirm that is the correct line to the ap6335.

As a simple test issue
cat /dev/ttyS2 | hexdump -C
on one host terminal. This will show any output from the controller over the serial line.
Then on another terminal issue
echo -n -e "\x01\x03\x0c\x00" > /dev/ttyS2
This is the HCI reset command and you should get back 0x04, 0x0e, 0x04, 0x01, 0x03, 0x0C, 0x00 on the first terminal.

This doesn't need the hci_uart module. If you don't get anything back it is either the chip needs to be woken up which can get complicated to figure out without schematics, but for the AP6210 it involves toggling the control lines on the UART, or it means the controller is not on ttyS2.

There is also the Broadcom tool, brcm_patchram_plus, that can be used to load the firmware - https://code.google.com/p/broadcom-bluetooth/downloads/detail?name=brcm_patchram_plus
This also doesn't need the hci_uart module. An example of loading firmware is on the linux-sunxi wiki Bluetooth page. I haven't used it in a while, but there may also be an option to issue a chip reset that also does the right things with the control lines.


As far as I can tell, Tronsmart has not released the kernel source or config file for their kernel (called version 3.4.39+). I have the impression Allwinner has released a kernel source, but figuring out the Tronsmart config options, and adding another tty/UART, and compiling the kernel, sounds tricky.

I'm not a complete linux novice, but I'm admittedly somewhat over my head. If you have further guidance based on the above, I'd be most appreciative.


I'm hoping the simple echo test will work. Atleast that would be confirmation that it is worth continuing to try and get things working.

Good luck,



Al
Reply all
Reply to author
Forward
0 new messages