Commit 3c7c07ca authored by Hector Martin's avatar Hector Martin Committed by Kalle Valo

wifi: brcmfmac: chip: Only disable D11 cores; handle an arbitrary number

At least on BCM4387, the D11 cores are held in reset on cold startup and
firmware expects to release reset itself. Just assert reset here and let
firmware deassert it. Premature deassertion results in the firmware
failing to initialize properly some of the time, with strange AXI bus
errors.

Also, BCM4387 has 3 cores, up from 2. The logic for handling that is in
brcmf_chip_ai_resetcore(), but since we aren't using that any more, just
handle it here.
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarHector Martin <marcan@marcan.st>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230214092423.15175-1-marcan@marcan.st
parent ec52d77d
...@@ -1292,15 +1292,18 @@ static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) ...@@ -1292,15 +1292,18 @@ static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip)
static inline void static inline void
brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip)
{ {
int i;
struct brcmf_core *core; struct brcmf_core *core;
brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4);
core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); /* Disable the cores only and let the firmware enable them.
brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | * Releasing reset ourselves breaks BCM4387 in weird ways.
D11_BCMA_IOCTL_PHYCLOCKEN, */
D11_BCMA_IOCTL_PHYCLOCKEN, for (i = 0; (core = brcmf_chip_get_d11core(&chip->pub, i)); i++)
D11_BCMA_IOCTL_PHYCLOCKEN); brcmf_chip_coredisable(core, D11_BCMA_IOCTL_PHYRESET |
D11_BCMA_IOCTL_PHYCLOCKEN,
D11_BCMA_IOCTL_PHYCLOCKEN);
} }
static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec) static bool brcmf_chip_cr4_set_active(struct brcmf_chip_priv *chip, u32 rstvec)
......
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