Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Enable bluetooth on BeagleV-Ahead
@ 2026-11-30 15:20 Thomas Gerner
  2026-11-30 15:20 ` [PATCH v3 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead Thomas Gerner
  2026-11-30 15:20 ` [PATCH v3 2/2] riscv: dts: thead: Bluetooth: Enable bt " Thomas Gerner
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Gerner @ 2026-11-30 15:20 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Drew Fustini, Guo Ren,
	Fu Wei, Rob Herring, Krzysztof Kozlowski
  Cc: Thomas Gerner, Conor Dooley, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Alexandre Ghiti, linux-bluetooth, linux-kernel,
	linux-riscv, devicetree

The single board system BeagleV-Ahead uses a Ampak AP6203BM chip for wifi
and bluetooth. Wifi is already enabled for this board. The bluetooth
module of the chip connects by UART and PCM to the TH1520 SOC. The PCM
interface is currently not used because of missing I2S drivers for the
SOC and may be added with a later patch.

This patch set enables bluetooth.

The patch to the bluetooth driver btbcm.c prevents the error message

Bluetooth: hci0: unexpected cc 0x204b length: 1 < 3
Bluetooth: hci0: Opcode 0x204b failed: -38

printed by the hci driver which prevents bluetooth from successful
initializing.

The patch to th1520-beaglev-ahead.dts adds the bluetooth module to the
BeagleV-Ahead device tree.

Thomas Gerner (2):
  Bluetooth: btbcm: disable read tx power for BeagleV-Ahead
  riscv: dts: thead: Bluetooth: Enable bt on BeagleV-Ahead

 .../boot/dts/thead/th1520-beaglev-ahead.dts   | 84 +++++++++++++++++++
 drivers/bluetooth/btbcm.c                     |  9 ++
 2 files changed, 93 insertions(+)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v2 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead
@ 2026-10-20 13:26 Thomas Gerner
  2026-10-20 17:46 ` Enable bluetooth on BeagleV-Ahead bluez.test.bot
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gerner @ 2026-10-20 13:26 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Drew Fustini, Guo Ren,
	Fu Wei, Rob Herring, Krzysztof Kozlowski
  Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, linux-bluetooth, linux-kernel, linux-riscv,
	devicetree, Thomas Gerner

The bluetooth module of the Ampak AP6203BM is identified by the btbcm
driver as BCM4362A2.

The firmware of the bluetooth module on the BeagleV-Ahead reports a
capability of reading LE tx power. However reading fails. To get
bluetooth working it is necessary to disable reading of LE tx power on
the BeagleV-Ahead board. The disable is implemented in a similar way as
for several Apple boards but uses the board compatible identification
from the DTB as there is no DMI.

Signed-off-by: Thomas Gerner <thomas.gerner@muenchen-mail.de>
---
No changes in v2

 drivers/bluetooth/btbcm.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 463d59890bef..2d02cc1863d0 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -436,6 +436,11 @@ static const struct dmi_system_id disable_broken_read_transmit_power[] = {
 	{ }
 };
 
+static const char *board_broken_read_transmit_power[] __maybe_unused = {
+	"beagle,beaglev-ahead",
+	NULL
+};
+
 static int btbcm_read_info(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
@@ -537,12 +542,13 @@ static const struct bcm_subver_table bcm_usb_subver_table[] = {
  * This currently only looks up the device tree board appendix,
  * but can be expanded to other mechanisms.
  */
-static const char *btbcm_get_board_name(struct device *dev)
+static const char *btbcm_get_board_name(struct hci_dev *hdev)
 {
 #ifdef CONFIG_OF
 	struct device_node *root __free(device_node) = of_find_node_by_path("/");
 	char *board_type;
 	const char *tmp;
+	const char **s;
 
 	if (!root)
 		return NULL;
@@ -550,8 +556,15 @@ static const char *btbcm_get_board_name(struct device *dev)
 	if (of_property_read_string_index(root, "compatible", 0, &tmp))
 		return NULL;
 
+	/* disable broken Read LE Min/Max Tx Power on first board found in list */
+	for (s = board_broken_read_transmit_power; *s; s++)
+		if (!strcmp(tmp, *s)) {
+			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
+			break;
+		}
+
 	/* get rid of any '/' in the compatible string */
-	board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
+	board_type = devm_kstrdup(&hdev->dev, tmp, GFP_KERNEL);
 	if (!board_type)
 		return NULL;
 
@@ -577,7 +590,7 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud
 	const struct firmware *fw;
 	int i, err;
 
-	board_name = btbcm_get_board_name(&hdev->dev);
+	board_name = btbcm_get_board_name(hdev);
 
 	/* Reset */
 	err = btbcm_reset(hdev);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH 2/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead
@ 2026-10-11 13:37 Thomas Gerner
  2026-10-11 19:08 ` Enable bluetooth on BeagleV-Ahead bluez.test.bot
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gerner @ 2026-10-11 13:37 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Drew Fustini, Guo Ren,
	Fu Wei, Rob Herring, Krzysztof Kozlowski
  Cc: Conor Dooley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	Alexandre Ghiti, linux-bluetooth, linux-kernel, linux-riscv,
	devicetree, Thomas Gerner

The bluetooth module of the Ampak AP6203BM is identified by the btbcm
driver as BCM4362A2.

The firmware of the bluetooth module on the BeagleV-Ahead reports a
capability of reading LE tx power. However reading fails. To get
bluetooth working it is necessary to disable reading of LE tx power on
the BeagleV-Ahead board. The disable is implemented in a similar way as
for several Apple boards but uses the board compatible identification
from the DTB as there is no DMI.

Signed-off-by: Thomas Gerner <thomas.gerner@muenchen-mail.de>
---
 drivers/bluetooth/btbcm.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index 463d59890bef..2d02cc1863d0 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -436,6 +436,11 @@ static const struct dmi_system_id disable_broken_read_transmit_power[] = {
 	{ }
 };
 
+static const char *board_broken_read_transmit_power[] __maybe_unused = {
+	"beagle,beaglev-ahead",
+	NULL
+};
+
 static int btbcm_read_info(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
@@ -537,12 +542,13 @@ static const struct bcm_subver_table bcm_usb_subver_table[] = {
  * This currently only looks up the device tree board appendix,
  * but can be expanded to other mechanisms.
  */
-static const char *btbcm_get_board_name(struct device *dev)
+static const char *btbcm_get_board_name(struct hci_dev *hdev)
 {
 #ifdef CONFIG_OF
 	struct device_node *root __free(device_node) = of_find_node_by_path("/");
 	char *board_type;
 	const char *tmp;
+	const char **s;
 
 	if (!root)
 		return NULL;
@@ -550,8 +556,15 @@ static const char *btbcm_get_board_name(struct device *dev)
 	if (of_property_read_string_index(root, "compatible", 0, &tmp))
 		return NULL;
 
+	/* disable broken Read LE Min/Max Tx Power on first board found in list */
+	for (s = board_broken_read_transmit_power; *s; s++)
+		if (!strcmp(tmp, *s)) {
+			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
+			break;
+		}
+
 	/* get rid of any '/' in the compatible string */
-	board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
+	board_type = devm_kstrdup(&hdev->dev, tmp, GFP_KERNEL);
 	if (!board_type)
 		return NULL;
 
@@ -577,7 +590,7 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud
 	const struct firmware *fw;
 	int i, err;
 
-	board_name = btbcm_get_board_name(&hdev->dev);
+	board_name = btbcm_get_board_name(hdev);
 
 	/* Reset */
 	err = btbcm_reset(hdev);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-30 16:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 15:20 [PATCH v3 0/2] Enable bluetooth on BeagleV-Ahead Thomas Gerner
2026-11-30 15:20 ` [PATCH v3 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead Thomas Gerner
2026-11-30 16:31   ` Enable bluetooth on BeagleV-Ahead bluez.test.bot
2026-11-30 15:20 ` [PATCH v3 2/2] riscv: dts: thead: Bluetooth: Enable bt " Thomas Gerner
  -- strict thread matches above, loose matches on Subject: below --
2026-10-20 13:26 [PATCH v2 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead Thomas Gerner
2026-10-20 17:46 ` Enable bluetooth on BeagleV-Ahead bluez.test.bot
2026-10-11 13:37 [PATCH 2/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead Thomas Gerner
2026-10-11 19:08 ` Enable bluetooth on BeagleV-Ahead bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox