Last active
December 20, 2021 11:09
-
-
Save marcan/9c724c633f50ec16f159cc5f1ab2928c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 71f7c79c7af817477e553103c9eb03926e12ada4 | |
Author: Hector Martin <marcan@marcan.st> | |
Date: Mon Dec 20 20:00:57 2021 +0900 | |
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 causes weird | |
nondeterministic AXI errors on firmware startup. | |
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. | |
(Does this work on all chips?) | |
Signed-off-by: Hector Martin <marcan@marcan.st> | |
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | |
index 1ee49f9e325d..7997bd9f5399 100644 | |
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | |
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | |
@@ -1285,15 +1285,19 @@ static bool brcmf_chip_cm3_set_active(struct brcmf_chip_priv *chip) | |
static inline void | |
brcmf_chip_cr4_set_passive(struct brcmf_chip_priv *chip) | |
{ | |
+ int i; | |
struct brcmf_core *core; | |
brcmf_chip_disable_arm(chip, BCMA_CORE_ARM_CR4); | |
- core = brcmf_chip_get_core(&chip->pub, BCMA_CORE_80211); | |
- brcmf_chip_resetcore(core, D11_BCMA_IOCTL_PHYRESET | | |
- D11_BCMA_IOCTL_PHYCLOCKEN, | |
- D11_BCMA_IOCTL_PHYCLOCKEN, | |
- D11_BCMA_IOCTL_PHYCLOCKEN); | |
+ /* | |
+ * Disable the cores only and let the firmware enable them. | |
+ * Releasing reset ourselves breaks BCM4387 in weird ways. | |
+ */ | |
+ for (i = 0; (core = brcmf_chip_get_d11core(&chip->pub, i)); i++) | |
+ 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment