Bluetooth for the RTL8852BS on BPI-F3
v2 cover Bluetooth for the RTL8852BS on BPI-F3
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/[email protected]
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
Signature · 1 line
2.47.3
PATCH v2 1/2 dt-bindings: net: bluetooth: realtek: Add RTL8852BS
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.
--- .../bindings/net/bluetooth/realtek,bluetooth.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/net/bluetooth/realtek,bluetooth.yaml +7 -4
@@ -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 <[email protected]> - Alistair Francis <[email protected]> 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
Signature · 1 line
2.47.3
Re: [PATCH v2 1/2] dt-bindings: net: bluetooth: realtek: Add RTL8852BS
Quoted 10 lines · Frédéric Mahé
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é <[email protected]>Acked-by Conor Dooley <[email protected]>Reviewed-by Alistair Francis <[email protected]>
Signature · 1 line
Troy Mitchell
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
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/series/1208172/
---Test result---
Test Summary:
CheckPatch PASS 3.16 seconds VerifyFixes PASS 0.19 seconds VerifySignedoff PASS 0.13 seconds GitLint PASS 0.72 seconds SubjectPrefix FAIL 2.07 seconds BuildKernel PASS 31.26 seconds CheckAllWarning PASS 35.70 seconds CheckSparse PASS 38.72 seconds BuildKernel32 PASS 31.87 seconds CheckKernelLLVM PASS 44.79 seconds TestRunnerSetup PASS 757.58 seconds TestRunner_l2cap-tester PASS 13.58 seconds TestRunner_iso-tester PASS 13.04 seconds TestRunner_bnep-tester PASS 3.20 seconds TestRunner_mgmt-tester PASS 90.32 seconds TestRunner_rfcomm-tester PASS 5.73 seconds TestRunner_sco-tester PASS 6.18 seconds TestRunner_ioctl-tester PASS 17.20 seconds TestRunner_mesh-tester PASS 7.54 seconds TestRunner_smp-tester PASS 7.40 seconds TestRunner_userchan-tester PASS 4.28 seconds TestRunner_6lowpan-tester PASS 4.58 seconds IncrementalBuild PASS 30.54 seconds
Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix Output:
"Bluetooth: " prefix is not specified in the subject "Bluetooth: " prefix is not specified in the subject
https://github.com/bluez/bluetooth-next/pull/1110
---
Regards,
Linux Bluetooth
PATCH v2 2/2 riscv: dts: spacemit: enable Bluetooth on BPI-F3
In reply to 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.
--- arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts +17 -0
@@ -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"; };
Signature · 1 line
2.47.3
Re: [PATCH v2 2/2] riscv: dts: spacemit: enable Bluetooth on BPI-F3
Quoted 7 lines · 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.
Quoted 8 lines
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é <[email protected]>
Signature · 1 line
Troy Mitchell
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv