2019-12-11 23:54:26

by Soeren Moch

[permalink] [raw]
Subject: [PATCH v2 0/9] 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


2019-12-11 23:54:37

by Soeren Moch

[permalink] [raw]
Subject: [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.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Chi-Hsien Lin <[email protected]>
---
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 <[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]
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(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
index a795d781b4c5..0b5fbe5d8270 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
@@ -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;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
index 7b00f6a59e89..8fa38658e727 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h
@@ -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);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index f64ce5074a55..7ac72804e285 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -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

2019-12-11 23:55:00

by Soeren Moch

[permalink] [raw]
Subject: [PATCH v2 2/9] 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.

Signed-off-by: Chung-Hsien Hsu <[email protected]>
[slightly adapted for rebase on mainline linux]
Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Chi-Hsien Lin <[email protected]>
---
changes in v2:
- add review tag received for v1

Cc: Kalle Valo <[email protected]>
Cc: Heiko Stuebner <[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]
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(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index 96fd8e2bf773..68baf0189305 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -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);
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index 264ad63232f8..21e535072f3f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -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

2019-12-11 23:55:17

by Soeren Moch

[permalink] [raw]
Subject: [PATCH v2 6/9] brcmfmac: add RSDB condition when setting interface combinations

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.

Signed-off-by: Wright Feng <[email protected]>
Signed-off-by: Soeren Moch <[email protected]>
Reviewed-by: Chi-Hsien Lin <[email protected]>
---
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 <[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]
Cc: [email protected]
Cc: [email protected]
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 54 ++++++++++++++++---
1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 0cf13cea1dbe..9d9dc9195e9e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -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

2019-12-11 23:55:25

by Soeren Moch

[permalink] [raw]
Subject: [PATCH v2 3/9] brcmfmac: fix rambase for 4359/9

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

Signed-off-by: Soeren Moch <[email protected]>
---
changes in v2: none

Cc: Kalle Valo <[email protected]>
Cc: Heiko Stuebner <[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]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
index 0b5fbe5d8270..baf72e3984fc 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
@@ -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

2019-12-12 02:09:17

by Chi-Hsien Lin

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



On 12/12/2019 7:52, Soeren Moch wrote:
> Newer 4359 chip revisions need a different rambase address.
> This fixes firmware download on such devices which fails otherwise.
>
> Signed-off-by: Soeren Moch <[email protected]>
Acked-by: Chi-Hsien Lin <[email protected]>

> ---
> changes in v2: none
>
> Cc: Kalle Valo <[email protected]>
> Cc: Heiko Stuebner <[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]
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> index 0b5fbe5d8270..baf72e3984fc 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
> @@ -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
>
> .
>

2019-12-12 11:00:26

by Soeren Moch

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset

On 12.12.19 10:42, Kalle Valo wrote:
> Soeren Moch <[email protected]> writes:
>
>> 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(-)
> 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

2019-12-15 21:25:16

by Soeren Moch

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset

On 12.12.19 11:59, Soeren Moch wrote:
> On 12.12.19 10:42, Kalle Valo wrote:
>> Soeren Moch <[email protected]> writes:
>>
>>> 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(-)
>> 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.

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



2019-12-15 23:44:17

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset

Hi Soeren,

Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:
> On 12.12.19 11:59, Soeren Moch wrote:
> > On 12.12.19 10:42, Kalle Valo wrote:
> >> Soeren Moch <[email protected]> writes:
> >>
> >>> 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(-)
> >> 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.
>
> 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


2019-12-22 04:37:46

by Christian Hewitt

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset


> On 19 Dec 2019, at 2:04 am, Soeren Moch <[email protected]> wrote:
>
> 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

2019-12-24 09:46:02

by Christian Hewitt

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset



> On 24 Dec 2019, at 1:01 pm, Arend Van Spriel <[email protected]> wrote:
>
> 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

2020-03-15 07:04:08

by Chi-Hsien Lin

[permalink] [raw]
Subject: Re: [PATCH v2 0/9] brcmfmac: add support for BCM4359 SDIO chipset



On 03/13/2020 9:17, Soeren Moch wrote:
>
> On 13.03.20 12:03, Chi-Hsien Lin wrote:
>> On 12/16/2019 7:43, Heiko Stübner wrote:
>>> Hi Soeren,
>>>
>>> Am Sonntag, 15. Dezember 2019, 22:24:10 CET schrieb Soeren Moch:
>>>> On 12.12.19 11:59, Soeren Moch wrote:
>>>>> On 12.12.19 10:42, Kalle Valo wrote:
>>>>>> Soeren Moch <[email protected]> writes:
>>>>>>
>>>>>>> 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(-)
>>>>>> 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.
>>>>
>>>> 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 :-)
>>
>> 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.

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

>
> Thanks,
> Soeren
>
>>
>>
>> Regards,
>> Chi-hsien Lin
>>
>>>
>>> Heiko
>>>
>>>
>>> .
>>>
>