Bluetooth: btqca: Add wcn3990 firmware download support.
This patch enables the RAM and NV patch download for wcn3990. Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
be93a497fa
commit
4219d46868
1 changed files with 21 additions and 4 deletions
|
@ -336,6 +336,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||||
{
|
{
|
||||||
struct rome_config config;
|
struct rome_config config;
|
||||||
int err;
|
int err;
|
||||||
|
u8 rom_ver;
|
||||||
|
|
||||||
bt_dev_dbg(hdev, "QCA setup on UART");
|
bt_dev_dbg(hdev, "QCA setup on UART");
|
||||||
|
|
||||||
|
@ -343,8 +344,19 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||||
|
|
||||||
/* Download rampatch file */
|
/* Download rampatch file */
|
||||||
config.type = TLV_TYPE_PATCH;
|
config.type = TLV_TYPE_PATCH;
|
||||||
snprintf(config.fwname, sizeof(config.fwname), "qca/rampatch_%08x.bin",
|
if (soc_type == QCA_WCN3990) {
|
||||||
soc_ver);
|
/* Firmware files to download are based on ROM version.
|
||||||
|
* ROM version is derived from last two bytes of soc_ver.
|
||||||
|
*/
|
||||||
|
rom_ver = ((soc_ver & 0x00000f00) >> 0x04) |
|
||||||
|
(soc_ver & 0x0000000f);
|
||||||
|
snprintf(config.fwname, sizeof(config.fwname),
|
||||||
|
"qca/crbtfw%02x.tlv", rom_ver);
|
||||||
|
} else {
|
||||||
|
snprintf(config.fwname, sizeof(config.fwname),
|
||||||
|
"qca/rampatch_%08x.bin", soc_ver);
|
||||||
|
}
|
||||||
|
|
||||||
err = qca_download_firmware(hdev, &config);
|
err = qca_download_firmware(hdev, &config);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
bt_dev_err(hdev, "QCA Failed to download patch (%d)", err);
|
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,
|
||||||
|
|
||||||
/* Download NVM configuration */
|
/* Download NVM configuration */
|
||||||
config.type = TLV_TYPE_NVM;
|
config.type = TLV_TYPE_NVM;
|
||||||
snprintf(config.fwname, sizeof(config.fwname), "qca/nvm_%08x.bin",
|
if (soc_type == QCA_WCN3990)
|
||||||
soc_ver);
|
snprintf(config.fwname, sizeof(config.fwname),
|
||||||
|
"qca/crnv%02x.bin", rom_ver);
|
||||||
|
else
|
||||||
|
snprintf(config.fwname, sizeof(config.fwname),
|
||||||
|
"qca/nvm_%08x.bin", soc_ver);
|
||||||
|
|
||||||
err = qca_download_firmware(hdev, &config);
|
err = qca_download_firmware(hdev, &config);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err);
|
bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err);
|
||||||
|
|
Loading…
Add table
Reference in a new issue