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

brcm80211: fmac: abstract chip iscoreup function

Prepare for adding backplane interconnect type support
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a97e4fc5
...@@ -3138,7 +3138,6 @@ brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_dev *sdiodev, u32 corebase) ...@@ -3138,7 +3138,6 @@ brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_dev *sdiodev, u32 corebase)
static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter) static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
{ {
uint retries; uint retries;
u32 regdata;
int bcmerror = 0; int bcmerror = 0;
/* To enter download state, disable ARM and reset SOCRAM. /* To enter download state, disable ARM and reset SOCRAM.
...@@ -3159,11 +3158,8 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter) ...@@ -3159,11 +3158,8 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
(u8 *)&zeros, 4); (u8 *)&zeros, 4);
} }
} else { } else {
regdata = brcmf_sdcard_reg_read(bus->sdiodev, if (!brcmf_sdio_chip_iscoreup(bus->sdiodev,
CORE_SB(bus->ci->ramcorebase, sbtmstatelow), 4); bus->ci->ramcorebase)) {
regdata &= (SBTML_RESET | SBTML_REJ_MASK |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
if ((SICF_CLOCK_EN << SBTML_SICF_SHIFT) != regdata) {
brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n"); brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n");
bcmerror = -EBADE; bcmerror = -EBADE;
goto fail; goto fail;
......
...@@ -52,6 +52,19 @@ ...@@ -52,6 +52,19 @@
#define SBIDH_VC_MASK 0xffff0000 /* vendor code */ #define SBIDH_VC_MASK 0xffff0000 /* vendor code */
#define SBIDH_VC_SHIFT 16 #define SBIDH_VC_SHIFT 16
bool
brcmf_sdio_chip_iscoreup(struct brcmf_sdio_dev *sdiodev,
u32 corebase)
{
u32 regdata;
regdata = brcmf_sdcard_reg_read(sdiodev,
CORE_SB(corebase, sbtmstatelow), 4);
regdata &= (SBTML_RESET | SBTML_REJ_MASK |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
return ((SICF_CLOCK_EN << SBTML_SICF_SHIFT) == regdata);
}
void void
brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, u32 corebase) brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, u32 corebase)
{ {
......
...@@ -133,7 +133,8 @@ struct sbconfig { ...@@ -133,7 +133,8 @@ struct sbconfig {
u32 sbidhigh; /* identification */ u32 sbidhigh; /* identification */
}; };
extern bool brcmf_sdio_chip_iscoreup(struct brcmf_sdio_dev *sdiodev,
u32 corebase);
extern void brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, extern void brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev,
u32 corebase); u32 corebase);
extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev,
......
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