From: Max Chou <max.chou@realtek.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Christian Hewitt <christianshewitt@gmail.com>
Cc: Hilda Wu <hildawu@realtek.com>, Josh Boyer <jwboyer@kernel.org>,
"Linux Firmware" <linux-firmware@kernel.org>,
Bluez mailing list <linux-bluetooth@vger.kernel.org>,
Vyacheslav <adeep@lexina.in>
Subject: RE: Bug/Problem with rtl_bt/rtl8822cs_config.bin
Date: Thu, 23 Feb 2023 03:24:30 +0000 [thread overview]
Message-ID: <7df7bdcad3474791ae69f73f8a761173@realtek.com> (raw)
In-Reply-To: <CAFBinCBWyiObgbyuT2Xc=FnoTTTUBu3sePpybdrocVZr7SVDWw@mail.gmail.com>
Hi! Christian,
I just try to test the config file as linux-firmware on one model of Chromebook.
It's able to initialize RTL8822CS Bluetooth controller.
The issue does not present as your mention on my side.
I compare the two config files that you listed.
The key difference might to impact the initialization are UART baud rate and UART flow control as Martin's mention.
Recommend you to edit the config file to check what is the root cause for this issue on your Host.
Here're the three cases for the config changed, please use hexadecimal editor for the three changes. Thanks.
1. Based on the config file of linux-firmware, to edit UART baudrate as below.
Original: 1500000 baud, flow control disabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea
00000010 19 e1 1b fd af 5b 01 a4 0b 7a 00 01 37 d9 00 01
00000020 0f
After: 2000000 baud, flow control disabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 50 00 00 50 c5 ea
^^^^^^^^^
00000010 19 e1 1b fd af 5b 01 a4 0b 7a 00 01 37 d9 00 01
00000020 0f
2. Based on the config file of linux-firmware, to edit UART baudrate as below.
Original: 1500000 baud, flow control disabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea
00000010 19 e1 1b fd af 5b 01 a4 0b 7a 00 01 37 d9 00 01
00000020 0f
After: 1500000 baud, flow control enabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea
00000010 19 e1 1b fd af 5f 01 a4 0b 7a 00 01 37 d9 00 01
^^^
00000020 0f
3. Based on the config file of linux-firmware, to edit UART baudrate as below.
Original: 1500000 baud, flow control disabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 80 92 04 50 c5 ea
00000010 19 e1 1b fd af 5b 01 a4 0b 7a 00 01 37 d9 00 01
00000020 0f
After: 2000000 baud, flow control disabled
00000000 55 ab 23 87 1b 00 0c 00 10 02 50 00 00 50 c5 ea
^^^^^^^^^
00000010 19 e1 1b fd af 5f 01 a4 0b 7a 00 01 37 d9 00 01
^^^
00000020 0f
BRs,
Max
> -----Original Message-----
> From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Sent: Wednesday, February 22, 2023 5:23 AM
> To: Christian Hewitt <christianshewitt@gmail.com>
> Cc: Hilda Wu <hildawu@realtek.com>; Josh Boyer <jwboyer@kernel.org>;
> Linux Firmware <linux-firmware@kernel.org>; Bluez mailing list
> <linux-bluetooth@vger.kernel.org>; Vyacheslav <adeep@lexina.in>; Max Chou
> <max.chou@realtek.com>
> Subject: Re: Bug/Problem with rtl_bt/rtl8822cs_config.bin
>
>
> External mail.
>
>
>
> Hi Christian,
>
> + Max Chou as the author of commit 848fc6164158 ("Bluetooth: hci_h5:
> btrtl: Add support for RTL8822C")
>
> On Tue, Feb 21, 2023 at 8:13 AM Christian Hewitt
> <christianshewitt@gmail.com> wrote:
> [...]
> > I can also use the oldest upstream firmware with the Armbian config:
> >
> > [ 7.315358] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000c
> lmp_ver=0a lmp_subver=8822
> > [ 7.318754] Bluetooth: hci0: RTL: rom_version status=0 version=3
> > [ 7.318772] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_fw.bin
> > [ 7.319680] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822cs_config.bin
> > [ 7.341340] Bluetooth: hci0: RTL: cfg_sz 73, total sz 30817
> > [ 7.612533] Bluetooth: hci0: RTL: fw version 0x05990d54
> >
> > The config file Armbian are using [0] is sourced from an Amlogic
> > (Android) BSP repo shared to manufacturer Jethome (Vyacheslav on CC).
> > There is no obvious version info. There are newer (more recently
> > committed) config files available in updates to the Amlogic repo
> > (alongside older 0599_0D54 firmware) and all work with any upstream
> firmware file.
> I did compare the two config files and they differ in certain areas.
> - upstream config: 1500000 baud, flow control is disabled
> - Armbian config: 2000000 baud, flow control is enabled
>
> Seeing that the Armbian config works with a higher baud rate my guess is that
> there's some issue with flow control instead.
>
> For those who are interested, here's the raw data provided by the rtlfw tool
> from [0].
> Armbian (= working) config:
> Signature: 0x8723ab55
> Data len: 67
> len=16 offset=000c,{ 02 50 00 00 50 c5 ea 19 e1 1b fd af 5f 01 a4
> 0b },UART_CONFIG
> len=2 offset=01be,{ 1a 19 }
> len=1 offset=01bb,{ 3d }
> len=4 offset=01c0,{ 10 00 60 01 }
> len=11 offset=1000,{ 00 ff 04 5d 00 03 00 ff ff ff ff }
> len=11 offset=1040,{ 28 08 30 30 00 ff ff ff ff ff ff }
> len=1 offset=01c4,{ 02 }
>
> upstream (= non-working) config:
> Signature: 0x8723ab55
> Data len: 27
> len=16 offset=000c,{ 02 80 92 04 50 c5 ea 19 e1 1b fd af 5b 01 a4
> 0b },UART_CONFIG
> len=1 offset=007a,{ 37 }
> len=1 offset=00d9,{ 0f }
>
> The baud rate is encoded in the first four bytes and can be decoded with the
> help of btrtl_convert_baudrate() from Linux'
> drivers/bluetooth/btrtl.c
> Flow control is encoded as BIT(2) in data[12].
>
> I am hoping that Hilda and/or Max can provide some ideas on how to solve
> this issue.
>
>
> Best regards,
> Martin
>
>
> [0]
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/tools/rtlfw.c?id=5d347
> b54714e0f2d750253be09b68b0c3119dd0a
>
> ------Please consider the environment before printing this e-mail.
next prev parent reply other threads:[~2023-02-23 3:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 7:13 Bug/Problem with rtl_bt/rtl8822cs_config.bin Christian Hewitt
2023-02-21 21:22 ` Martin Blumenstingl
2023-02-23 3:24 ` Max Chou [this message]
2023-02-23 7:51 ` Christian Hewitt
2023-02-23 14:05 ` Vyacheslav
2023-02-23 21:00 ` Martin Blumenstingl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7df7bdcad3474791ae69f73f8a761173@realtek.com \
--to=max.chou@realtek.com \
--cc=adeep@lexina.in \
--cc=christianshewitt@gmail.com \
--cc=hildawu@realtek.com \
--cc=jwboyer@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-firmware@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox