RPi-3 brcmfmac errors on boot

Michael Zoran mzoran at crowfest.net
Wed Nov 23 14:02:59 PST 2016


On Wed, 2016-11-23 at 16:48 -0500, Don Zickus wrote:
> On Wed, Nov 23, 2016 at 12:16:27PM -0800, Michael Zoran wrote:
> > On Wed, 2016-11-23 at 12:00 -0800, Michael Zoran wrote:
> > > On Wed, 2016-11-23 at 14:35 -0500, Don Zickus wrote:
> > > > Hi,
> > > > 
> > > > I am trying to get bluetooth working on the RPi-3 and realized
> > > > I
> > > > needed some
> > > > out-of-box drivers in Gerd's tree:
> > > > 
> > > > https://www.kraxel.org/cgit/linux/log/?h=bcm2837-wifi
> > > > 
> > > > Combining his tree with a patch to remove pwr
> > > > 
> > > > https://github.com/anholt/linux/commit/a44e87b47148c6ee6b78509f
> > > > 47e6
> > > > a1
> > > > 5c0fae890a
> > > > 
> > > > I can get the SDIO device detected and the brcmfmac driver to
> > > > probe
> > > > it.
> > > > 
> > > > However, that results in the following error message:
> > > > 
> > > > """
> > > > brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl
> > > > 0x50
> > > > """
> > > > 
> > > > and neither the wifi nor bluetooth device get detected and
> > > > added to
> > > > the bus.
> > > > 
> > > 
> > > I see this alot on the downstream tree if the firmware file
> > > hasn't
> > > been
> > > copied from Raspbian.   So just to ask an obvious question, did
> > > you
> > > copy the firmware file?
> > > 
> > > 
> > 
> > BTW, does your tree have the patches from the downstream tree to
> > add
> > the hardware identifiers so that the firmware can load?
> 
> Hmm, don't know.  Can you repost with 'diff -rup'?  It is a little
> easier
> for me to read, save and apply those patches.
> 

I don't know if these changes make a difference though in terms of
functionality.   They may have added some of these changes for
regulatory/government reasons.

diff -rup linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
--- linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c	
2016-11-22 13:23:02.782069616 -0800
+++ linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c2016-
11-23 12:11:15.859584578 -0800
@@ -2756,6 +2756,8 @@ brcmf_cfg80211_set_power_mgmt(struct wip
 	 * preference in cfg struct to apply this to
 	 * FW later while initializing the dongle
 	 */
+	pr_info("power management disabled\n");
+	enabled = false;
 	cfg->pwr_save = enabled;
 	if (!check_vif_up(ifp->vif)) {
 
@@ -4750,12 +4752,15 @@ static int brcmf_cfg80211_stop_ap(struct
 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
 		if (err < 0)
 			brcmf_err("BRCMF_C_DOWN error %d\n", err);
-		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
-		if (err < 0)
-			brcmf_err("setting AP mode failed %d\n", err);
+
 		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA,
0);
 		if (err < 0)
 			brcmf_err("setting INFRA mode failed %d\n",
err);
+
+		err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
+		if (err < 0)
+			brcmf_err("setting AP mode failed %d\n", err);
+
 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
 			brcmf_fil_iovar_int_set(ifp, "mbss", 0);
 		brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
@@ -6737,12 +6742,18 @@ static s32 brcmf_translate_country_code(
 	struct brcmfmac_pd_cc *country_codes;
 	struct brcmfmac_pd_cc_entry *cc;
 	s32 found_index;
+	char ccode[BRCMF_COUNTRY_BUF_SZ];
+	int rev;
 	int i;
 
+	memcpy(ccode, alpha2, sizeof(ccode));
+	rev = -1;
+
 	country_codes = drvr->settings->country_codes;
 	if (!country_codes) {
-		brcmf_dbg(TRACE, "No country codes configured for
device\n");
-		return -EINVAL;
+		brcmf_dbg(TRACE, "No country codes configured for
device"
+				 " - use requested value\n");
+		goto use_input_value;
 	}
 
 	if ((alpha2[0] == ccreq->country_abbrev[0]) &&
@@ -6766,10 +6777,14 @@ static s32 brcmf_translate_country_code(
 		brcmf_dbg(TRACE, "No country code match found\n");
 		return -EINVAL;
 	}
-	memset(ccreq, 0, sizeof(*ccreq));
-	ccreq->rev = cpu_to_le32(country_codes-
>table[found_index].rev);
-	memcpy(ccreq->ccode, country_codes->table[found_index].cc,
+	rev = country_codes->table[found_index].rev;
+	memcpy(ccode, country_codes->table[found_index].cc,
 	       BRCMF_COUNTRY_BUF_SZ);
+
+use_input_value:
+	memset(ccreq, 0, sizeof(*ccreq));
+	ccreq->rev = cpu_to_le32(rev);
+	memcpy(ccreq->ccode, ccode, sizeof(ccode));
 	ccreq->country_abbrev[0] = alpha2[0];
 	ccreq->country_abbrev[1] = alpha2[1];
 	ccreq->country_abbrev[2] = 0;
diff -rup linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c linux-
rpi-fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
--- linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c	
2016-11-22 13:23:02.782069616 -0800
+++ linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c	
2016-11-22 18:26:28.970879025 -0800
@@ -69,7 +69,7 @@ static int brcmf_fcmode;
 module_param_named(fcmode, brcmf_fcmode, int, 0);
 MODULE_PARM_DESC(fcmode, "Mode of firmware signalled flow control");
 
-static int brcmf_roamoff;
+static int brcmf_roamoff = 1;
 module_param_named(roamoff, brcmf_roamoff, int, S_IRUSR);
 MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine");
 
diff -rup linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c linux-
rpi-fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
--- linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c2016-11-
22 13:23:02.782069616 -0800
+++ linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c	20
16-11-23 12:11:15.863584608 -0800
@@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-s
 BRCMF_FW_NVRAM_DEF(4330, "brcmfmac4330-sdio.bin", "brcmfmac4330-
sdio.txt");
 BRCMF_FW_NVRAM_DEF(4334, "brcmfmac4334-sdio.bin", "brcmfmac4334-
sdio.txt");
 BRCMF_FW_NVRAM_DEF(43340, "brcmfmac43340-sdio.bin", "brcmfmac43340-
sdio.txt");
+BRCMF_FW_NVRAM_DEF(43341, "brcmfmac43341-sdio.bin", "brcmfmac43341-
sdio.txt");
 BRCMF_FW_NVRAM_DEF(4335, "brcmfmac4335-sdio.bin", "brcmfmac4335-
sdio.txt");
 BRCMF_FW_NVRAM_DEF(43362, "brcmfmac43362-sdio.bin", "brcmfmac43362-
sdio.txt");
 BRCMF_FW_NVRAM_DEF(4339, "brcmfmac4339-sdio.bin", "brcmfmac4339-
sdio.txt");
@@ -621,6 +622,7 @@ static struct brcmf_firmware_mapping brc
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330),
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334),
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF,
43340),
+	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43341_CHIP_ID, 0xFFFFFFFF,
43341),
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4335_CHIP_ID, 0xFFFFFFFF, 4335),
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE,
43362),
 	BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
diff -rup linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h
--- linux-kernel-
stable/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h	
2016-11-22 13:23:02.798069723 -0800
+++ linux-rpi-
fresh/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h	
2016-11-23 12:11:15.863584608 -0800
@@ -36,6 +36,7 @@
 #define BRCM_CC_4330_CHIP_ID		0x4330
 #define BRCM_CC_4334_CHIP_ID		0x4334
 #define BRCM_CC_43340_CHIP_ID		43340
+#define BRCM_CC_43341_CHIP_ID		43341
 #define BRCM_CC_43362_CHIP_ID		43362
 #define BRCM_CC_4335_CHIP_ID		0x4335
 #define BRCM_CC_4339_CHIP_ID		0x4339




More information about the linux-rpi-kernel mailing list