Commit e41137d8 authored by Zijun Hu's avatar Zijun Hu Committed by Luiz Augusto von Dentz

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: default avatarZijun Hu <quic_zijuhu@quicinc.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent b39910bb
...@@ -737,6 +737,19 @@ static void qca_generate_hsp_nvm_name(char *fwname, size_t max_size, ...@@ -737,6 +737,19 @@ static void qca_generate_hsp_nvm_name(char *fwname, size_t max_size,
snprintf(fwname, max_size, "qca/hpnv%02x%s.%x", rom_ver, variant, bid); snprintf(fwname, max_size, "qca/hpnv%02x%s.%x", rom_ver, variant, bid);
} }
static inline void qca_get_nvm_name_generic(struct qca_fw_config *cfg,
const char *stem, u8 rom_ver, u16 bid)
{
if (bid == 0x0)
snprintf(cfg->fwname, sizeof(cfg->fwname), "qca/%snv%02x.bin", stem, rom_ver);
else if (bid & 0xff00)
snprintf(cfg->fwname, sizeof(cfg->fwname),
"qca/%snv%02x.b%x", stem, rom_ver, bid);
else
snprintf(cfg->fwname, sizeof(cfg->fwname),
"qca/%snv%02x.b%02x", stem, rom_ver, bid);
}
int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
enum qca_btsoc_type soc_type, struct qca_btsoc_version ver, enum qca_btsoc_type soc_type, struct qca_btsoc_version ver,
const char *firmware_name) const char *firmware_name)
...@@ -817,7 +830,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -817,7 +830,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
/* Give the controller some time to get ready to receive the NVM */ /* Give the controller some time to get ready to receive the NVM */
msleep(10); msleep(10);
if (soc_type == QCA_QCA2066) if (soc_type == QCA_QCA2066 || soc_type == QCA_WCN7850)
qca_read_fw_board_id(hdev, &boardid); qca_read_fw_board_id(hdev, &boardid);
/* Download NVM configuration */ /* Download NVM configuration */
...@@ -859,8 +872,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, ...@@ -859,8 +872,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
"qca/hpnv%02x.bin", rom_ver); "qca/hpnv%02x.bin", rom_ver);
break; break;
case QCA_WCN7850: case QCA_WCN7850:
snprintf(config.fwname, sizeof(config.fwname), qca_get_nvm_name_generic(&config, "hmt", rom_ver, boardid);
"qca/hmtnv%02x.bin", rom_ver);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment