c0a1fcd6150b87396068a717eceb19187383f6aa
[openwrt/staging/noltari.git] /
1 From 99d94ef367af67f630b38c93ff46c5819b7d06b6 Mon Sep 17 00:00:00 2001
2 From: Wright Feng <Wright.Feng@cypress.com>
3 Date: Thu, 25 Apr 2019 07:05:46 +0000
4 Subject: [PATCH] brcmfmac: send mailbox interrupt twice for specific hardware
5 device
6
7 For PCIE wireless device with core revision less than 14, device may miss
8 PCIE to System Backplane Interrupt via PCIEtoSBMailbox. So add sending
9 mail box interrupt twice as a hardware workaround.
10
11 Signed-off-by: Wright Feng <wright.feng@cypress.com>
12 Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
13 Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
14 ---
15 drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++++-
16 1 file changed, 5 insertions(+), 1 deletion(-)
17
18 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
19 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
20 @@ -698,7 +698,11 @@ brcmf_pcie_send_mb_data(struct brcmf_pci
21
22 brcmf_pcie_write_tcm32(devinfo, addr, htod_mb_data);
23 pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
24 - pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
25 +
26 + /* Send mailbox interrupt twice as a hardware workaround */
27 + core = brcmf_chip_get_core(devinfo->ci, BCMA_CORE_PCIE2);
28 + if (core->rev <= 13)
29 + pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_SBMBX, 1);
30
31 return 0;
32 }