cnss: using bmi target info from wlan to determine firmware files

Currently we are reading ROME revision id from pci config space and
deciding firmware files based on that. This is not portable across
different buses. Instead, we need to use the revision id read by qcacld
WLAN driver(BMI) to decide firmware files for ROME. This change amends
cnss_get_fw_files API to receive target info and return firmware file
names based on that.

CRs-Fixed: 669587
Change-Id: Ic6ea327737a4ab428020f0ee5414a144a45f21ba
Signed-off-by: Mohit Khanna <mkhannaqca@codeaurora.org>
This commit is contained in:
Mohit Khanna 2014-05-22 15:28:41 -07:00
parent e7c6d02616
commit a1c369943c
2 changed files with 48 additions and 0 deletions

View File

@ -50,6 +50,22 @@
#define QCA6174_FW_1_3 (0x13)
#define QCA6174_FW_2_0 (0x20)
#define QCA6174_FW_3_0 (0x30)
#define AR6320_REV1_VERSION 0x5000000
#define AR6320_REV1_1_VERSION 0x5000001
#define AR6320_REV1_3_VERSION 0x5000003
#define AR6320_REV2_1_VERSION 0x5010000
#define AR6320_REV3_VERSION 0x5020000
static struct cnss_fw_files FW_FILES_QCA6174_FW_1_1 = {
"qwlan11.bin", "bdwlan11.bin", "otp11.bin", "utf11.bin", "utfbd11.bin"};
static struct cnss_fw_files FW_FILES_QCA6174_FW_2_0 = {
"qwlan20.bin", "bdwlan20.bin", "otp20.bin", "utf20.bin", "utfbd20.bin"};
static struct cnss_fw_files FW_FILES_QCA6174_FW_1_3 = {
"qwlan13.bin", "bdwlan13.bin", "otp13.bin", "utf13.bin", "utfbd13.bin"};
static struct cnss_fw_files FW_FILES_QCA6174_FW_3_0 = {
"qwlan30.bin", "bdwlan30.bin", "otp30.bin", "utf30.bin", "utfbd30.bin"};
static struct cnss_fw_files FW_FILES_DEFAULT = {
"qwlan.bin", "bdwlan.bin", "otp.bin", "utf.bin", "utfbd.bin"};
#define WLAN_VREG_NAME "vdd-wlan"
#define WLAN_SWREG_NAME "wlan-soc-swreg"
@ -450,6 +466,36 @@ int cnss_get_fw_files(struct cnss_fw_files *pfw_files)
}
EXPORT_SYMBOL(cnss_get_fw_files);
int cnss_get_fw_files_for_target(struct cnss_fw_files *pfw_files,
u32 target_type, u32 target_version)
{
if (!pfw_files)
return -ENODEV;
switch (target_version) {
case AR6320_REV1_VERSION:
case AR6320_REV1_1_VERSION:
memcpy(pfw_files, &FW_FILES_QCA6174_FW_1_1, sizeof(*pfw_files));
break;
case AR6320_REV1_3_VERSION:
memcpy(pfw_files, &FW_FILES_QCA6174_FW_1_3, sizeof(*pfw_files));
break;
case AR6320_REV2_1_VERSION:
memcpy(pfw_files, &FW_FILES_QCA6174_FW_2_0, sizeof(*pfw_files));
break;
case AR6320_REV3_VERSION:
memcpy(pfw_files, &FW_FILES_QCA6174_FW_3_0, sizeof(*pfw_files));
break;
default:
memcpy(pfw_files, &FW_FILES_DEFAULT, sizeof(*pfw_files));
pr_err("%s version mismatch 0x%X 0x%X",
__func__, target_type, target_version);
break;
}
return 0;
}
EXPORT_SYMBOL(cnss_get_fw_files_for_target);
static int cnss_wlan_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{

View File

@ -71,6 +71,8 @@ extern int cnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list,
extern int cnss_wlan_register_driver(struct cnss_wlan_driver *driver);
extern void cnss_wlan_unregister_driver(struct cnss_wlan_driver *driver);
extern int cnss_get_fw_files(struct cnss_fw_files *pfw_files);
extern int cnss_get_fw_files_for_target(struct cnss_fw_files *pfw_files,
u32 target_type, u32 target_version);
extern void cnss_flush_work(void *work);
extern void cnss_flush_delayed_work(void *dwork);
extern void cnss_get_monotonic_boottime(struct timespec *ts);