mac80211: brcmfmac: backport remaining patches from the Linux 5.0
[openwrt/staging/jogo.git] / package / kernel / mac80211 / patches / brcm / 329-v5.0-0005-brcmfmac-allow-GCI-core-enumuration.patch
1 From b021a6bc1175442609af0b66d64f850883e155fb Mon Sep 17 00:00:00 2001
2 From: Chi-Hsien Lin <Chi-Hsien.Lin@cypress.com>
3 Date: Wed, 21 Nov 2018 07:53:48 +0000
4 Subject: [PATCH] brcmfmac: allow GCI core enumuration
5
6 GCI core is needed for ULP operation. Allow GCI core enumuration with
7 below changes:
8 - Allow GCI to be added to core list even when it doesn't have a wrapper.
9 - Allow 8K address space size.
10 - Don't overwrite the address value when an additional size descriptor
11 is in place.
12
13 Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
14 Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
15 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
16 ---
17 .../wireless/broadcom/brcm80211/brcmfmac/chip.c | 14 ++++++++------
18 1 file changed, 8 insertions(+), 6 deletions(-)
19
20 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
21 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c
22 @@ -786,7 +786,7 @@ static int brcmf_chip_dmp_get_regaddr(st
23 u32 *regbase, u32 *wrapbase)
24 {
25 u8 desc;
26 - u32 val;
27 + u32 val, szdesc;
28 u8 mpnum = 0;
29 u8 stype, sztype, wraptype;
30
31 @@ -832,14 +832,15 @@ static int brcmf_chip_dmp_get_regaddr(st
32
33 /* next size descriptor can be skipped */
34 if (sztype == DMP_SLAVE_SIZE_DESC) {
35 - val = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
36 + szdesc = brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
37 /* skip upper size descriptor if present */
38 - if (val & DMP_DESC_ADDRSIZE_GT32)
39 + if (szdesc & DMP_DESC_ADDRSIZE_GT32)
40 brcmf_chip_dmp_get_desc(ci, eromaddr, NULL);
41 }
42
43 - /* only look for 4K register regions */
44 - if (sztype != DMP_SLAVE_SIZE_4K)
45 + /* look for 4K or 8K register regions */
46 + if (sztype != DMP_SLAVE_SIZE_4K &&
47 + sztype != DMP_SLAVE_SIZE_8K)
48 continue;
49
50 stype = (val & DMP_SLAVE_TYPE) >> DMP_SLAVE_TYPE_S;
51 @@ -896,7 +897,8 @@ int brcmf_chip_dmp_erom_scan(struct brcm
52
53 /* need core with ports */
54 if (nmw + nsw == 0 &&
55 - id != BCMA_CORE_PMU)
56 + id != BCMA_CORE_PMU &&
57 + id != BCMA_CORE_GCI)
58 continue;
59
60 /* try to obtain register address info */