summaryrefslogtreecommitdiffstats
path: root/meta-raspberrypi/recipes-connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'meta-raspberrypi/recipes-connectivity')
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0001-bcm43xx-Add-bcm43xx-3wire-variant.patch26
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch37
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0003-Increase-firmware-load-timeout-to-30s.patch25
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0004-Move-the-43xx-firmware-into-lib-firmware.patch25
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5/brcm43438.service14
-rw-r--r--meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend45
-rw-r--r--meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb22
7 files changed, 194 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0001-bcm43xx-Add-bcm43xx-3wire-variant.patch b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0001-bcm43xx-Add-bcm43xx-3wire-variant.patch
new file mode 100644
index 000000000..3bc02c49e
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0001-bcm43xx-Add-bcm43xx-3wire-variant.patch
@@ -0,0 +1,26 @@
+From b4f2b77472aeb967d3a7595e8a965785c7a37c87 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 16 Feb 2016 16:40:46 +0000
+Subject: [PATCH 1/4] bcm43xx: Add bcm43xx-3wire variant
+
+---
+ tools/hciattach.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tools/hciattach.c b/tools/hciattach.c
+index 59a76a7..5861d33 100644
+--- a/tools/hciattach.c
++++ b/tools/hciattach.c
+@@ -1144,6 +1144,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 },
+
+--
+1.9.1
+
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
new file mode 100644
index 000000000..5a0a434a3
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
@@ -0,0 +1,37 @@
+From e145c9621f976063e5c573db1f2053d906f63427 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 16 Feb 2016 16:39:09 +0000
+Subject: [PATCH 2/4] bcm43xx: The UART speed must be reset after the firmware download
+
+---
+ tools/hciattach_bcm43xx.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
+index 81f38cb..0b792e0 100644
+--- a/tools/hciattach_bcm43xx.c
++++ b/tools/hciattach_bcm43xx.c
+@@ -366,11 +366,8 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
+ 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, int speed, struct termios *ti,
+ return -1;
+ }
+
++ sleep(1);
+ if (bcm43xx_reset(fd))
+ return -1;
+ }
+--
+1.9.1
+
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0003-Increase-firmware-load-timeout-to-30s.patch b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0003-Increase-firmware-load-timeout-to-30s.patch
new file mode 100644
index 000000000..f9f09ebb0
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0003-Increase-firmware-load-timeout-to-30s.patch
@@ -0,0 +1,25 @@
+From d41dc2046dd08d8c95197f677e224506f5b39bdd Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Wed, 20 Jan 2016 16:00:37 +0000
+Subject: [PATCH 3/4] Increase firmware load timeout to 30s
+
+---
+ tools/hciattach.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/hciattach.c b/tools/hciattach.c
+index 5861d33..4141796 100644
+--- a/tools/hciattach.c
++++ b/tools/hciattach.c
+@@ -1293,7 +1293,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;
+--
+1.9.1
+
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0004-Move-the-43xx-firmware-into-lib-firmware.patch b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0004-Move-the-43xx-firmware-into-lib-firmware.patch
new file mode 100644
index 000000000..dadce354e
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/0004-Move-the-43xx-firmware-into-lib-firmware.patch
@@ -0,0 +1,25 @@
+From 76681284b0ea49852041fdb97a35175089a08781 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 23 Feb 2016 17:52:29 +0000
+Subject: [PATCH 4/4] Move the 43xx firmware into /lib/firmware
+
+---
+ tools/hciattach_bcm43xx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
+index 0b792e0..207f668 100644
+--- a/tools/hciattach_bcm43xx.c
++++ b/tools/hciattach_bcm43xx.c
+@@ -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"
+--
+1.9.1
+
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/brcm43438.service b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/brcm43438.service
new file mode 100644
index 000000000..a51f6bcbc
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5/brcm43438.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Broadcom BCM43438 bluetooth HCI
+ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
+Before=bluetooth.service
+BindsTo=dev-serial1.device
+After=dev-serial1.device
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/btuart
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend
new file mode 100644
index 000000000..d1b84df43
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/bluez5/bluez5_%.bbappend
@@ -0,0 +1,45 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+BCM_BT_SOURCES = " \
+ file://0001-bcm43xx-Add-bcm43xx-3wire-variant.patch \
+ file://0002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch \
+ file://0003-Increase-firmware-load-timeout-to-30s.patch \
+ file://0004-Move-the-43xx-firmware-into-lib-firmware.patch \
+ file://brcm43438.service \
+ "
+
+BCM_BT_SERVICE = "brcm43438.service"
+
+enable_bcm_bluetooth() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/${BCM_BT_SERVICE} ${D}${systemd_unitdir}/system
+ fi
+}
+
+BCM_BT_RDEPENDS = "\
+ udev-rules-rpi \
+ pi-bluetooth \
+"
+
+# for raspberrypi3
+SRC_URI_append_raspberrypi3 = " ${BCM_BT_SOURCES}"
+
+do_install_append_raspberrypi3() {
+ enable_bcm_bluetooth
+}
+
+SYSTEMD_SERVICE_${PN}_append_raspberrypi3 = " ${BCM_BT_SERVICE}"
+
+RDEPENDS_${PN}_append_raspberrypi3 = " ${BCM_BT_RDEPENDS}"
+
+# for raspberrypi0-wifi
+SRC_URI_append_raspberrypi0-wifi = " ${BCM_BT_SOURCES}"
+
+do_install_append_raspberrypi0-wifi() {
+ enable_bcm_bluetooth
+}
+
+SYSTEMD_SERVICE_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_SERVICE}"
+
+RDEPENDS_${PN}_append_raspberrypi0-wifi = " ${BCM_BT_RDEPENDS}"
diff --git a/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb
new file mode 100644
index 000000000..e185f25e2
--- /dev/null
+++ b/meta-raspberrypi/recipes-connectivity/pi-bluetooth/pi-bluetooth.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi"
+HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth"
+SECTION = "kernel"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "\
+ file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \
+"
+
+SRC_URI = "git://github.com/RPi-Distro/pi-bluetooth"
+SRCREV = "2a7477966bb3c69838b224f3ea92cb49a88124d5"
+UPSTREAM_VERSION_UNKNOWN = "1"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
+}
+
+FILES_${PN} = "${bindir}"
OpenPOWER on IntegriCloud