Skip to contentSkip to conversation

Support patches for Raspberry Pi boards

PATCH In review Dave Jones 2 participants 5 messages Dec 18, 2020 Bluetooth drivers

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

cover Support patches for Raspberry Pi boards

These patches are derived from Raspbian's bluez variant and implement support for the Bluetooth modules found in the Raspberry Pi boards up to and including the Pi 400, and the two UARTs that can be used to communicate with them.

If these would be better submitted as individual threads, or as a single monolithic patch, please let me know - I'm happy to revise things!

Dave Jones (3):
hciattach: Add BCM43xx 3-wire variant
bdaddr: Treat Cypress devices as Broadcom
hciattach: Enable loading BCM43xx firmware on RPi

 tools/bdaddr.c            | 1 +
 tools/hciattach.c         | 3 +++
 tools/hciattach_bcm43xx.c | 5 +----
 3 files changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.27.0
author
#1 lore raw

PATCH 1/3 hciattach: Add BCM43xx 3-wire variant

Adds the bcm43xx-3wire variant to the hciattach tool; this is for use when the Raspberry Pi's mini-UART (which lacks flow-control) is used instead of the PL011 UART to drive the bluetooth module.

---
 tools/hciattach.c | 3 +++
 1 file changed, 3 insertions(+)
tools/hciattach.c +3 -0
index 276a4e56e..503f067bc 100644
@@ -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  },
 
Signature · 1 line
2.27.0
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=404253

---Test result---

##############################
Test: CheckPatch - PASS

##############################
Test: CheckGitLint - PASS

##############################
Test: CheckBuild - PASS

##############################
Test: MakeCheck - PASS

---
Regards,
Linux Bluetooth

author
#3 lore raw

PATCH 2/3 bdaddr: Treat Cypress devices as Broadcom

In reply to Dave Jones

Adds an entry to cause bdaddr to treat Cypress Semiconductor devices as Broadcom devices; Cypress (vendor ID 305) acquired Broadcom's (vendor ID
15) wireless division in 2016.

---
 tools/bdaddr.c | 1 +
 1 file changed, 1 insertion(+)
tools/bdaddr.c +1 -0
index bc0478d46..de17416e9 100644
@@ -303,6 +303,7 @@ static struct {
 	{ 48,		st_write_bd_addr,	generic_reset_device	},
 	{ 57,		ericsson_write_bd_addr,	generic_reset_device	},
 	{ 72,		mrvl_write_bd_addr,	generic_reset_device	},
+	{ 305,		bcm_write_bd_addr,	generic_reset_device	},
 	{ 65535,	NULL,			NULL			},
 };
 
Signature · 1 line
2.27.0
author
#4 lore raw

PATCH 3/3 hciattach: Enable loading BCM43xx firmware on RPi

In reply to Dave Jones

Corrects the location of the firmware from /etc/firmware to /lib/firmware, and disables setting the UART interface speed prior to loading the firmware. An already existing later call to bcm43xx_set_speed still sets the speed of the interface as requested.

For certain bluetooth devices, in particular that on the Raspberry Pi 400, setting the UART speed prior to loading the firmware causes the firmware load to fail.

---
 tools/hciattach_bcm43xx.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
tools/hciattach_bcm43xx.c +1 -4
index dbb5a3fe3..ddf9b4037 100644
@@ -31,7 +31,7 @@
 #include "hciattach.h"
 
 #ifndef FIRMWARE_DIR
-#define FIRMWARE_DIR "/etc/firmware"
+#define FIRMWARE_DIR "/lib/firmware"
 #endif
 
 #define FW_EXT ".hcd"
@@ -356,9 +356,6 @@ int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
 	if (bcm43xx_locate_patch(FIRMWARE_DIR, chip_name, fw_path)) {
 		fprintf(stderr, "Patch not found, continue anyway\n");
 	} else {
-		if (bcm43xx_set_speed(fd, ti, speed))
-			return -1;
-
 		if (bcm43xx_load_firmware(fd, fw_path))
 			return -1;
 
Signature · 1 line
2.27.0