[PATCH v1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature

Shuai Zhang posted 1 patch 2 months, 4 weeks ago
There is a newer version of this series
drivers/bluetooth/btqca.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
[PATCH v1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature
Posted by Shuai Zhang 2 months, 4 weeks ago
For WCN6855: download wcnhpbtfwxx.tlv and wcnhpnvxx.xxx;
if they do not exist, download hpbtfwxx.tlv and hpnvxx.xxx instead.

Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
---
 drivers/bluetooth/btqca.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 7c958d606..cafdae903 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -848,7 +848,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 			break;
 		case QCA_WCN6855:
 			snprintf(config.fwname, sizeof(config.fwname),
-				 "qca/hpbtfw%02x.tlv", rom_ver);
+				 "qca/wcnhpbtfw%02x.tlv", rom_ver);
 			break;
 		case QCA_WCN7850:
 			snprintf(config.fwname, sizeof(config.fwname),
@@ -861,6 +861,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 	}
 
 	err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
+
+	if (!rampatch_name && err < 0 && soc_type == QCA_WCN6855) {
+		snprintf(config.fwname, sizeof(config.fwname),
+			 "qca/hpbtfw%02x.tlv", rom_ver);
+		err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
+	}
+
 	if (err < 0) {
 		bt_dev_err(hdev, "QCA Failed to download patch (%d)", err);
 		return err;
@@ -923,7 +930,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 		case QCA_WCN6855:
 			qca_read_fw_board_id(hdev, &boardid);
 			qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname),
-						  "hpnv", soc_type, ver, rom_ver, boardid);
+						  "wcnhpnv", soc_type, ver, rom_ver, boardid);
 			break;
 		case QCA_WCN7850:
 			qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname),
@@ -936,6 +943,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
 	}
 
 	err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
+
+	if (!firmware_name && err < 0 && soc_type == QCA_WCN6855) {
+		qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname),
+					  "hpnv", soc_type, ver, rom_ver, boardid);
+		err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
+	}
+
 	if (err < 0) {
 		bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err);
 		return err;
-- 
2.34.1
Re: [PATCH v1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature
Posted by Konrad Dybcio 2 months, 4 weeks ago
On 11/12/25 8:46 AM, Shuai Zhang wrote:
> For WCN6855: download wcnhpbtfwxx.tlv and wcnhpnvxx.xxx;
> if they do not exist, download hpbtfwxx.tlv and hpnvxx.xxx instead.
> 
> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
> ---

Would these files be fundamentally any different, or is it a workaround
for someone else being creative with filenames?

Konrad
Re: [PATCH v1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature
Posted by Shuai Zhang 2 months, 4 weeks ago
Hi Konrad

Thank you for your review.
On 11/12/2025 5:53 PM, Konrad Dybcio wrote:
> On 11/12/25 8:46 AM, Shuai Zhang wrote:
>> For WCN6855: download wcnhpbtfwxx.tlv and wcnhpnvxx.xxx;
>> if they do not exist, download hpbtfwxx.tlv and hpnvxx.xxx instead.
>>
>> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
>> ---
> 
> Would these files be fundamentally any different, or is it a workaround
> for someone else being creative with filenames?
> 

The prefix “wcn” corresponds to the WCN685x chip, while entries without
the “wcn” prefix correspond to the QCA2066 chip. There are some feature
differences between the two. 

However, due to historical reasons, the WCN685x chip has been using firmware
without the “wcn” prefix. We are now correcting the mapping between the chip
and its corresponding firmware.

If it is necessary to add a comment to explain this, I will submit a new patch.

> Konrad

Best,regard
Shuai
Re: [PATCH v1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature
Posted by Konrad Dybcio 2 months, 4 weeks ago
On 11/12/25 12:29 PM, Shuai Zhang wrote:
> Hi Konrad
> 
> Thank you for your review.
> On 11/12/2025 5:53 PM, Konrad Dybcio wrote:
>> On 11/12/25 8:46 AM, Shuai Zhang wrote:
>>> For WCN6855: download wcnhpbtfwxx.tlv and wcnhpnvxx.xxx;
>>> if they do not exist, download hpbtfwxx.tlv and hpnvxx.xxx instead.
>>>
>>> Signed-off-by: Shuai Zhang <quic_shuaz@quicinc.com>
>>> ---
>>
>> Would these files be fundamentally any different, or is it a workaround
>> for someone else being creative with filenames?
>>
> 
> The prefix “wcn” corresponds to the WCN685x chip, while entries without
> the “wcn” prefix correspond to the QCA2066 chip. There are some feature
> differences between the two. 
> 
> However, due to historical reasons, the WCN685x chip has been using firmware
> without the “wcn” prefix. We are now correcting the mapping between the chip
> and its corresponding firmware.
> 
> If it is necessary to add a comment to explain this, I will submit a new patch.

Yes, most definitely. Please add this both in the commit message and
a comment in the code

Konrad