summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package/bluez/Makefile4
-rw-r--r--package/bluez/files/bluez.init2
-rw-r--r--package/bluez/files/bluez.postinst3
-rw-r--r--package/bluez/patches/patch-tools_bccmd_c18
-rw-r--r--package/bluez/patches/patch-tools_hciattach_bcm43xx_c32
-rw-r--r--package/bluez/patches/patch-tools_hciattach_c39
-rw-r--r--package/brcm-bluetooth/Makefile13
-rw-r--r--package/brcm-bluetooth/files/hci32
-rw-r--r--package/brcm-bluetooth/src/BCM43430A1.hcdbin0 -> 35976 bytes
-rw-r--r--target/linux/config/Config.in.bluetooth7
10 files changed, 108 insertions, 42 deletions
diff --git a/package/bluez/Makefile b/package/bluez/Makefile
index 12c87639d..064ed3be5 100644
--- a/package/bluez/Makefile
+++ b/package/bluez/Makefile
@@ -4,9 +4,9 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= bluez
-PKG_VERSION:= 5.39
+PKG_VERSION:= 5.40
PKG_RELEASE:= 1
-PKG_HASH:= 21d1bc9150d3576296595217efb98a746b592389d25d5637e8bee5da7272593b
+PKG_HASH:= dada8b812055afcad4546d9966f9a763e4723169e89706e2b240c7b7e998dc27
PKG_DESCR:= bluetooth applications
PKG_SECTION:= net/wifi
PKG_DEPENDS:= glib dbus libreadline
diff --git a/package/bluez/files/bluez.init b/package/bluez/files/bluez.init
index 489b9714b..3d767c7d5 100644
--- a/package/bluez/files/bluez.init
+++ b/package/bluez/files/bluez.init
@@ -11,7 +11,7 @@ autostart)
exec sh $0 start
;;
start)
- /usr/libexec/bluetooth/bluetoothd
+ /usr/libexec/bluetooth/bluetoothd &
;;
stop)
kill $(pgrep -f /usr/libexec/bluetooth/bluetoothd)
diff --git a/package/bluez/files/bluez.postinst b/package/bluez/files/bluez.postinst
new file mode 100644
index 000000000..ebfa342dd
--- /dev/null
+++ b/package/bluez/files/bluez.postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+. $IPKG_INSTROOT/etc/functions.sh
+add_rcconf bluez NO
diff --git a/package/bluez/patches/patch-tools_bccmd_c b/package/bluez/patches/patch-tools_bccmd_c
deleted file mode 100644
index d9ac8ac35..000000000
--- a/package/bluez/patches/patch-tools_bccmd_c
+++ /dev/null
@@ -1,18 +0,0 @@
---- bluez-5.12.orig/tools/bccmd.c 2013-09-16 10:36:07.000000000 +0200
-+++ bluez-5.12/tools/bccmd.c 2013-12-21 19:19:21.000000000 +0100
-@@ -1159,6 +1159,7 @@ int main(int argc, char *argv[])
- case 115200: bcsp_rate = B115200; break;
- case 230400: bcsp_rate = B230400; break;
- case 460800: bcsp_rate = B460800; break;
-+#if 0
- case 500000: bcsp_rate = B500000; break;
- case 576000: bcsp_rate = B576000; break;
- case 921600: bcsp_rate = B921600; break;
-@@ -1178,6 +1179,7 @@ int main(int argc, char *argv[])
- #ifdef B4000000
- case 4000000: bcsp_rate = B4000000; break;
- #endif
-+#endif
- default:
- printf("Unknown BCSP baud rate specified, defaulting to 38400bps\n");
- bcsp_rate = B38400;
diff --git a/package/bluez/patches/patch-tools_hciattach_bcm43xx_c b/package/bluez/patches/patch-tools_hciattach_bcm43xx_c
new file mode 100644
index 000000000..0b8799193
--- /dev/null
+++ b/package/bluez/patches/patch-tools_hciattach_bcm43xx_c
@@ -0,0 +1,32 @@
+--- bluez-5.40.orig/tools/hciattach_bcm43xx.c 2015-03-11 11:01:57.000000000 +0100
++++ bluez-5.40/tools/hciattach_bcm43xx.c 2016-06-18 23:25:59.991459117 +0200
+@@ -43,7 +43,7 @@
+ #include "hciattach.h"
+
+ #ifndef FIRMWARE_DIR
+-#define FIRMWARE_DIR "/etc/firmware"
++#define FIRMWARE_DIR "/lib/firmware"
+ #endif
+
+ #define FW_EXT ".hcd"
+@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed,
+ return -1;
+
+ if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) {
+- fprintf(stderr, "Patch not found, continue anyway\n");
++ fprintf(stderr, "Patch not found for %s, continue anyway\n", chip_name);
+ } else {
+- if (bcm43xx_set_speed(fd, ti, speed))
+- return -1;
+-
+ if (bcm43xx_load_firmware(fd, fw_path))
+ return -1;
+
+@@ -380,6 +377,7 @@ int bcm43xx_init(int fd, int def_speed,
+ return -1;
+ }
+
++ sleep(1);
+ if (bcm43xx_reset(fd))
+ return -1;
+ }
diff --git a/package/bluez/patches/patch-tools_hciattach_c b/package/bluez/patches/patch-tools_hciattach_c
index 221766348..a1a7bebc6 100644
--- a/package/bluez/patches/patch-tools_hciattach_c
+++ b/package/bluez/patches/patch-tools_hciattach_c
@@ -1,18 +1,21 @@
---- bluez-5.19.orig/tools/hciattach.c 2014-04-12 12:13:29.000000000 +0200
-+++ bluez-5.19/tools/hciattach.c 2014-06-04 16:53:28.000000000 +0200
-@@ -101,6 +101,7 @@ int uart_speed(int s)
- return B230400;
- case 460800:
- return B460800;
-+#if 0
- case 500000:
- return B500000;
- case 576000:
-@@ -135,6 +136,7 @@ int uart_speed(int s)
- case 4000000:
- return B4000000;
- #endif
-+#endif
- default:
- return B57600;
- }
+--- bluez-5.40.orig/tools/hciattach.c 2016-05-26 18:51:11.000000000 +0200
++++ bluez-5.40/tools/hciattach.c 2016-06-18 23:26:52.616003343 +0200
+@@ -1090,6 +1090,9 @@ struct uart_t uart[] = {
+ { "bcm43xx", 0x0000, 0x0000, HCI_UART_H4, 115200, 3000000,
+ FLOW_CTL, DISABLE_PM, NULL, bcm43xx, NULL },
+
++ { "bcm43xx-3wire", 0x0000, 0x0000, HCI_UART_3WIRE, 115200, 3000000,
++ 0, DISABLE_PM, NULL, bcm43xx, NULL },
++
+ { "ath3k", 0x0000, 0x0000, HCI_UART_ATH3K, 115200, 115200,
+ FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm },
+
+@@ -1236,7 +1239,7 @@ int main(int argc, char *argv[])
+ {
+ struct uart_t *u = NULL;
+ int detach, printpid, raw, opt, i, n, ld, err;
+- int to = 10;
++ int to = 30;
+ int init_speed = 0;
+ int send_break = 0;
+ pid_t pid;
diff --git a/package/brcm-bluetooth/Makefile b/package/brcm-bluetooth/Makefile
index 80ab9865b..141c310dd 100644
--- a/package/brcm-bluetooth/Makefile
+++ b/package/brcm-bluetooth/Makefile
@@ -9,6 +9,9 @@ PKG_RELEASE:= 1
PKG_DESCR:= firmware for broadcom bluetooth chips
PKG_SECTION:= sys/firmware
+PKG_CFLINE_BRCM_BLUETOOTH:= default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
+PKG_SYSTEM_DEPENDS:= raspberry-pi3 solidrun-imx6
+
NO_DISTFILES:= 1
include ${ADK_TOPDIR}/mk/package.mk
@@ -24,10 +27,16 @@ do-build:
-o ${WRKBUILD}/brcm_patchram ${WRKBUILD}/brcm_patchram.c
do-install:
- ${INSTALL_DIR} ${IDIR_BRCM_BLUETOOTH}/lib/firmware/brcm
- ${CP} ${WRKBUILD}/*.hcd ${IDIR_BRCM_BLUETOOTH}/lib/firmware/brcm
+ ${INSTALL_DIR} ${IDIR_BRCM_BLUETOOTH}/etc/init.d
+ $(INSTALL_BIN) ./files/hci $(IDIR_BRCM_BLUETOOTH)/etc/init.d/
+ ${INSTALL_DIR} ${IDIR_BRCM_BLUETOOTH}/lib/firmware
+ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3),y)
+ ${CP} ${WRKBUILD}/BCM43430A1.hcd ${IDIR_BRCM_BLUETOOTH}/lib/firmware
+else
+ ${CP} ${WRKBUILD}/bcm*.hcd ${IDIR_BRCM_BLUETOOTH}/lib/firmware
${INSTALL_DIR} ${IDIR_BRCM_BLUETOOTH}/sbin
${INSTALL_BIN} ${WRKBUILD}/brcm_patchram \
${IDIR_BRCM_BLUETOOTH}/sbin/brcm_patchram
+endif
include ${ADK_TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/brcm-bluetooth/files/hci b/package/brcm-bluetooth/files/hci
new file mode 100644
index 000000000..8b7d231c3
--- /dev/null
+++ b/package/brcm-bluetooth/files/hci
@@ -0,0 +1,32 @@
+#!/bin/sh
+#PKG brcm-bluetooth
+#INIT 10
+
+case $1 in
+autostop) ;;
+autostart)
+ exec sh $0 start
+ ;;
+start)
+ target=$(cat /etc/.adktarget)
+ case $target in
+ raspberry-pi3)
+ hciattach /dev/ttyAMA0 bcm43xx 921600 noflow -
+ ;;
+ *)
+ echo "No supported target found"
+ ;;
+ esac
+ ;;
+stop)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ exit 1
+ ;;
+esac
+exit $?
diff --git a/package/brcm-bluetooth/src/BCM43430A1.hcd b/package/brcm-bluetooth/src/BCM43430A1.hcd
new file mode 100644
index 000000000..162275ac0
--- /dev/null
+++ b/package/brcm-bluetooth/src/BCM43430A1.hcd
Binary files differ
diff --git a/target/linux/config/Config.in.bluetooth b/target/linux/config/Config.in.bluetooth
index 7b65becd8..0920336b2 100644
--- a/target/linux/config/Config.in.bluetooth
+++ b/target/linux/config/Config.in.bluetooth
@@ -119,10 +119,15 @@ config ADK_KERNEL_BT_HCIUART_H4
depends on ADK_KERNEL_BT_HCIUART
default n
+config ADK_KERNEL_BT_HCIUART_3WIRE
+ bool
+ depends on ADK_KERNEL_BT_HCIUART
+ default n
+
config ADK_KERNEL_BT_HCIUART_BCM
tristate "Broadcom protocol support"
select ADK_KERNEL_BT_HCIUART
- select ADK_KERNEL_BT_HCIUART_H4
+ select ADK_KERNEL_BT_HCIUART_3WIRE
select ADK_KERNEL_BT_BCM
default y if ADK_TARGET_SYSTEM_RASPBERRY_PI3
depends on ADK_TARGET_SYSTEM_RASPBERRY_PI3