Skip to content

Commit e41137d

Browse files
zijun-huVudentz
authored andcommitted
Bluetooth: qca: Support downloading board id specific NVM for WCN7850
Download board id specific NVM instead of default for WCN7850 if board id is available. Signed-off-by: Zijun Hu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent b39910b commit e41137d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

drivers/bluetooth/btqca.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,19 @@ static void qca_generate_hsp_nvm_name(char *fwname, size_t max_size,
737737
snprintf(fwname, max_size, "qca/hpnv%02x%s.%x", rom_ver, variant, bid);
738738
}
739739

740+
static inline void qca_get_nvm_name_generic(struct qca_fw_config *cfg,
741+
const char *stem, u8 rom_ver, u16 bid)
742+
{
743+
if (bid == 0x0)
744+
snprintf(cfg->fwname, sizeof(cfg->fwname), "qca/%snv%02x.bin", stem, rom_ver);
745+
else if (bid & 0xff00)
746+
snprintf(cfg->fwname, sizeof(cfg->fwname),
747+
"qca/%snv%02x.b%x", stem, rom_ver, bid);
748+
else
749+
snprintf(cfg->fwname, sizeof(cfg->fwname),
750+
"qca/%snv%02x.b%02x", stem, rom_ver, bid);
751+
}
752+
740753
int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
741754
enum qca_btsoc_type soc_type, struct qca_btsoc_version ver,
742755
const char *firmware_name)
@@ -817,7 +830,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
817830
/* Give the controller some time to get ready to receive the NVM */
818831
msleep(10);
819832

820-
if (soc_type == QCA_QCA2066)
833+
if (soc_type == QCA_QCA2066 || soc_type == QCA_WCN7850)
821834
qca_read_fw_board_id(hdev, &boardid);
822835

823836
/* Download NVM configuration */
@@ -859,8 +872,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
859872
"qca/hpnv%02x.bin", rom_ver);
860873
break;
861874
case QCA_WCN7850:
862-
snprintf(config.fwname, sizeof(config.fwname),
863-
"qca/hmtnv%02x.bin", rom_ver);
875+
qca_get_nvm_name_generic(&config, "hmt", rom_ver, boardid);
864876
break;
865877

866878
default:

0 commit comments

Comments
 (0)