WRONG, but working solution:
By default, guy who did the rootfs wrote this to rc.local:
/usr/local/sbin/brcm_patchram_plus --timeout=6.0 --patchram /lib/firmware/brcm/bcm4329.hcd --baudrate 921600 --use_baudrate_for_download /dev/ttymxc2 && hciattach /dev/ttymxc2 any 921600 &
Unfortunately, this is wrong in couple places:
1. Baudrate for bluetooth emebedded in BCM4329 can be up to 3000000, why not use the maximum
2. There are no --scopcm parameter sent. I spent some hours figuring this out and came to conclusion: only the "Transport" setting is working, everything else needs extra work done, such as fixing SGTL5000. Some other rootfs images have scopcm set to 0,4,0,0,0,0,0,0,0,0, which is also wrong.
Lets fix this two issues and run:
/usr/local/sbin/brcm_patchram_plus --scopcm=1,4,0,0,0,0,0,0,0,0 --timeout=6.0 --patchram /lib/firmware/brcm/bcm4329.hcd --baudrate 3000000 --use_baudrate_for_download /dev/ttymxc2 && hciattach /dev/ttymxc2 any 3000000 &
It will work, but you will still have two issues: UART SDMA still fails if anything is sent BOTH ways. This is unacceptable for HSP/HFP. And there is also another issue - there is something wrong with audio timings, everything seems to be recorded and played back exactly twice slower than if it be original. I suspect this is pcm rate issue, will try to figure it out. So next step is getting rid of SDMA on UART since it fails horribly: in this structure
http://repo.or.cz/w/wandboard.git/blob/refs/heads/wandboard:/arch/arm/mach-mx6/board-wand.c#l662 remove SDMA flag and .dma_req_tx/rx definitions leaving it like this:
static const struct imxuart_platform_data wand_bt_uart_data = {
.flags = IMXUART_HAVE_RTSCTS
};
Now UART will not get stuck and HSP/HFP will work.
But yet, this is a WRONG solution - we need to find why exactly SDMA fails for bluetooth and figure out how to use AUDMUX/I2S connection provided by the PCB itself. This solution uses UART for SCO, while PCB initially was designed from reference design using I2S/PCM for SCO data. But I guess this is up to TechNexion to show if they care about they own products - I already spent many hours figuring this out, now it is up to manufacturer to fix this right way.
Best Regards,
Dmitriy Beykun