diff options
author | Franky Lin <frankyl@broadcom.com> | 2011-11-04 17:23:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-09 16:14:02 -0500 |
commit | d8f64a425b3a79e7d276e438ad7246c916a4b195 (patch) | |
tree | 84fc33b1cc1d8a7acde2dd4445af00475cfdc181 /drivers/net/wireless/brcm80211 | |
parent | a97e4fc5ae4b00187b25a8216a61b2105efa9c60 (diff) |
brcm80211: fmac: abstract chip iscoreup function
Prepare for adding backplane interconnect type support
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h | 3 |
3 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index 868cb9deacaa..30802a0d5291 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -3138,7 +3138,6 @@ brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_dev *sdiodev, u32 corebase) | |||
3138 | static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter) | 3138 | static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter) |
3139 | { | 3139 | { |
3140 | uint retries; | 3140 | uint retries; |
3141 | u32 regdata; | ||
3142 | int bcmerror = 0; | 3141 | int bcmerror = 0; |
3143 | 3142 | ||
3144 | /* To enter download state, disable ARM and reset SOCRAM. | 3143 | /* 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 | (u8 *)&zeros, 4); | 3158 | (u8 *)&zeros, 4); |
3160 | } | 3159 | } |
3161 | } else { | 3160 | } else { |
3162 | regdata = brcmf_sdcard_reg_read(bus->sdiodev, | 3161 | if (!brcmf_sdio_chip_iscoreup(bus->sdiodev, |
3163 | CORE_SB(bus->ci->ramcorebase, sbtmstatelow), 4); | 3162 | bus->ci->ramcorebase)) { |
3164 | regdata &= (SBTML_RESET | SBTML_REJ_MASK | | ||
3165 | (SICF_CLOCK_EN << SBTML_SICF_SHIFT)); | ||
3166 | if ((SICF_CLOCK_EN << SBTML_SICF_SHIFT) != regdata) { | ||
3167 | brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n"); | 3163 | brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n"); |
3168 | bcmerror = -EBADE; | 3164 | bcmerror = -EBADE; |
3169 | goto fail; | 3165 | goto fail; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c index 10befbfa7e1f..e0c22c4b8df9 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c | |||
@@ -52,6 +52,19 @@ | |||
52 | #define SBIDH_VC_MASK 0xffff0000 /* vendor code */ | 52 | #define SBIDH_VC_MASK 0xffff0000 /* vendor code */ |
53 | #define SBIDH_VC_SHIFT 16 | 53 | #define SBIDH_VC_SHIFT 16 |
54 | 54 | ||
55 | bool | ||
56 | brcmf_sdio_chip_iscoreup(struct brcmf_sdio_dev *sdiodev, | ||
57 | u32 corebase) | ||
58 | { | ||
59 | u32 regdata; | ||
60 | |||
61 | regdata = brcmf_sdcard_reg_read(sdiodev, | ||
62 | CORE_SB(corebase, sbtmstatelow), 4); | ||
63 | regdata &= (SBTML_RESET | SBTML_REJ_MASK | | ||
64 | (SICF_CLOCK_EN << SBTML_SICF_SHIFT)); | ||
65 | return ((SICF_CLOCK_EN << SBTML_SICF_SHIFT) == regdata); | ||
66 | } | ||
67 | |||
55 | void | 68 | void |
56 | brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, u32 corebase) | 69 | brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, u32 corebase) |
57 | { | 70 | { |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h index 25ac3857039e..9c43e1decf9e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h | |||
@@ -133,7 +133,8 @@ struct sbconfig { | |||
133 | u32 sbidhigh; /* identification */ | 133 | u32 sbidhigh; /* identification */ |
134 | }; | 134 | }; |
135 | 135 | ||
136 | 136 | extern bool brcmf_sdio_chip_iscoreup(struct brcmf_sdio_dev *sdiodev, | |
137 | u32 corebase); | ||
137 | extern void brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, | 138 | extern void brcmf_sdio_chip_coredisable(struct brcmf_sdio_dev *sdiodev, |
138 | u32 corebase); | 139 | u32 corebase); |
139 | extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, | 140 | extern int brcmf_sdio_chip_attach(struct brcmf_sdio_dev *sdiodev, |