Cleanup Buildroot package for Raspberry Pi Bluetooth support (#1846)
* Replace bluetooth-bcm43xx with pi-bluetooth Buildroot package The new pi-bluetooth packages the scripts and systemd service from the Raspberry distribution package directly: https://github.com/RPi-Distro/pi-bluetooth * Update to latest pi-bluetooth service files * Update busybox configuration to 1.35.0 The new/deleted configurations are generated automatically, no actual change in this patch. * Enable busybox xxd command The xxd tool is useful for conversion in scripts. * Prevent start erros on Compute Module 4 without WiFi/Bluetooth
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
From b74ac4e14e4fcbb76b4cea86573cf602f2b28f8b Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <b74ac4e14e4fcbb76b4cea86573cf602f2b28f8b.1649951264.git.stefan@agner.ch>
|
||||
From: Luca Giovenzana <luca@giovenzana.org>
|
||||
Date: Thu, 14 Apr 2022 14:55:56 +0200
|
||||
Subject: [PATCH] Fix Bluetooth: hci0: Frame reassembly failed (-84)
|
||||
|
||||
Lower UART baudrate to fix Frame reassembly failed (-84) issues.
|
||||
https://github.com/raspberrypi/firmware/issues/1150
|
||||
|
||||
Signed-off-by: Luca Giovenzana <luca@giovenzana.org>
|
||||
---
|
||||
usr/bin/btuart | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usr/bin/btuart b/usr/bin/btuart
|
||||
index 493fd86..cb99a4f 100755
|
||||
--- a/usr/bin/btuart
|
||||
+++ b/usr/bin/btuart
|
||||
@@ -25,7 +25,7 @@ if [ "$uart0" = "$serial1" ] ; then
|
||||
if [ "$uart0_pins" = "16" ] ; then
|
||||
$HCIATTACH /dev/serial1 bcm43xx 3000000 flow - $BDADDR
|
||||
else
|
||||
- $HCIATTACH /dev/serial1 bcm43xx 921600 noflow - $BDADDR
|
||||
+ $HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR
|
||||
fi
|
||||
else
|
||||
$HCIATTACH /dev/serial1 bcm43xx 460800 noflow - $BDADDR
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From 2bfc211b1dc619cce4ea500227576ce1d59c404e Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <2bfc211b1dc619cce4ea500227576ce1d59c404e.1649951264.git.stefan@agner.ch>
|
||||
In-Reply-To: <b74ac4e14e4fcbb76b4cea86573cf602f2b28f8b.1649951264.git.stefan@agner.ch>
|
||||
References: <b74ac4e14e4fcbb76b4cea86573cf602f2b28f8b.1649951264.git.stefan@agner.ch>
|
||||
From: Stefan Agner <stefan@agner.ch>
|
||||
Date: Thu, 14 Apr 2022 15:29:39 +0200
|
||||
Subject: [PATCH] Test if WiFi/Bluetooth module is fitted on Compute Module 4
|
||||
|
||||
Signed-off-by: Stefan Agner <stefan@agner.ch>
|
||||
---
|
||||
usr/bin/btuart | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/usr/bin/btuart b/usr/bin/btuart
|
||||
index cb99a4f..046227c 100755
|
||||
--- a/usr/bin/btuart
|
||||
+++ b/usr/bin/btuart
|
||||
@@ -11,6 +11,15 @@ else
|
||||
BDADDR=`printf b8:27:eb:%02x:%02x:%02x $((0x$B1 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B3 ^ 0xaa))`
|
||||
fi
|
||||
|
||||
+if grep -q "raspberrypi,4-compute-module" /proc/device-tree/compatible; then
|
||||
+ BOARDREV_EXT=$(xxd -p -g4 /proc/device-tree/chosen/rpi-boardrev-ext)
|
||||
+ # Ceck Bit 30: Whether the Compute Module has a WiFi module fitted
|
||||
+ if [ $((16#${BOARDREV_EXT} & 16#40000000)) -gt 0 ]; then
|
||||
+ # No WiFi/Bluetooth
|
||||
+ exit 0
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
# Bail out if the kernel is managing the Bluetooth modem initialisation
|
||||
if ( dmesg | grep -q -E "hci[0-9]+: BCM: chip" ); then
|
||||
# On-board bluetooth is already enabled
|
||||
--
|
||||
2.35.1
|
||||
|
||||
7
buildroot-external/package/pi-bluetooth/Config.in
Normal file
7
buildroot-external/package/pi-bluetooth/Config.in
Normal file
@@ -0,0 +1,7 @@
|
||||
config BR2_PACKAGE_PI_BLUETOOTH
|
||||
bool "Bluetooth scripts for Raspberry Pi"
|
||||
depends on BR2_PACKAGE_BLUEZ5_UTILS_CLIENT
|
||||
depends on BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_BT
|
||||
select BR2_PACKAGE_BLUEZ5_UTILS_DEPRECATED
|
||||
help
|
||||
Install Bluetooth scripts for Raspberry Pi
|
||||
10
buildroot-external/package/pi-bluetooth/bthelper@.service
Normal file
10
buildroot-external/package/pi-bluetooth/bthelper@.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Raspberry Pi bluetooth helper
|
||||
Requires=hciuart.service bluetooth.service
|
||||
After=hciuart.service
|
||||
Before=bluetooth.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/bthelper %I
|
||||
RemainAfterExit=yes
|
||||
11
buildroot-external/package/pi-bluetooth/hciuart.service
Normal file
11
buildroot-external/package/pi-bluetooth/hciuart.service
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Configure Bluetooth Modems connected by UART
|
||||
ConditionFileNotEmpty=/proc/device-tree/soc/gpio@7e200000/bt_pins/brcm,pins
|
||||
After=dev-serial1.device
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/btuart
|
||||
|
||||
[Install]
|
||||
WantedBy=hassos-hardware.target
|
||||
25
buildroot-external/package/pi-bluetooth/pi-bluetooth.mk
Normal file
25
buildroot-external/package/pi-bluetooth/pi-bluetooth.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
################################################################################
|
||||
#
|
||||
# Pi-Bluetooth
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PI_BLUETOOTH_VERSION = 23af66cff597c80523bf9581d7f75d387227f183
|
||||
PI_BLUETOOTH_SITE = $(call github,RPi-Distro,pi-bluetooth,$(PI_BLUETOOTH_VERSION))
|
||||
PI_BLUETOOTH_LICENSE = BSD-3-Clause
|
||||
PI_BLUETOOTH_LICENSE_FILES = debian/copyright
|
||||
|
||||
define PI_BLUETOOTH_INSTALL_TARGET_CMDS
|
||||
$(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/hassos-hardware.target.wants
|
||||
$(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/hciuart.service $(TARGET_DIR)/usr/lib/systemd/system/
|
||||
$(INSTALL) -m 0644 $(BR2_EXTERNAL_HASSOS_PATH)/package/pi-bluetooth/bthelper@.service $(TARGET_DIR)/usr/lib/systemd/system/
|
||||
|
||||
$(INSTALL) -d $(TARGET_DIR)/usr/bin
|
||||
$(INSTALL) -m 0755 $(@D)/usr/bin/btuart $(TARGET_DIR)/usr/bin/
|
||||
$(INSTALL) -m 0755 $(@D)/usr/bin/bthelper $(TARGET_DIR)/usr/bin/
|
||||
|
||||
$(INSTALL) -d $(TARGET_DIR)/usr/lib/udev/rules.d
|
||||
$(INSTALL) -m 0644 $(@D)/lib/udev/rules.d/90-pi-bluetooth.rules $(TARGET_DIR)/usr/lib/udev/rules.d/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user