mako: bluetooth: bring up

- top-level init.mako.bt.sh script calls hci_qcomm_init to initialize bluetooth
- modified BoardConfig.mk, device.mk, init.mako.rc. ueventd.mako.rc
  to add bring up code (remove qcom property for smd)

Change-Id: Id97080655696676c02fea93138eb819b1ee1a4b9
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/init.mako.bt.sh b/init.mako.bt.sh
new file mode 100644
index 0000000..3e80196
--- /dev/null
+++ b/init.mako.bt.sh
@@ -0,0 +1,58 @@
+#!/system/bin/sh
+
+BLUETOOTH_SLEEP_PATH=/proc/bluetooth/sleep/proto
+LOG_TAG="mako-bluetooth"
+LOG_NAME="${0}:"
+
+hciattach_pid=""
+
+loge ()
+{
+  /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
+}
+
+logi ()
+{
+  /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
+}
+
+failed ()
+{
+  loge "$1: exit code $2"
+  exit $2
+}
+
+# Note that "hci_qcomm_init -e" prints expressions to set the shell variables
+# BTS_DEVICE, BTS_TYPE, BTS_BAUD, and BTS_ADDRESS.
+
+POWER_CLASS=`getprop qcom.bt.dev_power_class`
+TRANSPORT=`getprop ro.qualcomm.bt.hci_transport`
+
+#find the transport type
+logi "Transport : $TRANSPORT"
+
+case $POWER_CLASS in
+  1) PWR_CLASS="-p 0" ;
+     logi "Power Class: 1";;
+  2) PWR_CLASS="-p 1" ;
+     logi "Power Class: 2";;
+  3) PWR_CLASS="-p 2" ;
+     logi "Power Class: CUSTOM";;
+  *) PWR_CLASS="";
+     logi "Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM)";
+     logi "Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3>";;
+esac
+
+logwrapper /system/bin/hci_qcomm_init -e $PWR_CLASS
+
+case $? in
+  0) logi "Bluetooth QSoC firmware download succeeded, $BTS_DEVICE $BTS_TYPE $BTS_BAUD $BTS_ADDRESS";;
+  *) failed "Bluetooth QSoC firmware download failed" $exit_code_hci_qcomm_init;
+     exit $exit_code_hci_qcomm_init;;
+esac
+
+logi "start bluetooth smd transport"
+
+echo 1 > /sys/module/hci_smd/parameters/hcismd_set
+
+exit 0