2020-12-18 20:50:23

by Dave Jones

[permalink] [raw]
Subject: [PATCH v1 0/3] 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(-)

--
2.27.0


2020-12-18 20:50:23

by Dave Jones

[permalink] [raw]
Subject: [PATCH v1 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.

Signed-off-by: Dave Jones <[email protected]>
---
tools/hciattach.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/hciattach.c b/tools/hciattach.c
index 276a4e56e..503f067bc 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 },

--
2.27.0

2020-12-18 20:50:23

by Dave Jones

[permalink] [raw]
Subject: [PATCH v1 3/3] hciattach: Enable loading BCM43xx firmware on RPi

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.

Signed-off-by: Dave Jones <[email protected]>
---
tools/hciattach_bcm43xx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c
index dbb5a3fe3..ddf9b4037 100644
--- a/tools/hciattach_bcm43xx.c
+++ b/tools/hciattach_bcm43xx.c
@@ -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;

--
2.27.0

2020-12-18 20:50:23

by Dave Jones

[permalink] [raw]
Subject: [PATCH v1 2/3] bdaddr: Treat Cypress devices as Broadcom

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.

Signed-off-by: Dave Jones <[email protected]>
---
tools/bdaddr.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/bdaddr.c b/tools/bdaddr.c
index bc0478d46..de17416e9 100644
--- a/tools/bdaddr.c
+++ b/tools/bdaddr.c
@@ -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 },
};

--
2.27.0

2020-12-18 20:52:27

by bluez.test.bot

[permalink] [raw]
Subject: RE: Support patches for Raspberry Pi boards

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