summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorWei Ni <wni@nvidia.com>2012-09-28 17:20:19 +0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 12:36:39 -0700
commit79ec0a95ec1d18c45d5fb17d3df36eae985e9408 (patch)
tree5602226e70b52fee0b42383d96a1fa82e499d8f5 /drivers/net
parent0111d217118c7608d4191d4064c4db56c6f9710a (diff)
brcmfmac: load firmware based on chip id
Choose appropriate firmware at runtime so that brcmfmac driver can be used for both bcm4329 and bcm4330 chipset. Change-Id: Ia035874dcb2eb0e01a0a1b8818e60c363c9d018e Signed-off-by: Wei Ni <wni@nvidia.com> Reviewed-on: http://git-master/r/139622 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com> Rebase-Id: R49c6c2563edd8da76e8e07d8c2ca223b022992b3
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index d2487518bd2a..82fc6106c6fa 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -318,6 +318,14 @@ struct rte_console {
#define BRCMF_SDIO_NV_NAME "brcm/brcmfmac-sdio.txt"
MODULE_FIRMWARE(BRCMF_SDIO_FW_NAME);
MODULE_FIRMWARE(BRCMF_SDIO_NV_NAME);
+#define BRCMF_SDIO_4329_FW_NAME "brcm/brcmfmac-sdio-4329.bin"
+#define BRCMF_SDIO_4330_FW_NAME "brcm/brcmfmac-sdio-4330.bin"
+#define BRCMF_SDIO_4329_NV_NAME "brcm/brcmfmac-sdio-4329.txt"
+#define BRCMF_SDIO_4330_NV_NAME "brcm/brcmfmac-sdio-4330.txt"
+MODULE_FIRMWARE(BRCMF_SDIO_4329_FW_NAME);
+MODULE_FIRMWARE(BRCMF_SDIO_4330_FW_NAME);
+MODULE_FIRMWARE(BRCMF_SDIO_4329_NV_NAME);
+MODULE_FIRMWARE(BRCMF_SDIO_4330_NV_NAME);
#define BRCMF_IDLE_IMMEDIATE (-1) /* Enter idle immediately */
#define BRCMF_IDLE_ACTIVE 0 /* Do not request any SD clock change
@@ -3030,13 +3038,22 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
int offset;
uint len;
u8 *memblock = NULL, *memptr;
- int ret;
+ int ret = -1;
u8 idx;
+ u16 chipid = (u16) bus->ci->chip;
brcmf_dbg(INFO, "Enter\n");
- ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME,
+ if (chipid == BCM4329_CHIP_ID)
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_4329_FW_NAME,
+ &bus->sdiodev->func[2]->dev);
+ else if (chipid == BCM4330_CHIP_ID)
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_4330_FW_NAME,
&bus->sdiodev->func[2]->dev);
+ else
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME,
+ &bus->sdiodev->func[2]->dev);
+
if (ret) {
brcmf_err("Fail to request firmware %d\n", ret);
return ret;
@@ -3155,10 +3172,21 @@ err:
static int brcmf_sdbrcm_download_nvram(struct brcmf_sdio *bus)
{
- int ret;
+ int ret = -1;
+ u16 chipid = (u16) bus->ci->chip;
+
+ brcmf_dbg(INFO, "Enter\n");
- ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME,
+ if (chipid == BCM4329_CHIP_ID)
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_4329_NV_NAME,
&bus->sdiodev->func[2]->dev);
+ else if (chipid == BCM4330_CHIP_ID)
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_4330_NV_NAME,
+ &bus->sdiodev->func[2]->dev);
+ else
+ ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME,
+ &bus->sdiodev->func[2]->dev);
+
if (ret) {
brcmf_err("Fail to request nvram %d\n", ret);
return ret;