Commit 0df4604e authored by Franky Lin's avatar Franky Lin Committed by Greg Kroah-Hartman

staging: brmc80211: remove sdio.h from fullmac

Use standard sdio.h from mmc core instead of private one
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 597600ad
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <bcmsdbus.h> /* common SDIO/controller interface */ #include <bcmsdbus.h> /* common SDIO/controller interface */
#include <sbsdio.h> /* BRCM sdio device core */ #include <sbsdio.h> /* BRCM sdio device core */
#include <sdio.h> /* sdio spec */
#include "dngl_stats.h" #include "dngl_stats.h"
#include "dhd.h" #include "dhd.h"
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/mmc/sdio.h>
#include <bcmdefs.h> #include <bcmdefs.h>
#include <bcmdevs.h> #include <bcmdevs.h>
#include <bcmutils.h> #include <bcmutils.h>
#include <bcmwifi.h> #include <bcmwifi.h>
#include <sdio.h> /* SDIO Device and Protocol Specs */
#include <sdioh.h> /* SDIO Host Controller Specification */ #include <sdioh.h> /* SDIO Host Controller Specification */
#include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */ #include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */
#include <sdiovar.h> /* ioctl/iovars */ #include <sdiovar.h> /* ioctl/iovars */
...@@ -75,16 +75,16 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd) ...@@ -75,16 +75,16 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
sd_trace(("%s\n", __func__)); sd_trace(("%s\n", __func__));
/* Get the Card's common CIS address */ /* Get the Card's common CIS address */
sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIOD_CCCR_CISPTR_0); sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIO_CCCR_CIS);
sd->func_cis_ptr[0] = sd->com_cis_ptr; sd->func_cis_ptr[0] = sd->com_cis_ptr;
sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__, sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__,
sd->com_cis_ptr)); sd->com_cis_ptr));
/* Get the Card's function CIS (for each function) */ /* Get the Card's function CIS (for each function) */
for (fbraddr = SDIOD_FBR_STARTADDR, func = 1; for (fbraddr = SDIO_FBR_BASE(1), func = 1;
func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) { func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) {
sd->func_cis_ptr[func] = sd->func_cis_ptr[func] =
sdioh_sdmmc_get_cisaddr(sd, SDIOD_FBR_CISPTR_0 + fbraddr); sdioh_sdmmc_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func, sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func,
sd->func_cis_ptr[func])); sd->func_cis_ptr[func]));
} }
...@@ -642,7 +642,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, ...@@ -642,7 +642,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
* Handle F2 enable * Handle F2 enable
* as a special case. * as a special case.
*/ */
if (regaddr == SDIOD_CCCR_IOEN) { if (regaddr == SDIO_CCCR_IOEx) {
if (gInstance->func[2]) { if (gInstance->func[2]) {
sdio_claim_host(gInstance->func[2]); sdio_claim_host(gInstance->func[2]);
if (*byte & SDIO_FUNC_ENABLE_2) { if (*byte & SDIO_FUNC_ENABLE_2) {
...@@ -667,7 +667,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, ...@@ -667,7 +667,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
} }
#if defined(MMC_SDIO_ABORT) #if defined(MMC_SDIO_ABORT)
/* to allow abort command through F1 */ /* to allow abort command through F1 */
else if (regaddr == SDIOD_CCCR_IOABORT) { else if (regaddr == SDIO_CCCR_ABORT) {
sdio_claim_host(gInstance->func[func]); sdio_claim_host(gInstance->func[func]);
/* /*
* this sdio_f0_writeb() can be replaced * this sdio_f0_writeb() can be replaced
...@@ -955,8 +955,8 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func) ...@@ -955,8 +955,8 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
sd_trace(("%s: Enter\n", __func__)); sd_trace(("%s: Enter\n", __func__));
#if defined(MMC_SDIO_ABORT) #if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F1 */ /* issue abort cmd52 command through F0 */
sdioh_request_byte(sd, SD_IO_OP_WRITE, SDIO_FUNC_0, SDIOD_CCCR_IOABORT, sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func); &t_func);
#endif /* defined(MMC_SDIO_ABORT) */ #endif /* defined(MMC_SDIO_ABORT) */
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <bcmdefs.h> #include <bcmdefs.h>
#include <bcmutils.h> #include <bcmutils.h>
#include <bcmwifi.h> #include <bcmwifi.h>
#include <sdio.h> /* SDIO Specs */
#include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */ #include <bcmsdbus.h> /* bcmsdh to/from specific controller APIs */
#include <sdiovar.h> /* to get msglevel bit values */ #include <sdiovar.h> /* to get msglevel bit values */
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/pci_ids.h> #include <linux/pci_ids.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/mmc/sdio.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <bcmdefs.h> #include <bcmdefs.h>
#include <bcmsdh.h> #include <bcmsdh.h>
...@@ -128,7 +129,6 @@ typedef struct { ...@@ -128,7 +129,6 @@ typedef struct {
#endif /* DHD_DEBUG */ #endif /* DHD_DEBUG */
#include <chipcommon.h> #include <chipcommon.h>
#include <sdio.h>
#include <sbsdio.h> #include <sbsdio.h>
#include <dngl_stats.h> #include <dngl_stats.h>
...@@ -3016,7 +3016,7 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex) ...@@ -3016,7 +3016,7 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Turn off the bus (F2), free any pending packets */ /* Turn off the bus (F2), free any pending packets */
DHD_INTR(("%s: disable SDIO interrupts\n", __func__)); DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
bcmsdh_intr_disable(bus->sdh); bcmsdh_intr_disable(bus->sdh);
bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL); SDIO_FUNC_ENABLE_1, NULL);
/* Clear any pending interrupts now that F2 is disabled */ /* Clear any pending interrupts now that F2 is disabled */
...@@ -3091,7 +3091,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex) ...@@ -3091,7 +3091,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
&bus->regs->tosbmailboxdata, retries); &bus->regs->tosbmailboxdata, retries);
enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2); enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, NULL); bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable, NULL);
/* Give the dongle some time to do its thing and set IOR2 */ /* Give the dongle some time to do its thing and set IOR2 */
dhd_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000); dhd_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
...@@ -3099,7 +3099,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex) ...@@ -3099,7 +3099,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
ready = 0; ready = 0;
while (ready != enable && !dhd_timeout_expired(&tmo)) while (ready != enable && !dhd_timeout_expired(&tmo))
ready = ready =
bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IORx,
NULL); NULL);
DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n", DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
...@@ -3136,7 +3136,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex) ...@@ -3136,7 +3136,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
else { else {
/* Disable F2 again */ /* Disable F2 again */
enable = SDIO_FUNC_ENABLE_1; enable = SDIO_FUNC_ENABLE_1;
bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, enable, bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
NULL); NULL);
} }
...@@ -5018,7 +5018,7 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp) ...@@ -5018,7 +5018,7 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
if (!bus->dpc_sched) { if (!bus->dpc_sched) {
u8 devpend; u8 devpend;
devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0,
SDIOD_CCCR_INTPEND, SDIO_CCCR_INTx,
NULL); NULL);
intstatus = intstatus =
devpend & (INTR_STATUS_FUNC1 | devpend & (INTR_STATUS_FUNC1 |
...@@ -5150,35 +5150,6 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen) ...@@ -5150,35 +5150,6 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
} }
#endif /* DHD_DEBUG */ #endif /* DHD_DEBUG */
#ifdef DHD_DEBUG
static void dhd_dump_cis(uint fn, u8 *cis)
{
uint byte, tag, tdata;
DHD_INFO(("Function %d CIS:\n", fn));
for (tdata = byte = 0; byte < SBSDIO_CIS_SIZE_LIMIT; byte++) {
if ((byte % 16) == 0)
DHD_INFO((" "));
DHD_INFO(("%02x ", cis[byte]));
if ((byte % 16) == 15)
DHD_INFO(("\n"));
if (!tdata--) {
tag = cis[byte];
if (tag == 0xff)
break;
else if (!tag)
tdata = 0;
else if ((byte + 1) < SBSDIO_CIS_SIZE_LIMIT)
tdata = cis[byte + 1] + 1;
else
DHD_INFO(("]"));
}
}
if ((byte % 16) != 15)
DHD_INFO(("\n"));
}
#endif /* DHD_DEBUG */
static bool dhdsdio_chipmatch(u16 chipid) static bool dhdsdio_chipmatch(u16 chipid)
{ {
if (chipid == BCM4325_CHIP_ID) if (chipid == BCM4325_CHIP_ID)
...@@ -5376,56 +5347,6 @@ dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid) ...@@ -5376,56 +5347,6 @@ dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid)
err, DHD_INIT_CLKCTL1, clkctl)); err, DHD_INIT_CLKCTL1, clkctl));
goto fail; goto fail;
} }
#ifdef DHD_DEBUG
if (DHD_INFO_ON()) {
uint fn, numfn;
u8 *cis[SDIOD_MAX_IOFUNCS];
int err = 0;
numfn = bcmsdh_query_iofnum(sdh);
ASSERT(numfn <= SDIOD_MAX_IOFUNCS);
/* Make sure ALP is available before trying to read CIS */
SPINWAIT(((clkctl = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
NULL)),
!SBSDIO_ALPAV(clkctl)), PMU_MAX_TRANSITION_DLY);
/* Now request ALP be put on the bus */
bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
DHD_INIT_CLKCTL2, &err);
udelay(65);
for (fn = 0; fn <= numfn; fn++) {
cis[fn] = kzalloc(SBSDIO_CIS_SIZE_LIMIT, GFP_ATOMIC);
if (!cis[fn]) {
DHD_INFO(("dhdsdio_probe: fn %d cis malloc "
"failed\n", fn));
break;
}
err = bcmsdh_cis_read(sdh, fn, cis[fn],
SBSDIO_CIS_SIZE_LIMIT);
if (err) {
DHD_INFO(("dhdsdio_probe: fn %d cis read "
"err %d\n", fn, err));
kfree(cis[fn]);
break;
}
dhd_dump_cis(fn, cis[fn]);
}
while (fn-- > 0) {
ASSERT(cis[fn]);
kfree(cis[fn]);
}
if (err) {
DHD_ERROR(("dhdsdio_probe: error read/parsing CIS\n"));
goto fail;
}
}
#endif /* DHD_DEBUG */
if (dhdsdio_chip_attach(bus, regsva)) { if (dhdsdio_chip_attach(bus, regsva)) {
DHD_ERROR(("%s: dhdsdio_chip_attach failed!\n", __func__)); DHD_ERROR(("%s: dhdsdio_chip_attach failed!\n", __func__));
...@@ -5534,7 +5455,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh) ...@@ -5534,7 +5455,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
#endif /* SDTEST */ #endif /* SDTEST */
/* Disable F2 to clear any intermediate frame state on the dongle */ /* Disable F2 to clear any intermediate frame state on the dongle */
bcmsdh_cfg_write(sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, SDIO_FUNC_ENABLE_1, bcmsdh_cfg_write(sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, SDIO_FUNC_ENABLE_1,
NULL); NULL);
bus->dhd->busstate = DHD_BUS_DOWN; bus->dhd->busstate = DHD_BUS_DOWN;
...@@ -6262,7 +6183,7 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs) ...@@ -6262,7 +6183,7 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
CORE_CC_REG(ci->cccorebase, gpiopulldown), 4, 0); CORE_CC_REG(ci->cccorebase, gpiopulldown), 4, 0);
/* Disable F2 to clear any intermediate frame state on the dongle */ /* Disable F2 to clear any intermediate frame state on the dongle */
bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IOEN, bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL); SDIO_FUNC_ENABLE_1, NULL);
/* WAR: cmd52 backplane read so core HW will drop ALPReq */ /* WAR: cmd52 backplane read so core HW will drop ALPReq */
......
This diff is collapsed.
...@@ -38,6 +38,27 @@ extern const uint bcmsdh_msglevel; ...@@ -38,6 +38,27 @@ extern const uint bcmsdh_msglevel;
#define BCMSDH_INFO(x) #define BCMSDH_INFO(x)
#endif /* BCMDBG */ #endif /* BCMDBG */
#define SDIO_FUNC_0 0
#define SDIO_FUNC_1 1
#define SDIO_FUNC_2 2
#define SDIOD_FBR_SIZE 0x100
/* io_en */
#define SDIO_FUNC_ENABLE_1 0x02
#define SDIO_FUNC_ENABLE_2 0x04
/* io_rdys */
#define SDIO_FUNC_READY_1 0x02
#define SDIO_FUNC_READY_2 0x04
/* intr_status */
#define INTR_STATUS_FUNC1 0x2
#define INTR_STATUS_FUNC2 0x4
/* Maximum number of I/O funcs */
#define SDIOD_MAX_IOFUNCS 7
/* forward declarations */ /* forward declarations */
typedef struct bcmsdh_info bcmsdh_info_t; typedef struct bcmsdh_info bcmsdh_info_t;
typedef void (*bcmsdh_cb_fn_t) (void *); typedef void (*bcmsdh_cb_fn_t) (void *);
......
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