diff options
author | Nishant Sarmukadam <nishants@marvell.com> | 2013-03-01 06:43:01 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-03-06 16:25:49 -0500 |
commit | 98929824eec490984e42ac9dc3b96f7f12033996 (patch) | |
tree | 6986aabcffbcfe20bca7eb11ada4486d093eec3a /drivers/net/wireless/mwl8k.c | |
parent | d926dc7de89ca3caa550a393b2a00715acb744ea (diff) |
mwl8k: Load 8764 firmware image
This differs from legacy chips i.e.
a 8764 loads firmware image without a helper image
b Check interrupt status register for download
complete indication.
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index e86a31bac45f..aaaf10d48f7d 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -284,6 +284,7 @@ struct mwl8k_priv { | |||
284 | unsigned fw_state; | 284 | unsigned fw_state; |
285 | char *fw_pref; | 285 | char *fw_pref; |
286 | char *fw_alt; | 286 | char *fw_alt; |
287 | bool is_8764; | ||
287 | struct completion firmware_loading_complete; | 288 | struct completion firmware_loading_complete; |
288 | 289 | ||
289 | /* bitmap of running BSSes */ | 290 | /* bitmap of running BSSes */ |
@@ -600,13 +601,18 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length) | |||
600 | loops = 1000; | 601 | loops = 1000; |
601 | do { | 602 | do { |
602 | u32 int_code; | 603 | u32 int_code; |
603 | 604 | if (priv->is_8764) { | |
604 | int_code = ioread32(regs + MWL8K_HIU_INT_CODE); | 605 | int_code = ioread32(regs + |
605 | if (int_code == MWL8K_INT_CODE_CMD_FINISHED) { | 606 | MWL8K_HIU_H2A_INTERRUPT_STATUS); |
606 | iowrite32(0, regs + MWL8K_HIU_INT_CODE); | 607 | if (int_code == 0) |
607 | break; | 608 | break; |
609 | } else { | ||
610 | int_code = ioread32(regs + MWL8K_HIU_INT_CODE); | ||
611 | if (int_code == MWL8K_INT_CODE_CMD_FINISHED) { | ||
612 | iowrite32(0, regs + MWL8K_HIU_INT_CODE); | ||
613 | break; | ||
614 | } | ||
608 | } | 615 | } |
609 | |||
610 | cond_resched(); | 616 | cond_resched(); |
611 | udelay(1); | 617 | udelay(1); |
612 | } while (--loops); | 618 | } while (--loops); |
@@ -724,7 +730,7 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) | |||
724 | int rc; | 730 | int rc; |
725 | int loops; | 731 | int loops; |
726 | 732 | ||
727 | if (!memcmp(fw->data, "\x01\x00\x00\x00", 4)) { | 733 | if (!memcmp(fw->data, "\x01\x00\x00\x00", 4) && !priv->is_8764) { |
728 | const struct firmware *helper = priv->fw_helper; | 734 | const struct firmware *helper = priv->fw_helper; |
729 | 735 | ||
730 | if (helper == NULL) { | 736 | if (helper == NULL) { |
@@ -743,7 +749,10 @@ static int mwl8k_load_firmware(struct ieee80211_hw *hw) | |||
743 | 749 | ||
744 | rc = mwl8k_feed_fw_image(priv, fw->data, fw->size); | 750 | rc = mwl8k_feed_fw_image(priv, fw->data, fw->size); |
745 | } else { | 751 | } else { |
746 | rc = mwl8k_load_fw_image(priv, fw->data, fw->size); | 752 | if (priv->is_8764) |
753 | rc = mwl8k_feed_fw_image(priv, fw->data, fw->size); | ||
754 | else | ||
755 | rc = mwl8k_load_fw_image(priv, fw->data, fw->size); | ||
747 | } | 756 | } |
748 | 757 | ||
749 | if (rc) { | 758 | if (rc) { |
@@ -6007,6 +6016,8 @@ static int mwl8k_probe(struct pci_dev *pdev, | |||
6007 | priv->pdev = pdev; | 6016 | priv->pdev = pdev; |
6008 | priv->device_info = &mwl8k_info_tbl[id->driver_data]; | 6017 | priv->device_info = &mwl8k_info_tbl[id->driver_data]; |
6009 | 6018 | ||
6019 | if (id->driver_data == MWL8764) | ||
6020 | priv->is_8764 = true; | ||
6010 | 6021 | ||
6011 | priv->sram = pci_iomap(pdev, 0, 0x10000); | 6022 | priv->sram = pci_iomap(pdev, 0, 0x10000); |
6012 | if (priv->sram == NULL) { | 6023 | if (priv->sram == NULL) { |