aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2011-12-08 18:06:39 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-13 15:31:16 -0500
commitce2d7d7e8fd88191f5d1c92a8b33aeb0cb12ea34 (patch)
treeea2c00fa766b71244233afbdd7b79bf543be6407
parente40aed0638ac84d63a2ff33502e215ac81010a89 (diff)
brcm80211: fmac: add bcm4330 support
This patch adds support for bcm4330 chip which has a SDIO device id 0x4330. All basic functionalities of bcm4330 are supported by brcmfmac after this patch. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c34
3 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index bc992675eb98..b895f198a950 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -40,6 +40,7 @@
40#define DMA_ALIGN_MASK 0x03 40#define DMA_ALIGN_MASK 0x03
41 41
42#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 42#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
43#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
43 44
44#define SDIO_FUNC1_BLOCKSIZE 64 45#define SDIO_FUNC1_BLOCKSIZE 64
45#define SDIO_FUNC2_BLOCKSIZE 512 46#define SDIO_FUNC2_BLOCKSIZE 512
@@ -47,6 +48,7 @@
47/* devices we support, null terminated */ 48/* devices we support, null terminated */
48static const struct sdio_device_id brcmf_sdmmc_ids[] = { 49static const struct sdio_device_id brcmf_sdmmc_ids[] = {
49 {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)}, 50 {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)},
51 {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4330)},
50 { /* end: all zeroes */ }, 52 { /* end: all zeroes */ },
51}; 53};
52MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); 54MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 18597fe5dfd6..43ba0dd48354 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -3636,6 +3636,8 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
3636{ 3636{
3637 if (chipid == BCM4329_CHIP_ID) 3637 if (chipid == BCM4329_CHIP_ID)
3638 return true; 3638 return true;
3639 if (chipid == BCM4330_CHIP_ID)
3640 return true;
3639 return false; 3641 return false;
3640} 3642}
3641 3643
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
index f6b1822031fe..d299059a2815 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c
@@ -91,6 +91,18 @@ static const struct sdiod_drive_str sdiod_drive_strength_tab3[] = {
91 0, 0x0} 91 0, 0x0}
92 }; 92 };
93 93
94/* SDIO Drive Strength to sel value table for PMU Rev 11 (1.8V) */
95static const struct sdiod_drive_str sdiod_drvstr_tab4_1v8[] = {
96 {32, 0x6},
97 {26, 0x7},
98 {22, 0x4},
99 {16, 0x5},
100 {12, 0x2},
101 {8, 0x3},
102 {4, 0x0},
103 {0, 0x1}
104};
105
94u8 106u8
95brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid) 107brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid)
96{ 108{
@@ -396,6 +408,23 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,
396 ci->c_inf[3].base = BCM4329_CORE_ARM_BASE; 408 ci->c_inf[3].base = BCM4329_CORE_ARM_BASE;
397 ci->ramsize = BCM4329_RAMSIZE; 409 ci->ramsize = BCM4329_RAMSIZE;
398 break; 410 break;
411 case BCM4330_CHIP_ID:
412 ci->c_inf[0].wrapbase = 0x18100000;
413 ci->c_inf[0].cib = 0x27004211;
414 ci->c_inf[1].id = BCMA_CORE_SDIO_DEV;
415 ci->c_inf[1].base = 0x18002000;
416 ci->c_inf[1].wrapbase = 0x18102000;
417 ci->c_inf[1].cib = 0x07004211;
418 ci->c_inf[2].id = BCMA_CORE_INTERNAL_MEM;
419 ci->c_inf[2].base = 0x18004000;
420 ci->c_inf[2].wrapbase = 0x18104000;
421 ci->c_inf[2].cib = 0x0d080401;
422 ci->c_inf[3].id = BCMA_CORE_ARM_CM3;
423 ci->c_inf[3].base = 0x18003000;
424 ci->c_inf[3].wrapbase = 0x18103000;
425 ci->c_inf[3].cib = 0x03004211;
426 ci->ramsize = 0x48000;
427 break;
399 default: 428 default:
400 brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip); 429 brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip);
401 return -ENODEV; 430 return -ENODEV;
@@ -585,6 +614,11 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
585 str_mask = 0x00003800; 614 str_mask = 0x00003800;
586 str_shift = 11; 615 str_shift = 11;
587 break; 616 break;
617 case SDIOD_DRVSTR_KEY(BCM4330_CHIP_ID, 12):
618 str_tab = (struct sdiod_drive_str *)&sdiod_drvstr_tab4_1v8;
619 str_mask = 0x00003800;
620 str_shift = 11;
621 break;
588 default: 622 default:
589 brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n", 623 brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n",
590 brcmf_sdio_chip_name(ci->chip, chn, 8), 624 brcmf_sdio_chip_name(ci->chip, chn, 8),