Commit 2bee4127 authored by Frank Kao's avatar Frank Kao Committed by Kalle Valo

brcmfmac: set F2 blocksize and watermark for 4354/4356 SDIO

Set F2 blocksize to 256 bytes and watermark to 0x40 for 4354/4356 SDIO.
Also enable and configure F1 MesBusyCtrl. It would resolve random driver
crash issue.
Signed-off-by: default avatarFrank Kao <frank.kao@cypress.com>
Signed-off-by: default avatarChi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200529034938.124533-4-chi-hsien.lin@cypress.com
parent 528158a8
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define SDIO_FUNC1_BLOCKSIZE 64 #define SDIO_FUNC1_BLOCKSIZE 64
#define SDIO_FUNC2_BLOCKSIZE 512 #define SDIO_FUNC2_BLOCKSIZE 512
#define SDIO_4373_FUNC2_BLOCKSIZE 256 #define SDIO_4373_FUNC2_BLOCKSIZE 256
#define SDIO_4359_FUNC2_BLOCKSIZE 256 #define SDIO_435X_FUNC2_BLOCKSIZE 256
/* Maximum milliseconds to wait for F2 to come up */ /* Maximum milliseconds to wait for F2 to come up */
#define SDIO_WAIT_F2RDY 3000 #define SDIO_WAIT_F2RDY 3000
...@@ -916,7 +916,11 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev) ...@@ -916,7 +916,11 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev *sdiodev)
f2_blksz = SDIO_4373_FUNC2_BLOCKSIZE; f2_blksz = SDIO_4373_FUNC2_BLOCKSIZE;
break; break;
case SDIO_DEVICE_ID_BROADCOM_4359: case SDIO_DEVICE_ID_BROADCOM_4359:
f2_blksz = SDIO_4359_FUNC2_BLOCKSIZE; /* fallthrough */
case SDIO_DEVICE_ID_BROADCOM_4354:
/* fallthrough */
case SDIO_DEVICE_ID_BROADCOM_4356:
f2_blksz = SDIO_435X_FUNC2_BLOCKSIZE;
break; break;
default: default:
break; break;
......
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
#define CY_4339_MES_WATERMARK 80 #define CY_4339_MES_WATERMARK 80
#define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \ #define CY_4339_MESBUSYCTRL (CY_4339_MES_WATERMARK | \
SBSDIO_MESBUSYCTRL_ENAB) SBSDIO_MESBUSYCTRL_ENAB)
#define CY_4359_F2_WATERMARK 0x40 #define CY_435X_F2_WATERMARK 0x40
#define CY_4359_F1_MESBUSYCTRL (CY_4359_F2_WATERMARK | SBSDIO_MESBUSYCTRL_ENAB) #define CY_435X_F1_MESBUSYCTRL (CY_435X_F2_WATERMARK | \
SBSDIO_MESBUSYCTRL_ENAB)
#ifdef DEBUG #ifdef DEBUG
#define BRCMF_TRAP_INFO_SIZE 80 #define BRCMF_TRAP_INFO_SIZE 80
...@@ -4227,17 +4227,21 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err, ...@@ -4227,17 +4227,21 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
CY_4339_MESBUSYCTRL, &err); CY_4339_MESBUSYCTRL, &err);
break; break;
case SDIO_DEVICE_ID_BROADCOM_4359: case SDIO_DEVICE_ID_BROADCOM_4359:
/* fallthrough */
case SDIO_DEVICE_ID_BROADCOM_4354:
/* fallthrough */
case SDIO_DEVICE_ID_BROADCOM_4356:
brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n", brcmf_dbg(INFO, "set F2 watermark to 0x%x*4 bytes\n",
CY_4359_F2_WATERMARK); CY_435X_F2_WATERMARK);
brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
CY_4359_F2_WATERMARK, &err); CY_435X_F2_WATERMARK, &err);
devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL, devctl = brcmf_sdiod_readb(sdiod, SBSDIO_DEVICE_CTL,
&err); &err);
devctl |= SBSDIO_DEVCTL_F2WM_ENAB; devctl |= SBSDIO_DEVCTL_F2WM_ENAB;
brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl, brcmf_sdiod_writeb(sdiod, SBSDIO_DEVICE_CTL, devctl,
&err); &err);
brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL, brcmf_sdiod_writeb(sdiod, SBSDIO_FUNC1_MESBUSYCTRL,
CY_4359_F1_MESBUSYCTRL, &err); CY_435X_F1_MESBUSYCTRL, &err);
break; break;
default: default:
brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK, brcmf_sdiod_writeb(sdiod, SBSDIO_WATERMARK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment