9ba6931f8ddc46de673853e0a9226cbfb123ff7b
[openwrt/openwrt.git] /
1 From 58e4bbea0c1d9b5ace11df968c5dc096ce052a73 Mon Sep 17 00:00:00 2001
2 From: Madhan Mohan R <MadhanMohan.R@cypress.com>
3 Date: Wed, 21 Nov 2018 07:53:45 +0000
4 Subject: [PATCH] brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373
5
6 Along with F2 watermark (existing) configuration, F1 MesBusyCtrl
7 should be enabled & sdio device RX FIFO watermark should be
8 configured to avoid overflow errors.
9
10 Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
11 Signed-off-by: Madhan Mohan R <madhanmohan.r@cypress.com>
12 Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
13 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
14 ---
15 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 +++
16 drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h | 9 ++++++++-
17 2 files changed, 11 insertions(+), 1 deletion(-)
18
19 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
20 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
21 @@ -4130,6 +4130,9 @@ static void brcmf_sdio_firmware_callback
22 devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
23 brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
24 &err);
25 + brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL,
26 + CY_4373_F2_WATERMARK |
27 + SBSDIO_MESBUSYCTRL_ENAB, &err);
28 break;
29 default:
30 brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
31 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
32 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h
33 @@ -77,7 +77,7 @@
34 #define SBSDIO_GPIO_OUT 0x10006
35 /* gpio enable */
36 #define SBSDIO_GPIO_EN 0x10007
37 -/* rev < 7, watermark for sdio device */
38 +/* rev < 7, watermark for sdio device TX path */
39 #define SBSDIO_WATERMARK 0x10008
40 /* control busy signal generation */
41 #define SBSDIO_DEVICE_CTL 0x10009
42 @@ -104,6 +104,13 @@
43 #define SBSDIO_FUNC1_RFRAMEBCHI 0x1001C
44 /* MesBusyCtl (rev 11) */
45 #define SBSDIO_FUNC1_MESBUSYCTRL 0x1001D
46 +/* Watermark for sdio device RX path */
47 +#define SBSDIO_MESBUSY_RXFIFO_WM_MASK 0x7F
48 +#define SBSDIO_MESBUSY_RXFIFO_WM_SHIFT 0
49 +/* Enable busy capability for MES access */
50 +#define SBSDIO_MESBUSYCTRL_ENAB 0x80
51 +#define SBSDIO_MESBUSYCTRL_ENAB_SHIFT 7
52 +
53 /* Sdio Core Rev 12 */
54 #define SBSDIO_FUNC1_WAKEUPCTRL 0x1001E
55 #define SBSDIO_FUNC1_WCTRL_ALPWAIT_MASK 0x1