Skip to content

Commit 4219d46

Browse files
bgodavarholtmann
authored andcommitted
Bluetooth: btqca: Add wcn3990 firmware download support.
This patch enables the RAM and NV patch download for wcn3990. Signed-off-by: Balakrishna Godavarthi <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent be93a49 commit 4219d46

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

drivers/bluetooth/btqca.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,27 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
336336
{
337337
struct rome_config config;
338338
int err;
339+
u8 rom_ver;
339340

340341
bt_dev_dbg(hdev, "QCA setup on UART");
341342

342343
config.user_baud_rate = baudrate;
343344

344345
/* Download rampatch file */
345346
config.type = TLV_TYPE_PATCH;
346-
snprintf(config.fwname, sizeof(config.fwname), "qca/rampatch_%08x.bin",
347-
soc_ver);
347+
if (soc_type == QCA_WCN3990) {
348+
/* Firmware files to download are based on ROM version.
349+
* ROM version is derived from last two bytes of soc_ver.
350+
*/
351+
rom_ver = ((soc_ver & 0x00000f00) >> 0x04) |
352+
(soc_ver & 0x0000000f);
353+
snprintf(config.fwname, sizeof(config.fwname),
354+
"qca/crbtfw%02x.tlv", rom_ver);
355+
} else {
356+
snprintf(config.fwname, sizeof(config.fwname),
357+
"qca/rampatch_%08x.bin", soc_ver);
358+
}
359+
348360
err = qca_download_firmware(hdev, &config);
349361
if (err < 0) {
350362
bt_dev_err(hdev, "QCA Failed to download patch (%d)", err);
@@ -353,8 +365,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
353365

354366
/* Download NVM configuration */
355367
config.type = TLV_TYPE_NVM;
356-
snprintf(config.fwname, sizeof(config.fwname), "qca/nvm_%08x.bin",
357-
soc_ver);
368+
if (soc_type == QCA_WCN3990)
369+
snprintf(config.fwname, sizeof(config.fwname),
370+
"qca/crnv%02x.bin", rom_ver);
371+
else
372+
snprintf(config.fwname, sizeof(config.fwname),
373+
"qca/nvm_%08x.bin", soc_ver);
374+
358375
err = qca_download_firmware(hdev, &config);
359376
if (err < 0) {
360377
bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err);

0 commit comments

Comments
 (0)