Bluetooth
2.4 Kernel
The 2.4 Kernel has some custom ioctl's to set/clear 2 GPIO pins for the bcm (BT_RESET and BT_WAKEUP). There is also a userspace application (dload) which resets the bt chip(via ioctl), place it in a "rom patching" state, send a bunch of patches and set the btaddr.
The 2.4 procedure to turn Bluetooth on is as follows:
- send AT EBTP=1 to BP (power on bcm2035)
- run userspace dload application
- reset the bt chip (via ioctls)
- TODO: better specify the ioctls involved.
- send a bunch of patches to the original firmware
- there are 26 patches (:)
- them a full firmware? (@00)
- set the btaddr
- NOTE: the bdaddr can be taken from the banner shown on /dev/mux0, after the copyright banner there is a line like:
-
EBAD:0,21,168,160,160,160
- the numbers above are the octets of the bdaddr, in decimal.
- The example above translates into the bdaddr:
-
00:15:A8:A0:A0:A0
- reset the bt chip (via ioctls)
- end
I have straced the dload application, understood the rom patching protocol, and rewrite a new one from scratch. Next week i will reimplement the ioctls in the kernel and see if i can send the firmware to the chip. I dont know if its necessary to properly hciattach, but its nice to have a gpl tool to patch the firmware of the bcm2035, and it was fun to write :).
update: No GPIO activity was necessary, i developed an userspace app to initialize/attach the bcm2035. Download from http://people.openezx.org/wyrm/bcm2035-tool.tgz
WyrM
2.6 Kernel
Bluetooth only works if the a780 is booted from flash. A good way to do this is by following the instructions at Dual_boot. The latest openembedded images with an openezx patched 2.6.23 kernel allow you to use bluetooth. Instructions on how to patch and build a 2.6.23 kernel are at: Kernel_hacking_-_linux-2.6.
After booting from flash everything is setup to enable bluetooth. Important note: bcm2035-tool and opentapi are deprecated and not needed to enable bluetooth. The following steps are needed to get bluetooth working:
1. echo -ne "AT+EBTP=1\r" > /dev/mux0 [this turns on the BT chip and allows communication with it via /dev/ttyS1] 2. hciattach /dev/ttyS1 bcm2035 460800 flow 01:02:03:04:05:06
At this point normal linux bluez operations work. "hciconfig hci0 up" followed by "hcitool scan" should show all bluetooth devices within range of the a780. Note that "01:02:03:04:05:06" is the a780 bluetooth address reported to other bluetooth devices. You can set it to almost any value.
Bluetooth PAND
It nearly works
on the phone : Start Bluetooth like above (2.6)
killall hcidd pand -l -n -z -r GN -D (sets up a listening pand server)
on your laptop /etc/init.d/bluetooth stop pand -c XX:XX:XX:XX:XX -n -z -D -r PANU
(bnep0 device should be created) the problem is now ifconfig bnep0 up doesnt work on the phone (siocsifflags)