Skip to contentSkip to conversation

brcmfmac: add support for BCM4359 SDIO chipset

PATCH In review Soeren Moch 9 participants 32 messages Dec 11, 2019 – Mar 15, 2020 1 message not in the archive

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover brcmfmac: add support for BCM4359 SDIO chipset

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)

---
Cc: Kalle Valo <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

--
2.17.1

#1 lore raw

PATCH v2 1/9 brcmfmac: reset two D11 cores if chip has two D11 cores

From: Wright Feng <[email protected]>

There are two D11 cores in RSDB chips like 4359. We have to reset two D11 cores simutaneously before firmware download, or the firmware may not be initialized correctly and cause "fw initialized failed" error.

---
changes in v2:
- add missing s-o-b
- add review tag received for v1

---
 .../broadcom/brcm80211/brcmfmac/chip.c        | 50 +++++++++++++++++++
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 3 files changed, 52 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +50 -0
index a795d781b4c5..0b5fbe5d8270 100644
@@ -433,11 +433,25 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset,
 {
 	struct brcmf_chip_priv *ci;
 	int count;
+	struct brcmf_core *d11core2 = NULL;
+	struct brcmf_core_priv *d11priv2 = NULL;
 
 	ci = core->chip;
 
+	/* special handle two D11 cores reset */
+	if (core->pub.id == BCMA_CORE_80211) {
+		d11core2 = brcmf_chip_get_d11core(&ci->pub, 1);
+		if (d11core2) {
+			brcmf_dbg(INFO, "found two d11 cores, reset both\n");
+			d11priv2 = container_of(d11core2,
+						struct brcmf_core_priv, pub);
+		}
+	}
+
 	/* must disable first to work for arbitrary current core state */
 	brcmf_chip_ai_coredisable(core, prereset, reset);
+	if (d11priv2)
+		brcmf_chip_ai_coredisable(d11priv2, prereset, reset);
 
 	count = 0;
 	while (ci->ops->read32(ci->ctx, core->wrapbase + BCMA_RESET_CTL) &
@@ -449,9 +463,30 @@ static void brcmf_chip_ai_resetcore(struct brcmf_core_priv *core, u32 prereset,
 		usleep_range(40, 60);
 	}
 
+	if (d11priv2) {
+		count = 0;
+		while (ci->ops->read32(ci->ctx,
+				       d11priv2->wrapbase + BCMA_RESET_CTL) &
+				       BCMA_RESET_CTL_RESET) {
+			ci->ops->write32(ci->ctx,
+					 d11priv2->wrapbase + BCMA_RESET_CTL,
+					 0);
+			count++;
+			if (count > 50)
+				break;
+			usleep_range(40, 60);
+		}
+	}
+
 	ci->ops->write32(ci->ctx, core->wrapbase + BCMA_IOCTL,
 			 postreset | BCMA_IOCTL_CLK);
 	ci->ops->read32(ci->ctx, core->wrapbase + BCMA_IOCTL);
+
+	if (d11priv2) {
+		ci->ops->write32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL,
+				 postreset | BCMA_IOCTL_CLK);
+		ci->ops->read32(ci->ctx, d11priv2->wrapbase + BCMA_IOCTL);
+	}
 }
 
 char *brcmf_chip_name(u32 id, u32 rev, char *buf, uint len)
@@ -1109,6 +1144,21 @@ void brcmf_chip_detach(struct brcmf_chip *pub)
 	kfree(chip);
 }
 
+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit)
+{
+	struct brcmf_chip_priv *chip;
+	struct brcmf_core_priv *core;
+
+	chip = container_of(pub, struct brcmf_chip_priv, pub);
+	list_for_each_entry(core, &chip->cores, list) {
+		if (core->pub.id == BCMA_CORE_80211) {
+			if (unit-- == 0)
+				return &core->pub;
+		}
+	}
+	return NULL;
+}
+
 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *pub, u16 coreid)
 {
 	struct brcmf_chip_priv *chip;
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h +1 -0
index 7b00f6a59e89..8fa38658e727 100644
@@ -74,6 +74,7 @@ struct brcmf_chip *brcmf_chip_attach(void *ctx,
 				     const struct brcmf_buscore_ops *ops);
 void brcmf_chip_detach(struct brcmf_chip *chip);
 struct brcmf_core *brcmf_chip_get_core(struct brcmf_chip *chip, u16 coreid);
+struct brcmf_core *brcmf_chip_get_d11core(struct brcmf_chip *pub, u8 unit);
 struct brcmf_core *brcmf_chip_get_chipcommon(struct brcmf_chip *chip);
 struct brcmf_core *brcmf_chip_get_pmu(struct brcmf_chip *pub);
 bool brcmf_chip_iscoreup(struct brcmf_core *core);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +1 -1
index f64ce5074a55..7ac72804e285 100644
@@ -78,7 +78,7 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
 	BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
 };
 
-#define BRCMF_PCIE_FW_UP_TIMEOUT		2000 /* msec */
+#define BRCMF_PCIE_FW_UP_TIMEOUT		5000 /* msec */
 
 #define BRCMF_PCIE_REG_MAP_SIZE			(32 * 1024)
 

--
2.17.1

#2 lore raw

Re: [PATCH v2 1/9] brcmfmac: reset two D11 cores if chip has two D11 cores

Quoted 9 lines · Soeren Moch

From: Wright Feng <[email protected]>

There are two D11 cores in RSDB chips like 4359. We have to reset two D11 cores simutaneously before firmware download, or the firmware may not be initialized correctly and cause "fw initialized failed" error.

7 patches applied to wireless-drivers-next.git, thanks.

1b8d2e0a9e42 brcmfmac: reset two D11 cores if chip has two D11 cores 172f6854551d brcmfmac: set F2 blocksize and watermark for 4359 6647274ed995 brcmfmac: fix rambase for 4359/9
c12c8913d79c brcmfmac: make errors when setting roaming parameters non-fatal d4aef159394d brcmfmac: add support for BCM4359 SDIO chipset 837482e69a3f brcmfmac: add RSDB condition when setting interface combinations 2635853ce4ab brcmfmac: not set mbss in vif if firmware does not support MBSS

Signature · 3 lines
https://patchwork.kernel.org/patch/11286565/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw

Re: [PATCH v2 1/9] brcmfmac: reset two D11 cores if chip has two D11 cores

In reply to Soeren Moch
Quoted 9 lines · Soeren Moch

From: Wright Feng <[email protected]>

There are two D11 cores in RSDB chips like 4359. We have to reset two D11 cores simutaneously before firmware download, or the firmware may not be initialized correctly and cause "fw initialized failed" error.

7 patches applied to wireless-drivers-next.git, thanks.

1b8d2e0a9e42 brcmfmac: reset two D11 cores if chip has two D11 cores 172f6854551d brcmfmac: set F2 blocksize and watermark for 4359 6647274ed995 brcmfmac: fix rambase for 4359/9
c12c8913d79c brcmfmac: make errors when setting roaming parameters non-fatal d4aef159394d brcmfmac: add support for BCM4359 SDIO chipset 837482e69a3f brcmfmac: add RSDB condition when setting interface combinations 2635853ce4ab brcmfmac: not set mbss in vif if firmware does not support MBSS

Signature · 3 lines
https://patchwork.kernel.org/patch/11286565/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw

PATCH v2 2/9 brcmfmac: set F2 blocksize and watermark for 4359

In reply to Soeren Moch

From: Chung-Hsien Hsu <[email protected]>

Set F2 blocksize to 256 bytes and watermark to 0x40 for 4359. Also enable and configure F1 MesBusyCtrl. It fixes DMA error while having UDP bi-directional traffic.

[slightly adapted for rebase on mainline linux]

---
changes in v2:
- add review tag received for v1

---
 .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c |  6 +++++-
 .../wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 15 +++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +5 -1
index 96fd8e2bf773..68baf0189305 100644
@@ -43,6 +43,7 @@
 
 #define SDIO_FUNC1_BLOCKSIZE		64
 #define SDIO_FUNC2_BLOCKSIZE		512
+#define SDIO_4359_FUNC2_BLOCKSIZE	256
 /* Maximum milliseconds to wait for F2 to come up */
 #define SDIO_WAIT_F2RDY	3000
 
@@ -903,6 +904,7 @@ static void brcmf_sdiod_host_fixup(struct mmc_host *host)
 static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
 {
 	int ret = 0;
+	unsigned int f2_blksz = SDIO_FUNC2_BLOCKSIZE;
 
 	sdio_claim_host(sdiodev->func1);
 
@@ -912,7 +914,9 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
 		sdio_release_host(sdiodev->func1);
 		goto out;
 	}
-	ret = sdio_set_block_size(sdiodev->func2, SDIO_FUNC2_BLOCKSIZE);
+	if (sdiodev->func2->device == SDIO_DEVICE_ID_BROADCOM_4359)
+		f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE;
+	ret = sdio_set_block_size(sdiodev->func2, f2_blksz);
 	if (ret) {
 		brcmf_err("Failed to set F2 blocksize\n");
 		sdio_release_host(sdiodev->func1);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +15 -0
index 264ad63232f8..21e535072f3f 100644
@@ -42,6 +42,8 @@
 #define DEFAULT_F2_WATERMARK    0x8
 #define CY_4373_F2_WATERMARK    0x40
 #define CY_43012_F2_WATERMARK    0x60
+#define CY_4359_F2_WATERMARK	0x40
+#define CY_4359_F1_MESBUSYCTRL	(CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB)
 
 #ifdef DEBUG
 
@@ -4205,6 +4207,19 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
 			brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
 					   &err);
 			break;
+		case SDIO_DEVICE_ID_BROADCOM_4359:
+			brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n",
+				  CY_4359_F2_WATERMARK);
+			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
+					   CY_4359_F2_WATERMARK, &err);
+			devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL,
+						   &err);
+			devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
+			brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
+					   &err);
+			brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL,
+					   CY_4359_F1_MESBUSYCTRL, &err);
+			break;
 		default:
 			brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
 					   DEFAULT_F2_WATERMARK, &err);

--
2.17.1

#5 lore raw

PATCH v2 3/9 brcmfmac: fix rambase for 4359/9

In reply to Soeren Moch

Newer 4359 chip revisions need a different rambase address. This fixes firmware download on such devices which fails otherwise.

---
changes in v2: none

Cc Kalle Valo <[email protected]>
Cc Heiko Stuebner <[email protected]>
Cc Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Hante Meuleman <hante.meuleman-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Chi-Hsien Lin <chi-hsien.lin-+wT8y+m8/[email protected]>
Cc Wright Feng <wright.feng-+wT8y+m8/[email protected]>
Cc brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/[email protected]
Cc brcm80211-dev-list-+wT8y+m8/[email protected]
Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +2 -1
index 0b5fbe5d8270..baf72e3984fc 100644
@@ -712,7 +712,6 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
 	case BRCM_CC_43569_CHIP_ID:
 	case BRCM_CC_43570_CHIP_ID:
 	case BRCM_CC_4358_CHIP_ID:
-	case BRCM_CC_4359_CHIP_ID:
 	case BRCM_CC_43602_CHIP_ID:
 	case BRCM_CC_4371_CHIP_ID:
 		return 0x180000;
@@ -722,6 +721,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
 	case BRCM_CC_4366_CHIP_ID:
 	case BRCM_CC_43664_CHIP_ID:
 		return 0x200000;
+	case BRCM_CC_4359_CHIP_ID:
+		return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000;
 	case CY_CC_4373_CHIP_ID:
 		return 0x160000;
 	default:

--
2.17.1

Acked-by on v2 3/9
#6 lore raw

Re: [PATCH v2 3/9] brcmfmac: fix rambase for 4359/9

Quoted 4 lines · Soeren Moch

Newer 4359 chip revisions need a different rambase address. This fixes firmware download on such devices which fails otherwise.

Quoted 47 lines

---
changes in v2: none

Cc Kalle Valo <[email protected]>
Cc Heiko Stuebner <[email protected]>
Cc Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Hante Meuleman <hante.meuleman-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Chi-Hsien Lin <chi-hsien.lin-+wT8y+m8/[email protected]>
Cc Wright Feng <wright.feng-+wT8y+m8/[email protected]>
Cc brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/[email protected]
Cc brcm80211-dev-list-+wT8y+m8/[email protected]
Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +2 -2
index 0b5fbe5d8270..baf72e3984fc 100644
@@ -712,7 +712,6 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
  	case BRCM_CC_43569_CHIP_ID:
  	case BRCM_CC_43570_CHIP_ID:
  	case BRCM_CC_4358_CHIP_ID:
-	case BRCM_CC_4359_CHIP_ID:
  	case BRCM_CC_43602_CHIP_ID:
  	case BRCM_CC_4371_CHIP_ID:
  		return 0x180000;
@@ -722,6 +721,8 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci)
  	case BRCM_CC_4366_CHIP_ID:
  	case BRCM_CC_43664_CHIP_ID:
  		return 0x200000;
+	case BRCM_CC_4359_CHIP_ID:
+		return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000;
  	case CY_CC_4373_CHIP_ID:
  		return 0x160000;
  	default:
--

2.17.1

.

#7 lore raw

PATCH v2 4/9 brcmfmac: make errors when setting roaming parameters non-fatal

In reply to Soeren Moch

4359 dongles do not support setting roaming parameters (error -52). Do not fail the 80211 configuration in this case.

---
changes in v2:
- add ack tag received for v1

---
 .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c    | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +4 -6
index 5598bbd09b62..0cf13cea1dbe 100644
@@ -6012,19 +6012,17 @@ static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
 	roamtrigger[1] = cpu_to_le32(BRCM_BAND_ALL);
 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_TRIGGER,
 				     (void *)roamtrigger, sizeof(roamtrigger));
-	if (err) {
+	if (err)
 		bphy_err(drvr, "WLC_SET_ROAM_TRIGGER error (%d)\n", err);
-		goto roam_setup_done;
-	}
 
 	roam_delta[0] = cpu_to_le32(WL_ROAM_DELTA);
 	roam_delta[1] = cpu_to_le32(BRCM_BAND_ALL);
 	err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_ROAM_DELTA,
 				     (void *)roam_delta, sizeof(roam_delta));
-	if (err) {
+	if (err)
 		bphy_err(drvr, "WLC_SET_ROAM_DELTA error (%d)\n", err);
-		goto roam_setup_done;
-	}
+
+	return 0;
 
 roam_setup_done:
 	return err;

--
2.17.1

#8 lore raw

PATCH v2 5/9 brcmfmac: add support for BCM4359 SDIO chipset

In reply to Soeren Moch

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <wright.feng-+wT8y+m8/[email protected]>

---
changes in v2:
- add SDIO_DEVICE_ID_CYPRESS_89359 as requested
by Chi-Hsien Lin <chi-hsien.lin-+wT8y+m8/[email protected]>

Cc Kalle Valo <[email protected]>
Cc Heiko Stuebner <[email protected]>
Cc Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Hante Meuleman <hante.meuleman-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Chi-Hsien Lin <chi-hsien.lin-+wT8y+m8/[email protected]>
Cc Wright Feng <wright.feng-+wT8y+m8/[email protected]>
Cc brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/[email protected]
Cc brcm80211-dev-list-+wT8y+m8/[email protected]
Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
 include/linux/mmc/sdio_ids.h                              | 2 ++
 4 files changed, 7 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +2 -0
index 68baf0189305..f4c53ab46058 100644
@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359),
 	{ /* end: all zeroes */ }
 };
 MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +1 -0
index baf72e3984fc..282d0bc14e8e 100644
@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub)
 		addr = CORE_CC_REG(base, sr_control0);
 		reg = chip->ops->read32(chip->ctx, addr);
 		return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
+	case BRCM_CC_4359_CHIP_ID:
 	case CY_CC_43012_CHIP_ID:
 		addr = CORE_CC_REG(pmu->base, retention_ctl);
 		reg = chip->ops->read32(chip->ctx, addr);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +2 -0
index 21e535072f3f..c4012ed58b9c 100644
@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
 BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
 BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
 BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");
 BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
 BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
 
@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
 	BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
 	BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
 	BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
+	BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
 	BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
 	BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
 };
include/linux/mmc/sdio_ids.h +2 -0
index 08b25c02b5a1..2e9a6e4634eb 100644
@@ -41,8 +41,10 @@
 #define SDIO_DEVICE_ID_BROADCOM_43455		0xa9bf
 #define SDIO_DEVICE_ID_BROADCOM_4354		0x4354
 #define SDIO_DEVICE_ID_BROADCOM_4356		0x4356
+#define SDIO_DEVICE_ID_BROADCOM_4359		0x4359
 #define SDIO_DEVICE_ID_CYPRESS_4373		0x4373
 #define SDIO_DEVICE_ID_CYPRESS_43012		43012
+#define SDIO_DEVICE_ID_CYPRESS_89359		0x4355
 
 #define SDIO_VENDOR_ID_INTEL			0x0089
 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402

--
2.17.1

#9 lore raw

Hi Ulf,

This patch is part of a series [1] to add support for the BCM4359 chipset with SDIO interface to the brcmfmac wireless network driver.

I just realized that this patch touches include/linux/mmc/sdio_ids.h
and therefore I need an Ack from MMC folks. Can you please look at this?

Thanks and sorry for not including you in the original patch series submission,
Soeren

[1] https://lkml.org/lkml/2019/12/11/1958

Quoted 97 lines · Soeren Moch

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <[email protected]>

---
changes in v2:
- add SDIO_DEVICE_ID_CYPRESS_89359 as requested
by Chi-Hsien Lin <[email protected]>

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
 include/linux/mmc/sdio_ids.h                              | 2 ++
 4 files changed, 7 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +2 -0
index 68baf0189305..f4c53ab46058 100644
@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
 	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359),
 	{ /* end: all zeroes */ }
 };
 MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +1 -0
index baf72e3984fc..282d0bc14e8e 100644
@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub)
 		addr = CORE_CC_REG(base, sr_control0);
 		reg = chip->ops->read32(chip->ctx, addr);
 		return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
+	case BRCM_CC_4359_CHIP_ID:
 	case CY_CC_43012_CHIP_ID:
 		addr = CORE_CC_REG(pmu->base, retention_ctl);
 		reg = chip->ops->read32(chip->ctx, addr);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +2 -0
index 21e535072f3f..c4012ed58b9c 100644
@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
 BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
 BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
 BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");
 BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
 BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
 
@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
 	BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
 	BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
 	BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
+	BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
 	BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
 	BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
 };
include/linux/mmc/sdio_ids.h +2 -1
index 08b25c02b5a1..2e9a6e4634eb 100644
@@ -41,8 +41,10 @@
 #define SDIO_DEVICE_ID_BROADCOM_43455		0xa9bf
 #define SDIO_DEVICE_ID_BROADCOM_4354		0x4354
 #define SDIO_DEVICE_ID_BROADCOM_4356		0x4356
+#define SDIO_DEVICE_ID_BROADCOM_4359		0x4359
 #define SDIO_DEVICE_ID_CYPRESS_4373		0x4373
 #define SDIO_DEVICE_ID_CYPRESS_43012		43012
+#define SDIO_DEVICE_ID_CYPRESS_89359		0x4355
 
 #define SDIO_VENDOR_ID_INTEL			0x0089
 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402
--

2.17.1

Acked-by on v2 5/9
#10 lore raw
In reply to Soeren Moch
Quoted 6 lines · Soeren Moch

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <[email protected]>

Quoted 93 lines

---
changes in v2:
- add SDIO_DEVICE_ID_CYPRESS_89359 as requested
by Chi-Hsien Lin <[email protected]>

---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
  include/linux/mmc/sdio_ids.h                              | 2 ++
  4 files changed, 7 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +2 -0
index 68baf0189305..f4c53ab46058 100644
@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
  	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
  	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
  	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359),
  	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
  	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
+	BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359),
  	{ /* end: all zeroes */ }
  };
  MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +1 -0
index baf72e3984fc..282d0bc14e8e 100644
@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub)
  		addr = CORE_CC_REG(base, sr_control0);
  		reg = chip->ops->read32(chip->ctx, addr);
  		return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
+	case BRCM_CC_4359_CHIP_ID:
  	case CY_CC_43012_CHIP_ID:
  		addr = CORE_CC_REG(pmu->base, retention_ctl);
  		reg = chip->ops->read32(chip->ctx, addr);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +2 -0
index 21e535072f3f..c4012ed58b9c 100644
@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
  BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
  BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
  BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");
  BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
  BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
 
@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
  	BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
  	BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
  	BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
+	BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
  	BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
  	BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
  };
include/linux/mmc/sdio_ids.h +2 -1
index 08b25c02b5a1..2e9a6e4634eb 100644
@@ -41,8 +41,10 @@
  #define SDIO_DEVICE_ID_BROADCOM_43455		0xa9bf
  #define SDIO_DEVICE_ID_BROADCOM_4354		0x4354
  #define SDIO_DEVICE_ID_BROADCOM_4356		0x4356
+#define SDIO_DEVICE_ID_BROADCOM_4359		0x4359
  #define SDIO_DEVICE_ID_CYPRESS_4373		0x4373
  #define SDIO_DEVICE_ID_CYPRESS_43012		43012
+#define SDIO_DEVICE_ID_CYPRESS_89359		0x4355
 
  #define SDIO_VENDOR_ID_INTEL			0x0089
  #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX	0x1402
--

2.17.1

.

Acked-by on v2 5/9
#11 lore raw
In reply to Soeren Moch
Quoted 7 lines · Soeren Moch

BCM4359 is a 2x2 802.11 abgn+ac Dual-Band HT80 combo chip and it supports Real Simultaneous Dual Band feature.

Based on a similar patch by: Wright Feng <[email protected]>

Kind regards
Uffe

Quoted 91 lines

---
changes in v2:
- add SDIO_DEVICE_ID_CYPRESS_89359 as requested
by Chi-Hsien Lin <[email protected]>

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 ++
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
 include/linux/mmc/sdio_ids.h                              | 2 ++
 4 files changed, 7 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +2 -0
index 68baf0189305..f4c53ab46058 100644
@@ -973,8 +973,10 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = {
        BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43455),
        BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354),
        BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4356),
+       BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4359),
        BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_4373),
        BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_43012),
+       BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_CYPRESS_89359),
        { /* end: all zeroes */ }
 };
 MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +1 -0
index baf72e3984fc..282d0bc14e8e 100644
@@ -1408,6 +1408,7 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub)
                addr = CORE_CC_REG(base, sr_control0);
                reg = chip->ops->read32(chip->ctx, addr);
                return (reg & CC_SR_CTL0_ENABLE_MASK) != 0;
+       case BRCM_CC_4359_CHIP_ID:
        case CY_CC_43012_CHIP_ID:
                addr = CORE_CC_REG(pmu->base, retention_ctl);
                reg = chip->ops->read32(chip->ctx, addr);
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +2 -0
index 21e535072f3f..c4012ed58b9c 100644
@@ -616,6 +616,7 @@ BRCMF_FW_DEF(43455, "brcmfmac43455-sdio");
 BRCMF_FW_DEF(43456, "brcmfmac43456-sdio");
 BRCMF_FW_DEF(4354, "brcmfmac4354-sdio");
 BRCMF_FW_DEF(4356, "brcmfmac4356-sdio");
+BRCMF_FW_DEF(4359, "brcmfmac4359-sdio");
 BRCMF_FW_DEF(4373, "brcmfmac4373-sdio");
 BRCMF_FW_DEF(43012, "brcmfmac43012-sdio");
 
@@ -638,6 +639,7 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
        BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
        BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354),
        BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356),
+       BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359),
        BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373),
        BRCMF_FW_ENTRY(CY_CC_43012_CHIP_ID, 0xFFFFFFFF, 43012)
 };
include/linux/mmc/sdio_ids.h +2 -1
index 08b25c02b5a1..2e9a6e4634eb 100644
@@ -41,8 +41,10 @@
 #define SDIO_DEVICE_ID_BROADCOM_43455          0xa9bf
 #define SDIO_DEVICE_ID_BROADCOM_4354           0x4354
 #define SDIO_DEVICE_ID_BROADCOM_4356           0x4356
+#define SDIO_DEVICE_ID_BROADCOM_4359           0x4359
 #define SDIO_DEVICE_ID_CYPRESS_4373            0x4373
 #define SDIO_DEVICE_ID_CYPRESS_43012           43012
+#define SDIO_DEVICE_ID_CYPRESS_89359           0x4355
 
 #define SDIO_VENDOR_ID_INTEL                   0x0089
 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX     0x1402
--

2.17.1

#12 lore raw

PATCH v2 6/9 brcmfmac: add RSDB condition when setting interface combinations

In reply to Soeren Moch

From: Wright Feng <wright.feng-+wT8y+m8/[email protected]>

With firmware RSDB feature
1. The maximum support interface is four.
2. The maximum difference channel is two.
3. The maximum interfaces of {station/p2p client/AP} are two.
4. The maximum interface of p2p device is one.

---
changes in v2:
- add missing s-o-b
- add review tag received for v1

Cc Kalle Valo <[email protected]>
Cc Heiko Stuebner <[email protected]>
Cc Arend van Spriel <arend.vanspriel-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Franky Lin <franky.lin-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Hante Meuleman <hante.meuleman-dY08KVG/lbpWk0Htik3J/[email protected]>
Cc Chi-Hsien Lin <chi-hsien.lin-+wT8y+m8/[email protected]>
Cc Wright Feng <wright.feng-+wT8y+m8/[email protected]>
Cc brcm80211-dev-list.pdl-dY08KVG/lbpWk0Htik3J/[email protected]
Cc brcm80211-dev-list-+wT8y+m8/[email protected]
Cc linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
---
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 54 ++++++++++++++++---
 1 file changed, 46 insertions(+), 8 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +46 -8
index 0cf13cea1dbe..9d9dc9195e9e 100644
@@ -6520,6 +6520,9 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
  *	#STA <= 1, #AP <= 1, channels = 1, 2 total
  *	#AP <= 4, matching BI, channels = 1, 4 total
  *
+ * no p2p and rsdb:
+ *	#STA <= 2, #AP <= 2, channels = 2, 4 total
+ *
  * p2p, no mchan, and mbss:
  *
  *	#STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total
@@ -6531,6 +6534,10 @@ brcmf_txrx_stypes[NUM_NL80211_IFTYPES] = {
  *	#STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total
  *	#STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
  *	#AP <= 4, matching BI, channels = 1, 4 total
+ *
+ * p2p, rsdb, and no mbss:
+ *	#STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2,
+ *	 channels = 2, 4 total
  */
 static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 {
@@ -6538,13 +6545,14 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 	struct ieee80211_iface_limit *c0_limits = NULL;
 	struct ieee80211_iface_limit *p2p_limits = NULL;
 	struct ieee80211_iface_limit *mbss_limits = NULL;
-	bool mbss, p2p;
+	bool mbss, p2p, rsdb;
 	int i, c, n_combos;
 
 	mbss = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS);
 	p2p = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_P2P);
+	rsdb = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_RSDB);
 
-	n_combos = 1 + !!p2p + !!mbss;
+	n_combos = 1 + !!(p2p && !rsdb) + !!mbss;
 	combo = kcalloc(n_combos, sizeof(*combo), GFP_KERNEL);
 	if (!combo)
 		goto err;
@@ -6555,16 +6563,36 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 
 	c = 0;
 	i = 0;
-	c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL);
+	if (p2p && rsdb)
+		c0_limits = kcalloc(4, sizeof(*c0_limits), GFP_KERNEL);
+	else if (p2p)
+		c0_limits = kcalloc(3, sizeof(*c0_limits), GFP_KERNEL);
+	else
+		c0_limits = kcalloc(2, sizeof(*c0_limits), GFP_KERNEL);
 	if (!c0_limits)
 		goto err;
-	c0_limits[i].max = 1;
-	c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
-	if (p2p) {
+	if (p2p && rsdb) {
+		combo[c].num_different_channels = 2;
+		wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
+					  BIT(NL80211_IFTYPE_P2P_GO) |
+					  BIT(NL80211_IFTYPE_P2P_DEVICE);
+		c0_limits[i].max = 2;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
+		c0_limits[i].max = 1;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE);
+		c0_limits[i].max = 2;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
+				       BIT(NL80211_IFTYPE_P2P_GO);
+		c0_limits[i].max = 2;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
+		combo[c].max_interfaces = 5;
+	} else if (p2p) {
 		if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MCHAN))
 			combo[c].num_different_channels = 2;
 		else
 			combo[c].num_different_channels = 1;
+		c0_limits[i].max = 1;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
 		wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_CLIENT) |
 					  BIT(NL80211_IFTYPE_P2P_GO) |
 					  BIT(NL80211_IFTYPE_P2P_DEVICE);
@@ -6573,16 +6601,26 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
 		c0_limits[i].max = 1;
 		c0_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
 				       BIT(NL80211_IFTYPE_P2P_GO);
+		combo[c].max_interfaces = i;
+	} else if (rsdb) {
+		combo[c].num_different_channels = 2;
+		c0_limits[i].max = 2;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
+		c0_limits[i].max = 2;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
+		combo[c].max_interfaces = 3;
 	} else {
 		combo[c].num_different_channels = 1;
 		c0_limits[i].max = 1;
+		c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION);
+		c0_limits[i].max = 1;
 		c0_limits[i++].types = BIT(NL80211_IFTYPE_AP);
+		combo[c].max_interfaces = i;
 	}
-	combo[c].max_interfaces = i;
 	combo[c].n_limits = i;
 	combo[c].limits = c0_limits;
 
-	if (p2p) {
+	if (p2p && !rsdb) {
 		c++;
 		i = 0;
 		p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL);

--
2.17.1

#13 lore raw

PATCH v2 7/9 brcmfmac: not set mbss in vif if firmware does not support MBSS

In reply to Soeren Moch

From: Wright Feng <[email protected]>

With RSDB mode, FMAC and firmware are able to create 2 or more AP, so we should not set mbss in vif structure if firmware does not support MBSS feature.

---
changes in v2:
- add missing s-o-b
- add review tag received for v1

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +3 -1
index 9d9dc9195e9e..6eb3064c3721 100644
@@ -5363,6 +5363,7 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
 	struct brcmf_cfg80211_vif *vif_walk;
 	struct brcmf_cfg80211_vif *vif;
 	bool mbss;
+	struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
 
 	brcmf_dbg(TRACE, "allocating virtual interface (size=%zu)\n",
 		  sizeof(*vif));
@@ -5375,7 +5376,8 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg,
 
 	brcmf_init_prof(&vif->profile);
 
-	if (type == NL80211_IFTYPE_AP) {
+	if (type == NL80211_IFTYPE_AP &&
+	    brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) {
 		mbss = false;
 		list_for_each_entry(vif_walk, &cfg->vif_list, list) {
 			if (vif_walk->wdev.iftype == NL80211_IFTYPE_AP) {

--
2.17.1

#14 lore raw

PATCH v2 8/9 arm64: dts: rockchip: RockPro64: enable wifi module at sdio0

In reply to Soeren Moch

RockPro64 supports an Ampak AP6359SA based wifi/bt combo module. The BCM4359/9 wifi controller in this module is connected to sdio0, enable this interface.

Use the in-band sdio irq instead of the out-of-band wifi_host_wake_l signal since the latter is not working reliably on this board (probably due to it's PCIe WAKE# connection).

---
changes in v2:
- add comment about irq in commit message

Not sure where to place exactly the sdio0 node in the dts because existing sd nodes are not sorted alphabetically.

---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -7
index 7f4b2eba31d4..9fa92790d6e0 100644
@@ -71,13 +71,6 @@
 		clock-names = "ext_clock";
 		pinctrl-names = "default";
 		pinctrl-0 = <&wifi_enable_h>;
-
-		/*
-		 * On the module itself this is one of these (depending
-		 * on the actual card populated):
-		 * - SDIO_RESET_L_WL_REG_ON
-		 * - PDN (power down when low)
-		 */
 		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
 	};
 
@@ -650,6 +643,20 @@
 	status = "okay";
 };
 
+&sdio0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	disable-wp;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+	sd-uhs-sdr104;
+	status = "okay";
+};
+
 &sdmmc {
 	bus-width = <4>;
 	cap-sd-highspeed;

--
2.17.1

A message that is not in the archive (sent off-list or not yet received): 20191211235253.2539-9-smoch-S0/[email protected]

#16 lore raw

Re: Re: [PATCH v2 8/9] arm64: dts: rockchip: RockPro64: enable wifi module at sdio0

Hi Soeren,

Same commit as for V1.
The mmc-controller.yaml didn't explicitly say disable-wp is for SD card slot only, but that is what it was designed for in the first place. Remove all disable-wp from emmc or sdio controllers.

#17 lore raw

PATCH v2 9/9 arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

In reply to Soeren Moch

With enabled wifi support (required for firmware loading) for the Ampak AP6359SA based wifi/bt combo module we now also can enable the bluetooth part.

---
changes in v2:
- new patch

---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 29 ++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +28 -1
index 9fa92790d6e0..94cc462e234d 100644
@@ -561,6 +561,20 @@
 };
 
 &pinctrl {
+	bt {
+		bt_enable_h: bt-enable-h {
+			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake_l: bt-host-wake-l {
+			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+
+		bt_wake_l: bt-wake-l {
+			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	buttons {
 		pwrbtn: pwrbtn {
 			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -729,8 +743,21 @@
 
 &uart0 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_xfer &uart0_cts>;
+	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
 	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&rk808 1>;
+		clock-names = "extclk";
+		device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
+		vbat-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_1v8>;
+	};
 };
 
 &uart2 {

--
2.17.1

#18 lore raw

Re: [PATCH v2 9/9] arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Hi Soeren,

Quoted 50 lines · Soeren Moch

With enabled wifi support (required for firmware loading) for the Ampak AP6359SA based wifi/bt combo module we now also can enable the bluetooth part.

---
changes in v2:
- new patch

---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 29 ++++++++++++++++++-
  1 file changed, 28 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -0
index 9fa92790d6e0..94cc462e234d 100644
@@ -561,6 +561,20 @@
  };
 
  &pinctrl {
+	bt {
+		bt_enable_h: bt-enable-h {
+			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		bt_host_wake_l: bt-host-wake-l {
+			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+
+		bt_wake_l: bt-wake-l {
+			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
  	buttons {
  		pwrbtn: pwrbtn {
  			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -729,8 +743,21 @@
 

arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts line 752

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +6 -1
  &uart0 {
  	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_xfer &uart0_cts>;
+	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
  	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm43438-bt";
+		clocks = <&rk808 1>;
+		clock-names = "extclk";

Is this right? Comparing the binding and the naming on the schematics, it seems more likely that this might be the LPO clock rather than the TXCO clock.

Robin.

Quoted 20 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +8 -1
+		device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
+		vbat-supply = <&vcc3v3_sys>;
+		vddio-supply = <&vcc_1v8>;
+	};
  };
 
  &uart2 {
--

2.17.1

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#19 lore raw

Re: [PATCH v2 9/9] arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Quoted 69 lines · Robin Murphy

Hi Soeren,

Quoted 51 lines · Soeren Moch

With enabled wifi support (required for firmware loading) for the Ampak AP6359SA based wifi/bt combo module we now also can enable the bluetooth part.

---
changes in v2:
- new patch

---
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 29 ++++++++++++++++++-

  1 file changed, 28 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -0
index 9fa92790d6e0..94cc462e234d 100644
@@ -561,6 +561,20 @@
   };
 
   &pinctrl {
+    bt {
+        bt_enable_h: bt-enable-h {
+            rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+        };
+
+        bt_host_wake_l: bt-host-wake-l {
+            rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
+        };
+
+        bt_wake_l: bt-wake-l {
+            rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
+        };
+    };
+
       buttons {
           pwrbtn: pwrbtn {
               rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -729,8 +743,21 @@
 

arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts line 752

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +6 -1
   &uart0 {
       pinctrl-names = "default";
-    pinctrl-0 = <&uart0_xfer &uart0_cts>;
+    pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
       status = "okay";
+
+    bluetooth {
+        compatible = "brcm,bcm43438-bt";
+        clocks = <&rk808 1>;
+        clock-names = "extclk";

Is this right? Comparing the binding and the naming on the schematics, it seems more likely that this might be the LPO clock rather than the TXCO clock.

Quoted 1 line

Robin.

On second thought I have to agree. So we need another round on this.

Thanks for your review and bug report,
Soeren

Quoted 21 lines
Quoted 21 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +8 -1
+        device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
+        host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+        shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
+        vbat-supply = <&vcc3v3_sys>;
+        vddio-supply = <&vcc_1v8>;
+    };
   };
 
   &uart2 {
--

2.17.1

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#20 lore raw
In reply to Soeren Moch
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#21 lore raw
Quoted 33 lines · Kalle Valo
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 4 lines

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't need to bother linux-wireless with this.

Thanks,
Soeren

#22 lore raw
Quoted 38 lines · Soeren Moch
Quoted 33 lines · Kalle Valo
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 4 lines

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Quoted 5 lines

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't need to bother linux-wireless with this.

Heiko,

is this OK for you when patches 1-7 are merged now in wireless-drivers, and then I send a v3 for patches 8-9 only for you to merge in linux-rockchip later? Or do you prefer a full v3 for the whole series with only this pending clock name update in patch 9?

Thanks,
Soeren

maintainer
#23 lore raw

Hi Soeren,

Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:

Quoted 45 lines · Soeren Moch
Quoted 38 lines · Kalle Valo
Quoted 33 lines
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 4 lines

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Quoted 5 lines

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't need to bother linux-wireless with this.

Quoted 6 lines

Heiko,

is this OK for you when patches 1-7 are merged now in wireless-drivers, and then I send a v3 for patches 8-9 only for you to merge in linux-rockchip later? Or do you prefer a full v3 for the whole series with only this pending clock name update in patch 9?

Nope, merging 1-7 from this v2 and then getting a v3 with only the dts stuff is perfectly fine :-)

Heiko

#24 lore raw
Quoted 50 lines · Heiko Stübner

Hi Soeren,

Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:

Quoted 47 lines · Soeren Moch
Quoted 38 lines · Kalle Valo
Quoted 33 lines
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
  .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
  .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
  .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
  .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
  .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
  .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
  include/linux/mmc/sdio_ids.h                  |  2 +
  8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 4 lines

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Quoted 5 lines

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't need to bother linux-wireless with this.

Heiko,

Quoted 7 lines
Quoted 4 lines

is this OK for you when patches 1-7 are merged now in wireless-drivers, and then I send a v3 for patches 8-9 only for you to merge in linux-rockchip later? Or do you prefer a full v3 for the whole series with only this pending clock name update in patch 9?

Nope, merging 1-7 from this v2 and then getting a v3 with only the dts stuff is perfectly fine :-)

Soeren,

I suppose patch 1-7 from this serious are all good for merging. Is that right? If so, could you please create a rebased V3?

Regards,
Chi-hsien Lin

Quoted 6 lines

Heiko

.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#25 lore raw
Quoted 62 lines · Chi-Hsien Lin
Quoted 61 lines · Heiko Stübner

Hi Soeren,

Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:

Quoted 57 lines · Soeren Moch
Quoted 43 lines · Kalle Valo
Quoted 36 lines
Quoted 28 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support
to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
   brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
   brcmfmac: fix rambase for 4359/9
   brcmfmac: make errors when setting roaming parameters non-fatal
   brcmfmac: add support for BCM4359 SDIO chipset
   arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
   arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
   brcmfmac: reset two D11 cores if chip has two D11 cores
   brcmfmac: add RSDB condition when setting interface combinations
   brcmfmac: not set mbss in vif if firmware does not support MBSS

  .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++--- .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++- .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68
+++++++++++++++----

Quoted 6 lines
  .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
  .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
  .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
  .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
  include/linux/mmc/sdio_ids.h                  |  2 +
  8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 6 lines

Just to make sure we are on the same page, I will apply patches 1-7 to
wireless-drivers-next and patches 8-9 go to some other tree? And there
are no dependencies between the brcmfmac patches and dts patches?

Quoted 6 lines

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't
need to bother linux-wireless with this.

Heiko,

is this OK for you when patches 1-7 are merged now in wireless-drivers, and then I send a v3 for patches 8-9 only for you to merge in linux-rockchip later? Or do you prefer a full v3 for the whole series with only this pending clock name update in patch 9?

Quoted 7 lines
Quoted 2 lines

Nope, merging 1-7 from this v2 and then getting a v3 with only the dts stuff is perfectly fine :-)

Soeren,

I suppose patch 1-7 from this serious are all good for merging. Is that right? If so, could you please create a rebased V3?

Chi-hsien,

Thanks for asking, but these patches are already merged in torvalds/v5.6-rc1 as commits 1b8d2e0a9e42..2635853ce4ab

So everything already fine with this.

Thanks,
Soeren

Quoted 11 lines

Regards,
Chi-hsien Lin

Quoted 6 lines

Heiko

.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#26 lore raw
Quoted 71 lines · Soeren Moch
Quoted 62 lines · Chi-Hsien Lin
Quoted 61 lines · Heiko Stübner

Hi Soeren,

Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:

Quoted 57 lines · Soeren Moch
Quoted 43 lines · Kalle Valo
Quoted 36 lines
Quoted 24 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support
to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
   brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
   brcmfmac: fix rambase for 4359/9
   brcmfmac: make errors when setting roaming parameters non-fatal
   brcmfmac: add support for BCM4359 SDIO chipset
   arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
   arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
   brcmfmac: reset two D11 cores if chip has two D11 cores
   brcmfmac: add RSDB condition when setting interface combinations
   brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 10 lines
   .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
   .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
   .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68
+++++++++++++++----
   .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
   .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
   .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
   .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
   include/linux/mmc/sdio_ids.h                  |  2 +
   8 files changed, 176 insertions(+), 26 deletions(-)
Quoted 6 lines

Just to make sure we are on the same page, I will apply patches 1-7 to
wireless-drivers-next and patches 8-9 go to some other tree? And there
are no dependencies between the brcmfmac patches and dts patches?

Quoted 6 lines

Yes, this also is my understanding. I'm glad if you are fine with patches 1-7.
Heiko will pick up patches 8-9 later for linux-rockchip independently. And if we need another round of review for patches 8-9, I think we don't
need to bother linux-wireless with this.

Heiko,

is this OK for you when patches 1-7 are merged now in wireless-drivers, and then I send a v3 for patches 8-9 only for you to merge in linux-rockchip later? Or do you prefer a full v3 for the whole series with only this pending clock name update in patch 9?

Quoted 7 lines
Quoted 2 lines

Nope, merging 1-7 from this v2 and then getting a v3 with only the dts stuff is perfectly fine :-)

Soeren,

I suppose patch 1-7 from this serious are all good for merging. Is that right? If so, could you please create a rebased V3?

Quoted 7 lines

Chi-hsien,

Thanks for asking, but these patches are already merged in torvalds/v5.6-rc1 as commits 1b8d2e0a9e42..2635853ce4ab

So everything already fine with this.

Ahh... You're right. They're all good. Thanks a lot!!

Quoted 16 lines

Thanks,
Soeren

Quoted 11 lines

Regards,
Chi-hsien Lin

Quoted 6 lines

Heiko

.

#27 lore raw
In reply to Soeren Moch
Quoted 22 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 9 lines
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 50 +++++++++++---
 .../broadcom/brcm80211/brcmfmac/bcmsdh.c      |  8 ++-
 .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 68 +++++++++++++++----
 .../broadcom/brcm80211/brcmfmac/chip.c        | 54 ++++++++++++++-
 .../broadcom/brcm80211/brcmfmac/chip.h        |  1 +
 .../broadcom/brcm80211/brcmfmac/pcie.c        |  2 +-
 .../broadcom/brcm80211/brcmfmac/sdio.c        | 17 +++++
 include/linux/mmc/sdio_ids.h                  |  2 +
 8 files changed, 176 insertions(+), 26 deletions(-)

Just to make sure we are on the same page, I will apply patches 1-7 to wireless-drivers-next and patches 8-9 go to some other tree? And there are no dependencies between the brcmfmac patches and dts patches?

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#28 lore raw
In reply to Soeren Moch
Quoted 20 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Quoted 4 lines

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Thanks for posting this series, this chip is widely used by a large number of current Amlogic devices!

Patches 1-7 have been tested on Amlogic G12B (Khadas VIM3) hardware with 5.5-rc kernel and a LibreELEC (distro) colleague also tested with a Khadas Edge board (RK3399). The Ampak 6398S module on both boards are detected and can connect to networks to pass basic functional testing.

On the VIM3 board I do see the following warning splat:

[    7.987351] ------------[ cut here ]------------
[    7.987382] WARNING: CPU: 5 PID: 36 at drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c:776 brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987384] Modules linked in: brcmfmac ecdh_generic brcmutil rtc_meson_vrtc videodev ecc cfg80211 gpio_pca953x rfkill ir_nec_decoder crct10dif_ce rc_khadas mali_kbase(O) meson_ir ao_cec_g12a mc rtc_hym8563 rc_core gpio_keys_polled adc_keys ipv6 nf_defrag_ipv6 crc_ccitt sch_fq_codel
[    7.987403] CPU: 5 PID: 36 Comm: kworker/5:0 Tainted: G           O      5.5.0-rc1 #1
[    7.987404] Hardware name: Khadas VIM3 (DT)
[    7.987417] Workqueue: events brcmf_driver_register [brcmfmac]
[    7.987420] pstate: 80000005 (Nzcv daif -PAN -UAO)
[    7.987432] pc : brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987443] lr : brcmf_sdio_probe+0x28c/0x890 [brcmfmac]
[    7.987444] sp : ffff80001017ba90
[    7.987445] x29: ffff80001017ba90 x28: 0000000000000000 
[    7.987447] x27: 0000000000000000 x26: ffff0000a8c09400 
[    7.987449] x25: ffff80000a24cb08 x24: ffff0000a3800400 
[    7.987451] x23: ffff800012c618c8 x22: ffff0000a675e000 
[    7.987453] x21: ffff0000a675e000 x20: 0000000000000023 
[    7.987454] x19: ffff0000a3800000 x18: ffff800013b25908 
[    7.987456] x17: ffff800013b25d0c x16: ffff800013b25104 
[    7.987457] x15: 00000000f0000000 x14: 000000000000000a 
[    7.987459] x13: 0000000000000000 x12: 0000000000000001 
[    7.987460] x11: 0000000000000005 x10: 0101010101010101 
[    7.987461] x9 : ffffffffffffffff x8 : 7f7f7f7f7f7f7f7f 
[    7.987463] x7 : 00000000000001ff x6 : 0000000000000080 
[    7.987464] x5 : 0000000000000600 x4 : 0000000000000003 
[    7.987466] x3 : ffff0000a5a3d880 x2 : 0000000000000021 
[    7.987467] x1 : 0000000000000003 x0 : ffff0000a675e000 
[    7.987469] Call trace:
[    7.987481]  brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987493]  brcmf_sdio_probe+0x28c/0x890 [brcmfmac]
[    7.987504]  brcmf_sdiod_probe+0xe0/0x1c0 [brcmfmac]
[    7.987516]  brcmf_ops_sdio_probe+0x16c/0x208 [brcmfmac]
[    7.987522]  sdio_bus_probe+0xe0/0x1c8
[    7.987526]  really_probe+0xd8/0x428
[    7.987529]  driver_probe_device+0xdc/0x130
[    7.987531]  device_driver_attach+0x6c/0x78
[    7.987533]  __driver_attach+0x9c/0x168
[    7.987535]  bus_for_each_dev+0x70/0xc0
[    7.987536]  driver_attach+0x20/0x28
[    7.987538]  bus_add_driver+0x190/0x220
[    7.987539]  driver_register+0x60/0x110
[    7.987541]  sdio_register_driver+0x24/0x30
[    7.987552]  brcmf_sdio_register+0x14/0x48 [brcmfmac]
[    7.987563]  brcmf_driver_register+0xc/0x20 [brcmfmac]
[    7.987567]  process_one_work+0x1e0/0x358
[    7.987569]  worker_thread+0x40/0x488
[    7.987571]  kthread+0x118/0x120
[    7.987573]  ret_from_fork+0x10/0x18
[    7.987575] ---[ end trace 808ac7e159d1fc33 ]---

I don’t see this on older Amlogic SoCs (GXL/GXM devices with various other BCM chips) or another Amlogic G12B device (same SoC with a different Ampak module) or some RK3399 devices, so it may be something board (Khadas VIM3) specific.

I also see some errors like:

[   71.046597] brcmfmac: brcmf_sdio_readframes: RXHEADER FAILED: -5
[   71.046652] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame, send NAK
[  123.844863] brcmfmac: brcmf_sdio_bus_sleep: error while changing bus sleep state -5
[  124.678329] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  124.680226] mmc0: tuning execution failed: -5
[  124.708843] brcmfmac: brcmf_sdio_bus_sleep: error while changing bus sleep state -5
[  125.700765] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  125.880372] brcmfmac: mmc_submit_one: CMD53 sg block read failed -22
[  125.880393] brcmfmac: brcmf_sdio_rxglom: glom read of 512 bytes failed: -5
[  125.880401] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
[  125.881262] brcmfmac: brcmf_sdio_readframes: brcmf_sdio_readframes: glom superframe w/o descriptor!
[  125.881318] brcmfmac: brcmf_sdio_rxfail: terminate frame
[  131.844289] brcmfmac: mmc_submit_one: CMD53 sg block write failed -22
[  131.844302] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  131.844488] brcmfmac: mmc_submit_one: CMD53 sg block write failed -22
[  131.844494] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame

I’m not sure if that’s of any concern, but if yes, I’d be happy to apply any debugging patches you provide to generate output.

Thanks again for working on this chipset!

Christian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#29 lore raw
Quoted 19 lines · Christian Hewitt
Quoted 19 lines · Soeren Moch

Add support for the BCM4359 chipset with SDIO interface and RSDB support to the brcmfmac wireless network driver in patches 1-7.

Enhance devicetree of the RockPro64 arm64/rockchip board to use an AP6359SA based wifi/bt combo module with this chipset in patches 8-9.

Chung-Hsien Hsu (1):
brcmfmac: set F2 blocksize and watermark for 4359

Soeren Moch (5):
brcmfmac: fix rambase for 4359/9
brcmfmac: make errors when setting roaming parameters non-fatal
brcmfmac: add support for BCM4359 SDIO chipset
arm64: dts: rockchip: RockPro64: enable wifi module at sdio0
arm64: dts: rockchip: RockPro64: hook up bluetooth at uart0

Quoted 7 lines
Quoted 4 lines

Wright Feng (3):
brcmfmac: reset two D11 cores if chip has two D11 cores
brcmfmac: add RSDB condition when setting interface combinations
brcmfmac: not set mbss in vif if firmware does not support MBSS

Thanks for posting this series, this chip is widely used by a large number of current Amlogic devices!

Patches 1-7 have been tested on Amlogic G12B (Khadas VIM3) hardware with 5.5-rc kernel and a LibreELEC (distro) colleague also tested with a Khadas Edge board (RK3399). The Ampak 6398S module on both boards are detected and can connect to networks to pass basic functional testing.

Thanks for confirming that this series to add support for the BCM4359 SDIO chipset works on different boards.

Quoted 51 lines

On the VIM3 board I do see the following warning splat:

[    7.987351] ------------[ cut here ]------------
[    7.987382] WARNING: CPU: 5 PID: 36 at drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c:776 brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987384] Modules linked in: brcmfmac ecdh_generic brcmutil rtc_meson_vrtc videodev ecc cfg80211 gpio_pca953x rfkill ir_nec_decoder crct10dif_ce rc_khadas mali_kbase(O) meson_ir ao_cec_g12a mc rtc_hym8563 rc_core gpio_keys_polled adc_keys ipv6 nf_defrag_ipv6 crc_ccitt sch_fq_codel
[    7.987403] CPU: 5 PID: 36 Comm: kworker/5:0 Tainted: G           O      5.5.0-rc1 #1
[    7.987404] Hardware name: Khadas VIM3 (DT)
[    7.987417] Workqueue: events brcmf_driver_register [brcmfmac]
[    7.987420] pstate: 80000005 (Nzcv daif -PAN -UAO)
[    7.987432] pc : brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987443] lr : brcmf_sdio_probe+0x28c/0x890 [brcmfmac]
[    7.987444] sp : ffff80001017ba90
[    7.987445] x29: ffff80001017ba90 x28: 0000000000000000 
[    7.987447] x27: 0000000000000000 x26: ffff0000a8c09400 
[    7.987449] x25: ffff80000a24cb08 x24: ffff0000a3800400 
[    7.987451] x23: ffff800012c618c8 x22: ffff0000a675e000 
[    7.987453] x21: ffff0000a675e000 x20: 0000000000000023 
[    7.987454] x19: ffff0000a3800000 x18: ffff800013b25908 
[    7.987456] x17: ffff800013b25d0c x16: ffff800013b25104 
[    7.987457] x15: 00000000f0000000 x14: 000000000000000a 
[    7.987459] x13: 0000000000000000 x12: 0000000000000001 
[    7.987460] x11: 0000000000000005 x10: 0101010101010101 
[    7.987461] x9 : ffffffffffffffff x8 : 7f7f7f7f7f7f7f7f 
[    7.987463] x7 : 00000000000001ff x6 : 0000000000000080 
[    7.987464] x5 : 0000000000000600 x4 : 0000000000000003 
[    7.987466] x3 : ffff0000a5a3d880 x2 : 0000000000000021 
[    7.987467] x1 : 0000000000000003 x0 : ffff0000a675e000 
[    7.987469] Call trace:
[    7.987481]  brcmf_sdiod_sgtable_alloc+0x130/0x138 [brcmfmac]
[    7.987493]  brcmf_sdio_probe+0x28c/0x890 [brcmfmac]
[    7.987504]  brcmf_sdiod_probe+0xe0/0x1c0 [brcmfmac]
[    7.987516]  brcmf_ops_sdio_probe+0x16c/0x208 [brcmfmac]
[    7.987522]  sdio_bus_probe+0xe0/0x1c8
[    7.987526]  really_probe+0xd8/0x428
[    7.987529]  driver_probe_device+0xdc/0x130
[    7.987531]  device_driver_attach+0x6c/0x78
[    7.987533]  __driver_attach+0x9c/0x168
[    7.987535]  bus_for_each_dev+0x70/0xc0
[    7.987536]  driver_attach+0x20/0x28
[    7.987538]  bus_add_driver+0x190/0x220
[    7.987539]  driver_register+0x60/0x110
[    7.987541]  sdio_register_driver+0x24/0x30
[    7.987552]  brcmf_sdio_register+0x14/0x48 [brcmfmac]
[    7.987563]  brcmf_driver_register+0xc/0x20 [brcmfmac]
[    7.987567]  process_one_work+0x1e0/0x358
[    7.987569]  worker_thread+0x40/0x488
[    7.987571]  kthread+0x118/0x120
[    7.987573]  ret_from_fork+0x10/0x18
[    7.987575] ---[ end trace 808ac7e159d1fc33 ]---
Quoted 1 line

I don’t see this on older Amlogic SoCs (GXL/GXM devices with various other BCM chips) or another Amlogic G12B device (same SoC with a different Ampak module) or some RK3399 devices, so it may be something board (Khadas VIM3) specific.

Unfortunately I don't know this Khadas VIM3 board and special problems to support brcmfmac on it.

On RockPro64 there are 2 board specific tweaks needed to get this running (also see patch 8 in this series, and rk3399.dtsi):
- limit clock of the sdio0 port of rk3399
- enable sdio in-band irq, do not use out-of-band irq that the wifi module supports.

I guess you need similar enhancements of the board device tree as in patch 8 of this series for your VIM3 board.

Regards,
Soeren

Quoted 27 lines

I also see some errors like:

[   71.046597] brcmfmac: brcmf_sdio_readframes: RXHEADER FAILED: -5
[   71.046652] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame, send NAK
[  123.844863] brcmfmac: brcmf_sdio_bus_sleep: error while changing bus sleep state -5
[  124.678329] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  124.680226] mmc0: tuning execution failed: -5
[  124.708843] brcmfmac: brcmf_sdio_bus_sleep: error while changing bus sleep state -5
[  125.700765] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  125.880372] brcmfmac: mmc_submit_one: CMD53 sg block read failed -22
[  125.880393] brcmfmac: brcmf_sdio_rxglom: glom read of 512 bytes failed: -5
[  125.880401] brcmfmac: brcmf_sdio_rxfail: abort command, terminate frame
[  125.881262] brcmfmac: brcmf_sdio_readframes: brcmf_sdio_readframes: glom superframe w/o descriptor!
[  125.881318] brcmfmac: brcmf_sdio_rxfail: terminate frame
[  131.844289] brcmfmac: mmc_submit_one: CMD53 sg block write failed -22
[  131.844302] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame
[  131.844488] brcmfmac: mmc_submit_one: CMD53 sg block write failed -22
[  131.844494] brcmfmac: brcmf_sdio_txfail: sdio error, abort command and terminate frame

I’m not sure if that’s of any concern, but if yes, I’d be happy to apply any debugging patches you provide to generate output.

Thanks again for working on this chipset!

Christian

#30 lore raw
Quoted 5 lines · Soeren Moch

I guess you need similar enhancements of the board device tree as in patch 8 of this series for your VIM3 board.

Wider testing now points to a known SDIO issue (SoC bug) with Amlogic G12A/B hardware. The merged workaround for the bug was only tested with bcmdhd and brcmfmac may require tweaking as the same issue exhibits on an Amlogic G12B device with BCM4356 chip. Testing the series with Amlogic GXM (older) and SM1 (newer) hardware to exclude the SoC bug shows everything working as expected.

Christian

maintainer
#31 lore raw
Quoted 7 lines · Christian Hewitt
Quoted 5 lines · Soeren Moch

I guess you need similar enhancements of the board device tree as in patch 8 of this series for your VIM3 board.

Wider testing now points to a known SDIO issue (SoC bug) with Amlogic G12A/B hardware. The merged workaround for the bug was only tested with bcmdhd and brcmfmac may require tweaking as the same issue exhibits on an Amlogic G12B device with BCM4356 chip. Testing the series with Amlogic GXM (older) and SM1 (newer) hardware to exclude the SoC bug shows everything working as expected.

Hi Christian,

Can you elaborate on the "known SDIO issue"? Is it an issue with ADMA or something else. I am asking because there is a workaround in brcmfmac to avoid scatter-gather lists, which may or may not address the issue.

Regards,
Arend

#32 lore raw
Quoted 5 lines · Arend Van Spriel

Can you elaborate on the "known SDIO issue"? Is it an issue with ADMA or something else. I am asking because there is a workaround in brcmfmac to avoid scatter-gather lists, which may or may not address the issue.

This describes the issue: https://patchwork.kernel.org/cover/10962975/

Below is the current workaround I’m using, which restricts the hack to Amlogic G12A and G12B devices that inherit “amlogic,dram-access-quirk” from a common SoC dtsi.

https://github.com/chewitt/linux/commit/187527747861b047c835f494fe3267d9b4959be1

Testing by Khadas staff found the max_segs/max_blk_count values and shows a performance impact (not a big surprise) but they appear to give a stable connection, which is better than a very unstable one. I’ve flagged things to linux-amlogic maintainer Neil Armstrong (on CC) and I expect he or colleagues will take a more scientific look in January.

NB: I’m happy to test other things. Just remember that I don’t code so you need to spoon-feed me with patches not suggestions.

Christian