Panda LEB Bluetooth Enablement

Registered by Zach Pfeffer

Enable Bluetooth in the Panda LEB kernel.

This BP will enable BT in the Panda LEB by adjusting the Android build to compile Linux kernel modules, copy firmware into the Android rootfs and insmodding the .kos in the init scripts.

After BT is enabled in the kernel it will be hooked up to user space.

Blueprint information

Status:
Complete
Approver:
Zach Pfeffer
Priority:
Medium
Drafter:
vishal
Direction:
Approved
Assignee:
vishal
Definition:
Approved
Series goal:
Accepted for 2011q2
Implementation:
Implemented
Milestone target:
milestone icon 11.09
Started by
Zach Pfeffer
Completed by
Fathi Boudra

Related branches

Sprints

Whiteboard

[vishalbhoj, Sep 12,2011]:Bluetooth can be tested with https://android-build.linaro.org/builds/~linaro-android/leb-panda/#build=232 .Boot the device with the buid #232 and Go to Settings->Wireless Networks ->Bluetooth settings.You can turn on Bluetooth ,scan devices and pair with them.File transfer /A2DP profiles wont work as sdcard is not present and audio is not enabled for now.
[fboudra, Sep 9, 2011] Set implementation to implemented (scope of this blueprint is done). Vishal reported https://bugs.launchpad.net/bugs/845443
[vishalbhoj,Sep 9,2011]:All the changes have been committed,but bluetooth does not seem to work on build
https://android-build.linaro.org/builds/~linaro-android/leb-panda/#build=228 directly.It works when you replace MLO and u-boot.bin with binaries from http://releases.linaro.org/platform/linaro-n/android/11.08/leb-panda/boot.tar.bz2 . Its something to do with UART1 initialization at MLO/u-boot level.
[asac, Sep 5, 2011]: please update work items regularly; at least comment a change of status, e.g. when moving to "good progress", drop a simple comment like this whats going on. Also if a blueprint does not move, post at least every other day a status update whats the last discussion etc.l this blueprint is in drafting state -> please try to keep states etc. reflect reality :).
[asac, Jul 24, 2011]: lets keep comments at the top of whiteboard.
[asac, Jul 24, 2011]: should not have been one lumped together blueprint for wifi AND blueprint; keep things small. Please update whiteboard more frequently with comments about progress/blockage. at least when changing status to "slow progress", the action should be coming alongside a comment whats "slow" and whats the way forward.
[zpfeffer, Jul 24, 2011] I'm using the same BP because the steps to integrate both BT and WiFi are the same from an Android perspective, but I see you're point. I'll split this.
[asac, Jul 11, 2011]: summary love ;)

Headline:
Panda supports Bluetooth

Acceptance:
Bluetooth work from Android Userspace

Test Bluetooth: DONE

Notes:
TILT Panda Android Bluetooth Cheatsheet

Hi -

Assuming you follow this protocol of dumping all modules in system /lib/modules as I am doing, to bring up Bluetooth:

insmod /system/lib/modules/st_drv.ko
insmod /system/lib/modules/bluetooth.ko
insmod /system/lib/modules/bnep.ko
insmod /system/lib/modules/hci_uart.ko
insmod /system/lib/modules/rfcomm.ko
insmod /system/lib/modules/btwilink.ko

When you insert the last one, btwilink.ko, you will observe a bunch of these coming every second or so for a while until it gives up:

[ 140.626586] (stk) : st_kim_start# <6>(stk) :ldisc_install = 1
[ 140.736907] (stk) :ldisc_install = 1<3>(stk) :line disc installation timed out
[ 141.775726] (stk) :line disc installation timed out <6>(stk) :ldisc_install = 0
[ 141.787170] (stk) :ldisc_install = 0<6>(stk) :ldisc_install = 1
[ 141.853057] (stk) :ldisc_install = 1<3>(stk) :line disc installation timed out
[ 142.946899] (stk) :line disc installation timed out <6>(stk) :ldisc_install = 0
[ 142.958435] (stk) :ldisc_install = 0<6>(stk) :ldisc_install = 1
[ 143.063903] (stk) :ldisc_install = 1

It means it is trying to communicate with a userland daemon that is also required, called uim. You would start uim (no arguments are needed) immediately after insterting btwilink.ko.

uim lives here

git://gitorious.org/uim/uim.git master branch

it's trivial to make and presumably will build OK against bionic, I say that on the basis of my vast, towering ignorance about bionic, so you can take it to the bank.

After that's done, hci0 should exist and you should be able to go on workably.

-Andy

--
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106 - http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog

(?)

Work Items

Work items:
Install modules and firmware into a build by hand to test: DONE
Create Android.mk to install binaries: DONE
Extend android build to build kernel modules: DONE
Install Bluetooth modules in /system/lib/modules: DONE
Change BT module location from /system/lib/modules to /system/etc/modules/: DONE
Install Bluetooth firmware: DONE
Modify scripts to insmod Bluetooth modules: DONE
Compile userspace Bluetooth daemon uim for Android: DONE
Install Bluetooth user-space daemon uim into Android: DONE
Enable Bluetooth in build systemVerify working of Bluetooth on command prompt: DONE
Debug Bluetooth not working from UI and fix it : DONE
Add a clone of uim project to android.git.linaro.org at device/ti/uim : DONE
Commit above changes: DONE

This blueprint contains Public information 
Everyone can see this information.