Skip to content

Conversation

@BluezTestBot
Copy link
Owner

Realtek updated its Bluetooth firmware format to v3.
This patch extends the btrtl driver to recognise and parse the new v3 file
format, including:

  • New signature string and image ID definitions
  • Extension of btrtl_device_info to store v3-specific metadata
  • Logic to extract and load firmware data out of v3 images
  • Maintains compatibility with existing v2 firmware format

This is required for future Realtek Bluetooth chips that ship with
v3 firmware.
The RTL8922D is the first IC to use firmware format V3, so the following
example uses the RTL8922D's log as expected fw format v3 output:

Bluetooth: btrtl_read_chip_id() hci0: RTL: chip_id status=0x00 id=0x37
Bluetooth: btrtl_initialize() hci0: RTL: examining hci_ver=0d hci_rev=000d lmp_ver=0d lmp_subver=8922
Bluetooth: rtl_read_rom_version() hci0: RTL: rom_version status=0 version=1
Bluetooth: btrtl_initialize() hci0: RTL: btrtl_initialize: key id 0
Bluetooth: rtl_load_file() hci0: RTL: loading rtl_bt/rtl8922du_fw.bin
Bluetooth: rtl_load_file() hci0: RTL: loading rtl_bt/rtl8922du_config.bin
Bluetooth: rtlbt_parse_firmware_v3() hci0: RTL: key id 0
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image (f000:00), chip id 55, cut 0x02, len 00007185
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image version: 35fd7908
Bluetooth: rtlbt_parse_config() hci0: RTL: config file: rtl_bt/rtl8922du_config_f000.bin
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image (f002:00), chip id 55, cut 0x02, len 000078f5
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image version: 47b6874d
Bluetooth: rtlbt_parse_config() hci0: RTL: config file: rtl_bt/rtl8922du_config_f002.bin
Bluetooth: rtlbt_parse_firmware_v3() hci0: RTL: image payload total len: 0x0000ea7a
Bluetooth: rtl_finalize_download() hci0: RTL: Watchdog reset status 00
Bluetooth: rtl_finalize_download() hci0: RTL: fw version 0x47b6874d

Signed-off-by: Alex Lu alex_lu@realsil.com.cn
Signed-off-by: Zoey Zhou zoey_zhou@realsil.com.cn
Signed-off-by: Hilda Wu hildawu@realtek.com


Change in V5:

  • Independent support for 8922D section
  • Define relevant macros to increase readability
  • Added format v3 description and differences
  • Adjust according to the recommendations

Change in V4:

  • Modify access to skb->data and add descriptions
  • Fix hidden issues

Change in V3:

  • Fixed cocci warning

Change in V2:

  • Fill in the missing symbols
  • Fix build warnings

drivers/bluetooth/btrtl.c | 698 +++++++++++++++++++++++++++++++++++++-
drivers/bluetooth/btrtl.h | 102 ++++++
drivers/bluetooth/btusb.c | 3 +
3 files changed, 786 insertions(+), 17 deletions(-)

tedd-an and others added 4 commits December 9, 2025 21:50
This patch adds workflow files for ci:

[sync.yml]
 - The workflow file for scheduled work
 - Sync the repo with upstream repo and rebase the workflow branch
 - Review the patches in the patchwork and creates the PR if needed

[ci.yml]
 - The workflow file for CI tasks
 - Run CI tests when PR is created

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
Realtek updated its Bluetooth firmware format to v3.
This patch extends the btrtl driver to recognise and parse the new v3 file
format, including:
- New signature string and image ID definitions
- Extension of btrtl_device_info to store v3-specific metadata
- Logic to extract and load firmware data out of v3 images
- Maintains compatibility with existing v2 firmware format

This is required for future Realtek Bluetooth chips that ship with
v3 firmware.
The RTL8922D is the first IC to use firmware format V3, so the following
example uses the RTL8922D's log as expected fw format v3 output:

Bluetooth: btrtl_read_chip_id() hci0: RTL: chip_id status=0x00 id=0x37
Bluetooth: btrtl_initialize() hci0: RTL: examining hci_ver=0d hci_rev=000d lmp_ver=0d lmp_subver=8922
Bluetooth: rtl_read_rom_version() hci0: RTL: rom_version status=0 version=1
Bluetooth: btrtl_initialize() hci0: RTL: btrtl_initialize: key id 0
Bluetooth: rtl_load_file() hci0: RTL: loading rtl_bt/rtl8922du_fw.bin
Bluetooth: rtl_load_file() hci0: RTL: loading rtl_bt/rtl8922du_config.bin
Bluetooth: rtlbt_parse_firmware_v3() hci0: RTL: key id 0
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image (f000:00), chip id 55, cut 0x02, len 00007185
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image version: 35fd7908
Bluetooth: rtlbt_parse_config() hci0: RTL: config file: rtl_bt/rtl8922du_config_f000.bin
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image (f002:00), chip id 55, cut 0x02, len 000078f5
Bluetooth: rtlbt_parse_section_v3() hci0: RTL: image version: 47b6874d
Bluetooth: rtlbt_parse_config() hci0: RTL: config file: rtl_bt/rtl8922du_config_f002.bin
Bluetooth: rtlbt_parse_firmware_v3() hci0: RTL: image payload total len: 0x0000ea7a
Bluetooth: rtl_finalize_download() hci0: RTL: Watchdog reset status 00
Bluetooth: rtl_finalize_download() hci0: RTL: fw version 0x47b6874d

Signed-off-by: Alex Lu <alex_lu@realsil.com.cn>
Signed-off-by: Zoey Zhou <zoey_zhou@realsil.com.cn>
Signed-off-by: Hilda Wu <hildawu@realtek.com>
Add the support for RTL8922D BT controller on USB interface.
The necessary firmware will be submitted to linux-firmware project.

The device info from /sys/kernel/debug/usb/devices as below.

T:  Bus=01 Lev=01 Prnt=01 Port=07 Cnt=03 Dev#=  4 Spd=12   MxCh= 0
D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0bda ProdID=892d Rev= 0.00
S:  Manufacturer=Realtek
S:  Product=Bluetoo
S:  SerialNumber=00E04C885A01
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms

Signed-off-by: Alex Lu <alex_lu@realsil.com.cn>
Signed-off-by: Zoey Zhou <zoey_zhou@realsil.com.cn>
Signed-off-by: Hilda Wu <hildawu@realtek.com>
When firmware format v3 is used, enable a new download mode that uses
HCI ACL packets to accelerate firmware transfer, reducing load time.

Signed-off-by: Alex Lu <alex_lu@realsil.com.cn>
Signed-off-by: Zoey Zhou <zoey_zhou@realsil.com.cn>
Signed-off-by: Hilda Wu <hildawu@realtek.com>
@github-actions
Copy link

CheckPatch
Desc: Run checkpatch.pl script
Duration: 0.55 seconds
Result: PENDING

@github-actions
Copy link

GitLint
Desc: Run gitlint
Duration: 0.43 seconds
Result: PENDING

@github-actions
Copy link

SubjectPrefix
Desc: Check subject contains "Bluetooth" prefix
Duration: 0.20 seconds
Result: PASS

@github-actions
Copy link

BuildKernel
Desc: Build Kernel for Bluetooth
Duration: 26.80 seconds
Result: PASS

@github-actions
Copy link

CheckAllWarning
Desc: Run linux kernel with all warning enabled
Duration: 28.09 seconds
Result: PASS

@github-actions
Copy link

CheckSparse
Desc: Run sparse tool with linux kernel
Duration: 33.52 seconds
Result: PASS

@github-actions
Copy link

BuildKernel32
Desc: Build 32bit Kernel for Bluetooth
Duration: 26.48 seconds
Result: PASS

@github-actions
Copy link

TestRunnerSetup
Desc: Setup kernel and bluez for test-runner
Duration: 542.65 seconds
Result: PASS

@github-actions
Copy link

TestRunner_l2cap-tester
Desc: Run l2cap-tester with test-runner
Duration: 25.13 seconds
Result: PASS

@github-actions
Copy link

TestRunner_iso-tester
Desc: Run iso-tester with test-runner
Duration: 62.09 seconds
Result: FAIL
Output:

BUG: KASAN: slab-use-after-free in iso_conn_hold_unless_zero+0x76/0x1c0
Total: 141, Passed: 141 (100.0%), Failed: 0, Not Run: 0

@github-actions
Copy link

TestRunner_bnep-tester
Desc: Run bnep-tester with test-runner
Duration: 6.39 seconds
Result: PASS

@github-actions
Copy link

TestRunner_mgmt-tester
Desc: Run mgmt-tester with test-runner
Duration: 128.09 seconds
Result: FAIL
Output:

Total: 494, Passed: 487 (98.6%), Failed: 3, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.114 seconds
LL Privacy - Remove Device 3 (Disable RL)            Failed       0.205 seconds
LL Privacy - Set Device Flag 1 (Device Privacy)      Failed       0.172 seconds

@github-actions
Copy link

TestRunner_rfcomm-tester
Desc: Run rfcomm-tester with test-runner
Duration: 10.08 seconds
Result: PASS

@github-actions
Copy link

TestRunner_sco-tester
Desc: Run sco-tester with test-runner
Duration: 15.21 seconds
Result: FAIL
Output:

WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0

@github-actions
Copy link

TestRunner_ioctl-tester
Desc: Run ioctl-tester with test-runner
Duration: 11.02 seconds
Result: PASS

@github-actions
Copy link

TestRunner_mesh-tester
Desc: Run mesh-tester with test-runner
Duration: 12.61 seconds
Result: FAIL
Output:

Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    2.467 seconds
Mesh - Send cancel - 2                               Timed out    1.994 seconds

@github-actions
Copy link

TestRunner_smp-tester
Desc: Run smp-tester with test-runner
Duration: 9.10 seconds
Result: PASS

@github-actions
Copy link

TestRunner_userchan-tester
Desc: Run userchan-tester with test-runner
Duration: 7.33 seconds
Result: PASS

@github-actions
Copy link

IncrementalBuild
Desc: Incremental build with the patches in the series
Duration: 0.75 seconds
Result: PENDING

@github-actions github-actions bot force-pushed the workflow branch 5 times, most recently from c9fa075 to 1e7b027 Compare December 18, 2025 19:47
@github-actions github-actions bot force-pushed the workflow branch 2 times, most recently from 8eabaf6 to b7ba526 Compare December 22, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants