Commit ce2d7d7e authored by Franky Lin's avatar Franky Lin Committed by John W. Linville

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: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e40aed06
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define DMA_ALIGN_MASK 0x03 #define DMA_ALIGN_MASK 0x03
#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329 #define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
#define SDIO_FUNC1_BLOCKSIZE 64 #define SDIO_FUNC1_BLOCKSIZE 64
#define SDIO_FUNC2_BLOCKSIZE 512 #define SDIO_FUNC2_BLOCKSIZE 512
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
/* devices we support, null terminated */ /* devices we support, null terminated */
static const struct sdio_device_id brcmf_sdmmc_ids[] = { static const struct sdio_device_id brcmf_sdmmc_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)}, {SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329)},
{SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4330)},
{ /* end: all zeroes */ }, { /* end: all zeroes */ },
}; };
MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
......
...@@ -3636,6 +3636,8 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid) ...@@ -3636,6 +3636,8 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
{ {
if (chipid == BCM4329_CHIP_ID) if (chipid == BCM4329_CHIP_ID)
return true; return true;
if (chipid == BCM4330_CHIP_ID)
return true;
return false; return false;
} }
......
...@@ -91,6 +91,18 @@ static const struct sdiod_drive_str sdiod_drive_strength_tab3[] = { ...@@ -91,6 +91,18 @@ static const struct sdiod_drive_str sdiod_drive_strength_tab3[] = {
0, 0x0} 0, 0x0}
}; };
/* SDIO Drive Strength to sel value table for PMU Rev 11 (1.8V) */
static const struct sdiod_drive_str sdiod_drvstr_tab4_1v8[] = {
{32, 0x6},
{26, 0x7},
{22, 0x4},
{16, 0x5},
{12, 0x2},
{8, 0x3},
{4, 0x0},
{0, 0x1}
};
u8 u8
brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid) brcmf_sdio_chip_getinfidx(struct chip_info *ci, u16 coreid)
{ {
...@@ -396,6 +408,23 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev, ...@@ -396,6 +408,23 @@ static int brcmf_sdio_chip_recognition(struct brcmf_sdio_dev *sdiodev,
ci->c_inf[3].base = BCM4329_CORE_ARM_BASE; ci->c_inf[3].base = BCM4329_CORE_ARM_BASE;
ci->ramsize = BCM4329_RAMSIZE; ci->ramsize = BCM4329_RAMSIZE;
break; break;
case BCM4330_CHIP_ID:
ci->c_inf[0].wrapbase = 0x18100000;
ci->c_inf[0].cib = 0x27004211;
ci->c_inf[1].id = BCMA_CORE_SDIO_DEV;
ci->c_inf[1].base = 0x18002000;
ci->c_inf[1].wrapbase = 0x18102000;
ci->c_inf[1].cib = 0x07004211;
ci->c_inf[2].id = BCMA_CORE_INTERNAL_MEM;
ci->c_inf[2].base = 0x18004000;
ci->c_inf[2].wrapbase = 0x18104000;
ci->c_inf[2].cib = 0x0d080401;
ci->c_inf[3].id = BCMA_CORE_ARM_CM3;
ci->c_inf[3].base = 0x18003000;
ci->c_inf[3].wrapbase = 0x18103000;
ci->c_inf[3].cib = 0x03004211;
ci->ramsize = 0x48000;
break;
default: default:
brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip); brcmf_dbg(ERROR, "chipid 0x%x is not supported\n", ci->chip);
return -ENODEV; return -ENODEV;
...@@ -585,6 +614,11 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev, ...@@ -585,6 +614,11 @@ brcmf_sdio_chip_drivestrengthinit(struct brcmf_sdio_dev *sdiodev,
str_mask = 0x00003800; str_mask = 0x00003800;
str_shift = 11; str_shift = 11;
break; break;
case SDIOD_DRVSTR_KEY(BCM4330_CHIP_ID, 12):
str_tab = (struct sdiod_drive_str *)&sdiod_drvstr_tab4_1v8;
str_mask = 0x00003800;
str_shift = 11;
break;
default: default:
brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n", brcmf_dbg(ERROR, "No SDIO Drive strength init done for chip %s rev %d pmurev %d\n",
brcmf_sdio_chip_name(ci->chip, chn, 8), brcmf_sdio_chip_name(ci->chip, chn, 8),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment