-
Notifications
You must be signed in to change notification settings - Fork 1
[PW_SID:1031978] [v5,1/3] Bluetooth: btrtl: Add firmware format v3 support #3212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: workflow
Are you sure you want to change the base?
Conversation
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>
|
CheckPatch |
|
GitLint |
|
SubjectPrefix |
|
BuildKernel |
|
CheckAllWarning |
|
CheckSparse |
|
BuildKernel32 |
|
TestRunnerSetup |
|
TestRunner_l2cap-tester |
|
TestRunner_iso-tester |
|
TestRunner_bnep-tester |
|
TestRunner_mgmt-tester |
|
TestRunner_rfcomm-tester |
|
TestRunner_sco-tester |
|
TestRunner_ioctl-tester |
|
TestRunner_mesh-tester |
|
TestRunner_smp-tester |
|
TestRunner_userchan-tester |
|
IncrementalBuild |
c9fa075 to
1e7b027
Compare
8eabaf6 to
b7ba526
Compare
Realtek updated its Bluetooth firmware format to v3.
This patch extends the btrtl driver to recognise and parse the new v3 file
format, including:
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:
Change in V4:
Change in V3:
Change in V2:
drivers/bluetooth/btrtl.c | 698 +++++++++++++++++++++++++++++++++++++-
drivers/bluetooth/btrtl.h | 102 ++++++
drivers/bluetooth/btusb.c | 3 +
3 files changed, 786 insertions(+), 17 deletions(-)