Skip to contentSkip to conversation

brcmfmac: reset two D11 cores if chip has two D11 cores

PATCH Superseded Soeren Moch 5 participants 29 messages Dec 9, 2019 – Dec 16, 2019 4 messages not in the archive

Subsystems (6)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 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.

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 .../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

#1 lore raw

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

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]

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 .../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

Reviewed-by on v1 2/8
#2 lore raw

Re: [PATCH 2/8] brcmfmac: set F2 blocksize and watermark for 4359

Quoted 9 lines · 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]
Quoted 86 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  .../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 -1
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

.

#3 lore raw

PATCH 3/8 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.

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 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

#4 lore raw

PATCH 4/8 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.

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 .../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

Acked-by on v1 4/8
#5 lore raw

Re: [PATCH 4/8] brcmfmac: make errors when setting roaming parameters non-fatal

Quoted 4 lines · Soeren Moch

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

Quoted 49 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c    | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +4 -7
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

.

#6 lore raw

PATCH 5/8 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 <[email protected]>

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
 include/linux/mmc/sdio_ids.h                              | 1 +
 4 files changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +1 -0
index 68baf0189305..5b57d37caf17 100644
@@ -973,6 +973,7 @@ 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),
 	{ /* end: all zeroes */ }
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 +1 -0
index 08b25c02b5a1..930ef2d8264a 100644
@@ -41,6 +41,7 @@
 #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
 

--
2.17.1

#7 lore raw

Re: [PATCH 5/8] brcmfmac: add support for BCM4359 SDIO chipset

Quoted 4 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]>

Hi Soeren,

Is it possible to also keep the ID in the original patch from Wright? You can use below IDs and allow both to be supported:

#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359
#define SDIO_DEVICE_ID_CY_89359 0x4355

Chi-hsien Lin

Quoted 82 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
  include/linux/mmc/sdio_ids.h                              | 1 +
  4 files changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +1 -0
index 68baf0189305..5b57d37caf17 100644
@@ -973,6 +973,7 @@ 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),
  	{ /* end: all zeroes */ }
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 +1 -1
index 08b25c02b5a1..930ef2d8264a 100644
@@ -41,6 +41,7 @@
  #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
 
--

2.17.1

.

#8 lore raw

Re: [PATCH 5/8] brcmfmac: add support for BCM4359 SDIO chipset

Quoted 8 lines · Chi-Hsien Lin
Quoted 4 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 7 lines

Hi Soeren,

Is it possible to also keep the ID in the original patch from Wright? You can use below IDs and allow both to be supported:

#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359
#define SDIO_DEVICE_ID_CY_89359 0x4355

Fix a typo. The ID should be

#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355

Note that brcmf_sdmmc_ids[] also needs an entry for the above ID. The chipid references can remain unchanged.

Chi-hsien Lin

Quoted 87 lines

Chi-hsien Lin

Quoted 82 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
   include/linux/mmc/sdio_ids.h                              | 1 +
   4 files changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +1 -0
index 68baf0189305..5b57d37caf17 100644
@@ -973,6 +973,7 @@ 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),
   	{ /* end: all zeroes */ }
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 +1 -1
index 08b25c02b5a1..930ef2d8264a 100644
@@ -41,6 +41,7 @@
   #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
 
--

2.17.1

.

#9 lore raw

Re: [PATCH 5/8] brcmfmac: add support for BCM4359 SDIO chipset

Quoted 13 lines · Chi-Hsien Lin
Quoted 11 lines · Chi-Hsien Lin
Quoted 4 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]>

Hi Soeren,

Is it possible to also keep the ID in the original patch from Wright? You can use below IDs and allow both to be supported:

Quoted 8 lines
Quoted 2 lines

#define SDIO_DEVICE_ID_BROADCOM_4359 0x4359
#define SDIO_DEVICE_ID_CY_89359 0x4355

Fix a typo. The ID should be

#define SDIO_DEVICE_ID_CYPRESS_89359 0x4355

Note that brcmf_sdmmc_ids[] also needs an entry for the above ID. The chipid references can remain unchanged.

Hi Chi-hsien,

thanks for all your reviews. I will re-add this ID and send a v2 of this series.

Thanks again,
Soeren

Quoted 88 lines

Chi-hsien Lin

Quoted 85 lines

Chi-hsien Lin

Quoted 81 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 +
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c   | 1 +
   drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 2 ++
   include/linux/mmc/sdio_ids.h                              | 1 +
   4 files changed, 5 insertions(+)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +1 -0
index 68baf0189305..5b57d37caf17 100644
@@ -973,6 +973,7 @@ 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),
   	{ /* end: all zeroes */ }
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 +1 -1
index 08b25c02b5a1..930ef2d8264a 100644
@@ -41,6 +41,7 @@
   #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
 
--

2.17.1

.

#10 lore raw

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

In reply to Soeren Moch

From: Wright Feng <[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.

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 .../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

Reviewed-by on v1 6/8
#11 lore raw

Re: [PATCH 6/8] brcmfmac: add RSDB condition when setting interface combinations

Quoted 9 lines · Soeren Moch

From: Wright Feng <[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.

Quoted 133 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  .../broadcom/brcm80211/brcmfmac/cfg80211.c    | 54 ++++++++++++++++---
  1 file changed, 46 insertions(+), 8 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +46 -9
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

.

#12 lore raw

PATCH 7/8 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.

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 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

Reviewed-by on v1 7/8
#13 lore raw

Re: [PATCH 7/8] brcmfmac: not set mbss in vif if firmware does not support MBSS

Quoted 7 lines · 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.

Quoted 43 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  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 -2
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 8/8 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.

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

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

---
 .../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

maintainer
#15 lore raw

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

Hi Soeren,

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 5 lines

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.

Quoted 8 lines

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

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Thanks
Heiko

Quoted 56 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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

#16 lore raw

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

Hi Heiko,

Quoted 12 lines · Heiko Stübner

Hi Soeren,

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

If this was confusing, what would be the ideal way to post such series?

Thanks,
Soeren

[1] https://patchwork.kernel.org/project/linux-wireless/list/?series=213951

Quoted 63 lines

Thanks
Heiko

Quoted 55 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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

maintainer
#17 lore raw

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

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

Heiko

Quoted 66 lines

[1] https://patchwork.kernel.org/project/linux-wireless/list/?series=213951

Quoted 63 lines

Thanks
Heiko

Quoted 55 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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

#18 lore raw

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

Quoted 35 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

Quoted 6 lines
Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

FWIW I prefer the same as Heiko. If I don't see all the patches in the patchset I start worrying if patchwork lost them, or something, and then it takes more time from me to investigate what happened. So I strongly recommend sending the whole series to everyone as it saves time.

Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

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

In reply to Heiko Stübner
Quoted 35 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

Quoted 6 lines
Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

FWIW I prefer the same as Heiko. If I don't see all the patches in the patchset I start worrying if patchwork lost them, or something, and then it takes more time from me to investigate what happened. So I strongly recommend sending the whole series to everyone as it saves time.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#20 lore raw

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

In reply to Heiko Stübner

Hi Heiko,

Quoted 27 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Quoted 5 lines

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

The uart part for bluetooth already is in: uart0.
However, I haven't tested if it really works.

Quoted 5 lines
Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

OK, thanks.
I will add you for the whole series when sending a v2.

Soeren

Quoted 70 lines

Heiko

Quoted 63 lines

[1] https://patchwork.kernel.org/project/linux-wireless/list/?series=213951

Quoted 61 lines

Thanks
Heiko

Quoted 55 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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

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

maintainer
#21 lore raw

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

Am Dienstag, 10. Dezember 2019, 11:08:18 CET schrieb Soeren Moch:

Quoted 30 lines

Hi Heiko,

Quoted 27 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 24 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Quoted 7 lines
Quoted 5 lines

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

The uart part for bluetooth already is in: uart0.
However, I haven't tested if it really works.

In the new world there is now also a way to actually hook the bt-uart to the wifi driver without userspace intervention, and you might want to hook up the interrupt as well for sdio? For example look at the rock960:

sdio-interrupt: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi#n510
uart-magic: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi#n557

Heiko

Quoted 81 lines
Quoted 5 lines
Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

OK, thanks.
I will add you for the whole series when sending a v2.

Soeren

Quoted 70 lines

Heiko

Quoted 63 lines

[1] https://patchwork.kernel.org/project/linux-wireless/list/?series=213951

Quoted 61 lines

Thanks
Heiko

Quoted 55 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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): [email protected]

#23 lore raw

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

re-send as plain text for mailing lists, sorry.

Soeren

Quoted 139 lines · Soeren Moch
Quoted 36 lines · Heiko Stübner

Am Dienstag, 10. Dezember 2019, 11:08:18 CET schrieb Soeren Moch:

Quoted 35 lines

Hi Heiko,

Quoted 32 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

Quoted 6 lines
Quoted 2 lines

The uart part for bluetooth already is in: uart0.
However, I haven't tested if it really works.

In the new world there is now also a way to actually hook the bt-uart to the wifi driver without userspace intervention, and you might want to hook up the interrupt as well for sdio?
For example look at the rock960:

Thanks for the examples.

Quoted 1 line

sdio-interrupt: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi#n510

The signal name wifi_host_wake_l suggests that this is an active-low wake-up signal, probably used for wake-on-wifi. But in fact this is the active-high out-of-band sdio interrupt and can also be used as such on RockPro64 when following your example.
However, with this external interrupt enabled  wifi runs unstable, maybe because board designers (probably confused by their own naming style) mixed in the PCI-Express-WAKE# signal to route this to the same GPIO.

So I want to use the in-band sdio interrupt instead on RockPro64, which works perfectly fine.
||||

Quoted 1 line

uart-magic: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi#n557

OK, people probably like to see Bluetooth support. I will add it.

Soeren

Quoted 75 lines

Heiko

Quoted 72 lines
Quoted 5 lines
Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

OK, thanks.
I will add you for the whole series when sending a v2.

Soeren

Quoted 63 lines

Heiko

Quoted 60 lines

[1] https://patchwork.kernel.org/project/linux-wireless/list/?series=213951

Quoted 59 lines

Thanks
Heiko

Quoted 55 lines
---
 .../boot/dts/rockchip/rk3399-rockpro64.dts    | 21 ++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +14 -8
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): 0101016eef171394-2c71e1b8-45b9-4e38-96f9-2841dd0607ba-000000@us-west-2.amazonses.com

#25 lore raw

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

Quoted 37 lines · Kalle Valo
Quoted 35 lines · Heiko Stübner

Hi Soeren,

Am Dienstag, 10. Dezember 2019, 00:29:21 CET schrieb Soeren Moch:

Quoted 17 lines · Heiko Stübner
Quoted 10 lines

Am Montag, 9. Dezember 2019, 23:38:22 CET schrieb Soeren Moch:

Quoted 9 lines

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.

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

Quoted 6 lines
Quoted 4 lines

This last patch in this brcmfmac patch series probably should be picked up by Heiko independently of the rest of this series. It was sent together to show how this brcmfmac extension for 4359-sdio support with RSDB is used and tested.

node placement looks good so I can apply it, just a general questions I only got patch 8/8 are patches 1-7 relevant for this one and what are they?

Quoted 7 lines

Patches 1-7 are the patches to support the BCM4359 chipset with SDIO interface in the linux brcmfmac net-wireless driver, see [1].

So this patch series has 2 parts:
patches 1-7: add support for the wifi chipset in the wireless driver, this has to go through net-wireless
patch 8: enable the wifi module with this chipset on RockPro64, this patch

Thanks for the clarification :-) .

As patch 8 "only" does the core sdio node, it doesn't really depend on the earlier ones and you can submit any uart-hooks for bluetooth once the other patches land I guess.

Quoted 1 line

If this was confusing, what would be the ideal way to post such series?

Quoted 9 lines
Quoted 4 lines

I think every maintainer has some slightly different perspective on this, but personally I like getting the whole series to follow the discussion but also to just see when the driver-side changes get merged, as the dts-parts need to wait for that in a lot of cases.

FWIW I prefer the same as Heiko. If I don't see all the patches in the patchset I start worrying if patchwork lost them, or something, and then it takes more time from me to investigate what happened. So I strongly recommend sending the whole series to everyone as it saves time.

Thanks for your explanation.
I will keep this in mind for future submissions.

Soeren

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

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

#27 lore raw

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

Hi Soeren,

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

Quoted 11 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +5 -0
index 7f4b2eba31d4..9fa92790d6e0 100644
 
+&sdio0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
 
+	disable-wp;

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.

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts +8 -0
+	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";
+};
Reviewed-by on v1 1/8
#28 lore raw
In reply to Soeren Moch
Quoted 7 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.

Quoted 131 lines

---
Cc: Kalle Valo <[email protected]>
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Chi-Hsien Lin <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
  .../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 -2
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

.

#29 lore raw
In reply to Soeren Moch
Quoted 7 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.

Soeren's s-o-b missing at least in patches 1, 6 and 7. Please read:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#signed-off-by_missing

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

A message that is not in the archive (sent off-list or not yet received): 0101016eef117d24-d6de85e6-6356-4c73-bff4-f787e8c982bc-000000@us-west-2.amazonses.com

#31 lore raw
Quoted 4 lines · Kalle Valo
Quoted 2 lines · Soeren Moch

From: Wright Feng <[email protected]>

Quoted 9 lines
Quoted 5 lines

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.

Soeren's s-o-b missing at least in patches 1, 6 and 7. Please read:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#signed-off-by_missing

OK, also for unmodified patches another s-o-b is required. I will add them when sending a v2 of this series.

Thanks,
Soeren

#32 lore raw
Quoted 9 lines · Soeren Moch
Quoted 8 lines · Kalle Valo
Quoted 6 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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Soeren's s-o-b missing at least in patches 1, 6 and 7. Please read:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#signed-off-by_missing

OK, also for unmodified patches another s-o-b is required.

Yes, every patch you submit needs to have your s-o-b to mark that you agree with Developer's Certificate of Origin.

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches