The purpose of this document is to describe how to enable Bluetooth on i.MX 6Dual/Quad SabreSD board (RevC) for Android software.
i.MX 6Dual/Quad SabreSD board doesn't enable Bluetooth connection by default. To support bluetooth, the hardware rework is required.
The above diagram shows the reserved connections for Bluetooth in SabreSD RevC board (All connections are marked as "DNP"). This Bluetooth cable connector is designed specifically for the WiFi/BT combo card SX-SDCAN-2830BT which is developed and sold by Silex Technology. Note that pin 1 (BT_DISABLE) of the cable connector on i.MX 6Dual/Quad SabreSD RevC is opposite Pin 20 of the WiFi/BT module. Note: when connecting Silex module and J13, the connection is reverted (For example, PIN 1 in J13 connects to PIN 20 in Silex module). To use the J13 connector, the following reworks are required:
Where is them, you can refer to the below chart.
Orange PAD connects to Orange PAD.
Green PAD connects to Green PAD.
After hardware rework, the Bluetooth connection will like the following:
|Pin on Silex Module||Sabresd Board||Mux Pad|
|Pin-2 BT_UART_RTS (output)||UART5.RTS (input)||MX6Q_PAD_KEY_COL4__UART5_RTS|
|Pin-3 BT_UART_TXD (output)||UART5.RXD (input)||MX6Q_PAD_KEY_ROW1__UART5_RXD|
|Pin-4 BT_UART_CTS (input)||UART5.CTS (output)||MX6Q_PAD_KEY_ROW4__UART5_CTS|
|Pin-5 BT_UART_RXD (input)||UART5.TXD (output)||MX6Q_PAD_KEY_COL1__UART5_TXD|
|Pin-14 BT_PWD_L (input)||GPIO_2 (output)||MX6Q_PAD_GPIO_2__GPIO_1_2|
For earlier android version before Jelly Bean4.2
Take ICS as an example, for we didn't do this work when our last ICS version R13.4.1 released. So our formal release had no support on BT. Here will give out patches based on R13.4.1.
Enable Bluetooth with the following setting (e.g. device/fsl/imx6/sabresd/init.rc)
# No bluetooth hardware present
- setprop hw.bluetooth 0
+ setprop hw.bluetooth 1
Ensure BOARD_HAVE_BLUETOOTH := true in device/fsl/imx6/sabresd/SabreSDBoardConfigComm.mk.
Add BT feature support in device/fsl/imx6/sabresd/required_hardware.xml:
<feature name="android.hardware.camera" />
+ <feature name="android.hardware.bluetooth" />
Add UART5 support in kernel:
In this step you can refer to the attached (kernel patch for UART5 based on ICS.zip) to change PinMux PAD configuration for UART5.
Add AR3002 BT firmware support:
Update external/linux-firmware with the attached patch(0001-ENGR00270791-BT-add-AR3002-firmware-support.patch) to add AR3002 BT firmware support for Silex's BT is AR3002.
Then you can manually run the command “hciattach -n -s 115200 /dev/ttymxc4 ath3k 115200 flow nosleep” in console to see whether bluetooth can attach HCI successfully.
At last, you need add rfkill for BT reset in kernel, here also give a patch for reference:
BT is not enable in kernel default. You can control whether to enable it in bootargs like the following in device/fsl/sabresd_6dq/BoardConfig.mk.
BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale bluetooth
For android version since Jelly Bean4.2
From Jelly Bean4.2, Bluez is no longer used.Android provides a default Bluetooth stack, BlueDroid, that is divided into two layers: The Bluetooth Embedded System (BTE), which implements the core Bluetooth functionality and the Bluetooth Application Layer (BTA), which communicates with Android framework applications. A Bluetooth system service communicates with the Bluetooth stack through JNI and with applications through Binder IPC. The system service provides developers access to various Bluetooth profiles. The following diagram shows the general structure of the Bluetooth stack:
For bluedroid, we have supported it in our formal release including Android4.3. You can get it from our website. Or just get HAL code from attached(libbt-ath3k.zip).
For KEY_COL4 is both used by uart5 and pcie, if you enable BT, 3G mobile will not work. For its power disable pin is conflict with uart5's UART_RTS. This is
also why we didn't enable BT in formal release.
|workable profile||not tested profile|
|Hid||Handset & Handfree(not support for hardware restrict)|