mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Bluetooth for the RTL8852BS on BPI-F3
@ 2026-11-11  9:45 Frédéric Mahé
  2026-11-11  9:45 ` [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS Frédéric Mahé
  2026-11-11  9:45 ` [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3 Frédéric Mahé
  0 siblings, 2 replies; 5+ messages in thread
From: Frédéric Mahé @ 2026-11-11  9:45 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan
  Cc: Vasily Khoruzhick, Alistair Francis, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	linux-bluetooth, devicetree, linux-riscv, spacemit, linux-kernel,
	Frédéric Mahé

The BPI-F3 (SpacemiT K1) carries an RTL8852BS Wi-Fi + Bluetooth module.
Wi-Fi (SDIO) has no upstream driver, but Bluetooth on UART works with
the existing hci_h5/btrtl code and linux-firmware's rtl8852bs files.

Patch 1 documents the compatible, with rtl8822cs-bt as fallback, so no
driver change is needed. Patch 2 enables it on the BPI-F3.

GPIO usage was tested one line at a time: GPIO 63 is the power/enable
line and GPIO 64 the device wake line. The vendor DT also drives
GPIO 65 and GPIO 67; Bluetooth works without them (and RSSI is the
same with GPIO 67 high or low), so they are left out.

Changes in v2:
- Patch 2: set slow_uart2 to 48 MHz with assigned-clock-rates instead
  of relying on the bootloader (Troy). Checked that a 24 MHz setting
  is applied, then 48 MHz.
- Patch 1: add Conor's Acked-by and Alistair's Reviewed-by.

Link to v1: https://lore.kernel.org/r/20261110074607.363918-1-frederic.mahe@cirad.fr

Frédéric Mahé (2):
  dt-bindings: net: bluetooth: realtek: Add RTL8852BS
  riscv: dts: spacemit: enable Bluetooth on BPI-F3

 .../net/bluetooth/realtek,bluetooth.yaml        | 11 +++++++----
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.47.3


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

* [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS
  2026-11-11  9:45 [PATCH v2 0/2] Bluetooth for the RTL8852BS on BPI-F3 Frédéric Mahé
@ 2026-11-11  9:45 ` Frédéric Mahé
  2026-11-11  9:51   ` Troy Mitchell
  2026-11-11  9:45 ` [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3 Frédéric Mahé
  1 sibling, 1 reply; 5+ messages in thread
From: Frédéric Mahé @ 2026-11-11  9:45 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan
  Cc: Vasily Khoruzhick, Alistair Francis, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	linux-bluetooth, devicetree, linux-riscv, spacemit, linux-kernel,
	Frédéric Mahé,
	Conor Dooley

The RTL8852BS is a Wi-Fi 6 + Bluetooth 5.2 chip with Wi-Fi on SDIO
and Bluetooth on UART (H5). Its Bluetooth part works with the
RTL8822CS driver data, so use realtek,rtl8822cs-bt as fallback.

This patch was prepared with the help of an AI assistant (Claude),
which also ran the tests.

Signed-off-by: Frédéric Mahé <frederic.mahe@cirad.fr>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
---
 .../bindings/net/bluetooth/realtek,bluetooth.yaml     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/bluetooth/realtek,bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/realtek,bluetooth.yaml
index 7d567122b..ffdf13b05 100644
--- a/Documentation/devicetree/bindings/net/bluetooth/realtek,bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/bluetooth/realtek,bluetooth.yaml
@@ -4,16 +4,16 @@
 $id: http://devicetree.org/schemas/net/bluetooth/realtek,bluetooth.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
+title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS/RTL8852BS Bluetooth
 
 maintainers:
   - Vasily Khoruzhick <anarsoul@gmail.com>
   - Alistair Francis <alistair@alistair23.me>
 
 description:
-  RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
-  is connected over SDIO, while BT is connected over serial. It speaks
-  H5 protocol with few extra commands to upload firmware and change
+  RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS/RTL8852BS is a WiFi + BT chip.
+  WiFi part is connected over SDIO, while BT is connected over serial. It
+  speaks H5 protocol with few extra commands to upload firmware and change
   module speed.
 
 properties:
@@ -28,6 +28,9 @@ properties:
           - enum:
               - realtek,rtl8821cs-bt
           - const: realtek,rtl8723bs-bt
+      - items:
+          - const: realtek,rtl8852bs-bt
+          - const: realtek,rtl8822cs-bt
 
   device-wake-gpios:
     maxItems: 1
-- 
2.47.3


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

* [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3
  2026-11-11  9:45 [PATCH v2 0/2] Bluetooth for the RTL8852BS on BPI-F3 Frédéric Mahé
  2026-11-11  9:45 ` [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS Frédéric Mahé
@ 2026-11-11  9:45 ` Frédéric Mahé
  2026-11-11  9:52   ` Troy Mitchell
  1 sibling, 1 reply; 5+ messages in thread
From: Frédéric Mahé @ 2026-11-11  9:45 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan
  Cc: Vasily Khoruzhick, Alistair Francis, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	linux-bluetooth, devicetree, linux-riscv, spacemit, linux-kernel,
	Frédéric Mahé

The BPI-F3 has an RTL8852BS module whose Bluetooth part is on UART2,
with hardware flow control. GPIO 63 powers Bluetooth on and GPIO 64
is the device wake line.

The firmware config switches the UART to 1.5 Mbaud, so take the UART2
clock from slow_uart2, set to 48 MHz.

Tested with a laptop: scan, pairing, and l2ping in both directions,
including incoming connections while the UART is runtime suspended.
An 8-hour soak (an HCI command every 20 s) showed no errors.

This patch was prepared with the help of an AI assistant (Claude),
which also ran the tests.

Signed-off-by: Frédéric Mahé <frederic.mahe@cirad.fr>
---
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 58035d886..ed6d4b7f4 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -383,6 +383,23 @@ &uart0 {
 	status = "okay";
 };
 
+&uart2 {
+	assigned-clocks = <&syscon_apbc CLK_UART2>,
+			  <&syscon_mpmu CLK_SLOW_UART2>;
+	assigned-clock-parents = <&syscon_mpmu CLK_SLOW_UART2>;
+	assigned-clock-rates = <0>, <48000000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_0_cfg>, <&uart2_0_cts_rts_cfg>;
+	uart-has-rtscts;
+	status = "okay";
+
+	bluetooth {
+		compatible = "realtek,rtl8852bs-bt", "realtek,rtl8822cs-bt";
+		enable-gpios = <&gpio K1_GPIO(63) GPIO_ACTIVE_HIGH>;
+		device-wake-gpios = <&gpio K1_GPIO(64) GPIO_ACTIVE_HIGH>;
+	};
+};
+
 &usbphy2 {
 	status = "okay";
 };
-- 
2.47.3


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

* Re: [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS
  2026-11-11  9:45 ` [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS Frédéric Mahé
@ 2026-11-11  9:51   ` Troy Mitchell
  0 siblings, 0 replies; 5+ messages in thread
From: Troy Mitchell @ 2026-11-11  9:51 UTC (permalink / raw)
  To: Frédéric Mahé,
	Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan
  Cc: Vasily Khoruzhick, Alistair Francis, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	linux-bluetooth, devicetree, linux-riscv, spacemit, linux-kernel,
	Conor Dooley

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

On Wed Nov 11, 2026 at 9:45 AM GMT, Frédéric Mahé wrote:
> The RTL8852BS is a Wi-Fi 6 + Bluetooth 5.2 chip with Wi-Fi on SDIO
> and Bluetooth on UART (H5). Its Bluetooth part works with the
> RTL8822CS driver data, so use realtek,rtl8822cs-bt as fallback.
>
> This patch was prepared with the help of an AI assistant (Claude),
> which also ran the tests.
>
> Signed-off-by: Frédéric Mahé <frederic.mahe@cirad.fr>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Reviewed-by: Alistair Francis <alistair@alistair23.me>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>


-- 
Troy Mitchell


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

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

* Re: [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3
  2026-11-11  9:45 ` [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3 Frédéric Mahé
@ 2026-11-11  9:52   ` Troy Mitchell
  0 siblings, 0 replies; 5+ messages in thread
From: Troy Mitchell @ 2026-11-11  9:52 UTC (permalink / raw)
  To: Frédéric Mahé,
	Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Yixun Lan
  Cc: Vasily Khoruzhick, Alistair Francis, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Troy Mitchell,
	linux-bluetooth, devicetree, linux-riscv, spacemit, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On Wed Nov 11, 2026 at 9:45 AM GMT, Frédéric Mahé wrote:
> The BPI-F3 has an RTL8852BS module whose Bluetooth part is on UART2,
> with hardware flow control. GPIO 63 powers Bluetooth on and GPIO 64
> is the device wake line.
>
> The firmware config switches the UART to 1.5 Mbaud, so take the UART2
> clock from slow_uart2, set to 48 MHz.
>
> Tested with a laptop: scan, pairing, and l2ping in both directions,
> including incoming connections while the UART is runtime suspended.
> An 8-hour soak (an HCI command every 20 s) showed no errors.
>
> This patch was prepared with the help of an AI assistant (Claude),
> which also ran the tests.
>
> Signed-off-by: Frédéric Mahé <frederic.mahe@cirad.fr>
Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>


-- 
Troy Mitchell


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

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

end of thread, other threads:[~2026-11-11  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11  9:45 [PATCH v2 0/2] Bluetooth for the RTL8852BS on BPI-F3 Frédéric Mahé
2026-11-11  9:45 ` [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS Frédéric Mahé
2026-11-11  9:51   ` Troy Mitchell
2026-11-11  9:45 ` [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3 Frédéric Mahé
2026-11-11  9:52   ` Troy Mitchell

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

all inboxes | Powered by JetHome®