Initial commit
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
From 8e8321cd597d3d9d342a8a3533ad10751dde5885 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 16 Feb 2016 16:40:46 +0000
|
||||
Subject: [PATCH] bcm43xx: Add bcm43xx-3wire variant
|
||||
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
tools/hciattach.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index 276a4e56e..7d01d8b74 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -1078,6 +1078,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 },
|
||||
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
From 96e5e5eef04c6c4ae83d4d822a536cfa87605ae2 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 16 Feb 2016 16:39:09 +0000
|
||||
Subject: [PATCH] bcm43xx: The UART speed must be reset after the firmware
|
||||
download
|
||||
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
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 b89fc1b50..de01a6aea 100644
|
||||
--- a/tools/hciattach_bcm43xx.c
|
||||
+++ b/tools/hciattach_bcm43xx.c
|
||||
@@ -350,11 +350,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;
|
||||
|
||||
@@ -364,6 +361,7 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ sleep(1);
|
||||
if (bcm43xx_reset(fd))
|
||||
return -1;
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
From 05c3e145b5aa62e7e759932ea99f94d495b651c3 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Wed, 20 Jan 2016 16:00:37 +0000
|
||||
Subject: [PATCH] Increase firmware load timeout to 30s
|
||||
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
tools/hciattach.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index 7d01d8b74..465bb17dd 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -1227,7 +1227,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;
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
From 744f894e42d05b1dee917cc221ed3c1815990459 Mon Sep 17 00:00:00 2001
|
||||
From: Phil Elwell <phil@raspberrypi.org>
|
||||
Date: Tue, 23 Feb 2016 17:52:29 +0000
|
||||
Subject: [PATCH] Move the hciattach firmware into /lib/firmware
|
||||
|
||||
* FIRMWARE_DIR is now used by all hciattach firmware (not just bcm43xx) since 5.66 with:
|
||||
commit d9253248363b995e44c1f5e393ed1c7aa4ec81ce
|
||||
Author: Marek Vasut <marex@denx.de>
|
||||
Date: Tue Nov 1 12:53:33 2022 +0100
|
||||
Subject: tools: Make hciattach_* firmware path build-time configurable
|
||||
|
||||
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
tools/hciattach.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hciattach.h b/tools/hciattach.h
|
||||
index dfa4c1e7a..e88484766 100644
|
||||
--- a/tools/hciattach.h
|
||||
+++ b/tools/hciattach.h
|
||||
@@ -41,7 +41,7 @@
|
||||
#define HCI_UART_VND_DETECT 5
|
||||
|
||||
#ifndef FIRMWARE_DIR
|
||||
-#define FIRMWARE_DIR "/etc/firmware"
|
||||
+#define FIRMWARE_DIR "/lib/firmware"
|
||||
#endif
|
||||
|
||||
int read_hci_event(int fd, unsigned char *buf, int size);
|
||||
@@ -0,0 +1,10 @@
|
||||
FILESEXTRAPATHS:prepend:rpi := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI:append:rpi = "\
|
||||
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-hciattach-firmware-into-lib-firmware.patch \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN}:append:rpi = " pi-bluetooth"
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
From a73bbed89fb049ac424c211629935b26013e2573 Mon Sep 17 00:00:00 2001
|
||||
From: "Peter A. Bigot" <pab@pabigot.com>
|
||||
Date: Wed, 14 Nov 2018 09:19:51 -0600
|
||||
Subject: [PATCH] bthelper: correct path for hciconfig under Yocto
|
||||
|
||||
Upstream-Status: Inappropriate [OE-specific]
|
||||
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
|
||||
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
|
||||
|
||||
---
|
||||
usr/bin/bthelper | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/usr/bin/bthelper b/usr/bin/bthelper
|
||||
index 2133fbc..1fc9245 100755
|
||||
--- a/usr/bin/bthelper
|
||||
+++ b/usr/bin/bthelper
|
||||
@@ -12,8 +12,8 @@ fi
|
||||
dev=$1
|
||||
|
||||
# Need to bring hci up before looking at MAC as it can be all zeros during init
|
||||
-/bin/hciconfig $dev up
|
||||
-if ! /bin/hciconfig $dev | grep -q "Bus: UART"; then
|
||||
+/usr/bin/hciconfig $dev up
|
||||
+if ! /usr/bin/hciconfig $dev | grep -q "Bus: UART"; then
|
||||
echo Not a UART-attached BT Modem
|
||||
exit 0
|
||||
fi
|
||||
@@ -26,7 +26,7 @@ if ( /usr/bin/hcitool -i $dev dev | grep -q -E '\s43:4[35]:' ); then
|
||||
BDADDR=`printf '0x%02x 0x%02x 0x%02x 0xeb 0x27 0xb8' $((0x$B3 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B1 ^ 0xaa))`
|
||||
|
||||
/usr/bin/hcitool -i $dev cmd 0x3f 0x001 $BDADDR
|
||||
- /bin/hciconfig $dev reset
|
||||
+ /usr/bin/hciconfig $dev reset
|
||||
else
|
||||
echo Raspberry Pi BDADDR already set
|
||||
fi
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
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;branch=master;protocol=https \
|
||||
file://0001-bthelper-correct-path-for-hciconfig-under-Yocto.patch \
|
||||
"
|
||||
SRCREV = "fd4775bf90e037551532fc214a958074830bb80d"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', 'update-rc.d', d)}
|
||||
# hciuart.service replaces what was brcm43438.service
|
||||
SYSTEMD_SERVICE:${PN} = "\
|
||||
hciuart.service \
|
||||
bthelper@.service \
|
||||
"
|
||||
INITSCRIPT_NAME = "btuart"
|
||||
INITSCRIPT_PARAMS = "start 18 2 3 4 5 ."
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sysconfdir}/udev/rules.d
|
||||
install -m 0644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/udev/rules.d
|
||||
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 ${S}/usr/bin/bthelper ${D}${bindir}
|
||||
install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
install -d ${D}${systemd_system_unitdir}
|
||||
install -m 0644 ${S}/debian/pi-bluetooth.bthelper@.service ${D}${systemd_system_unitdir}/bthelper@.service
|
||||
install -m 0644 ${S}/debian/pi-bluetooth.hciuart.service ${D}${systemd_system_unitdir}/hciuart.service
|
||||
else
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
cat > ${WORKDIR}/btuart.init << EOF
|
||||
#!/bin/sh
|
||||
/usr/bin/btuart
|
||||
EOF
|
||||
install -m 0755 ${WORKDIR}/btuart.init ${D}${sysconfdir}/init.d/btuart
|
||||
sed -i -e 's:TAG+="systemd".*$:RUN+="/usr/bin/bthelper %k":' ${D}${sysconfdir}/udev/rules.d/90-pi-bluetooth.rules
|
||||
fi
|
||||
}
|
||||
|
||||
FILES:${PN} = "\
|
||||
${bindir} \
|
||||
${sysconfdir} \
|
||||
${systemd_unitdir}/system \
|
||||
"
|
||||
|
||||
RDEPENDS:${PN} += " \
|
||||
udev-rules-rpi \
|
||||
"
|
||||
Reference in New Issue
Block a user