mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aditya Garg <gargaditya08@live.com>
To: Hector Martin <marcan@marcan.st>,
	"aspriel@gmail.com" <aspriel@gmail.com>,
	"hante.meuleman@broadcom.com" <hante.meuleman@broadcom.com>,
	"kvalo@kernel.org" <kvalo@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"lina@asahilina.net" <lina@asahilina.net>,
	"franky.lin@broadcom.com" <franky.lin@broadcom.com>,
	Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Orlando Chamberlain <redecorating@protonmail.com>,
	"brcm80211-dev-list@broadcom.com"
	<brcm80211-dev-list@broadcom.com>,
	"brcm80211-dev-list.pdl@broadcom.com" 
	<brcm80211-dev-list.pdl@broadcom.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Asahi Linux <asahi@lists.linux.dev>
Subject: [PATCH v2 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips
Date: Mon, 2 Jan 2023 14:46:51 +0000	[thread overview]
Message-ID: <E376F3F1-CA88-47B3-B3D1-EEF0B283D25D@live.com> (raw)
In-Reply-To: <ACC0D1F6-7857-4FF0-A474-4EC699572E1B@live.com>

From: Aditya Garg <gargaditya08@live.com>

Commit 'dce45ded7619' added support for 89459 chip pcie device. It uses the
BRCM4355 chip which is also found in Apple hardware. However this commit
causes conflicts in the firmware naming between Apple hardware, which
supports OTP and other non-Apple hardwares. So, this patch makes these
Apple chips use their own firmware table so as to avoid possible conflicts
like these in the future.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
---
 .../broadcom/brcm80211/brcmfmac/pcie.c        | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index ae57a9a3a..ad7a780cd 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -92,10 +92,13 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = {
 	BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C),
 	BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C),
 	BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371),
-	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* revision ID 3 */
 	BRCMF_FW_ENTRY(CY_CC_89459_CHIP_ID, 0xFFFFFFFF, 4355),
 };
 
+static const struct brcmf_firmware_mapping brcmf_pcie_otp_fwnames[] = {
+	BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* revision ID 3 */
+};
+
 #define BRCMF_PCIE_FW_UP_TIMEOUT		5000 /* msec */
 
 #define BRCMF_PCIE_REG_MAP_SIZE			(32 * 1024)
@@ -2165,10 +2168,16 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
 		{ ".clm_blob", devinfo->clm_name },
 	};
 
-	fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev,
-				       brcmf_pcie_fwnames,
-				       ARRAY_SIZE(brcmf_pcie_fwnames),
-				       fwnames, ARRAY_SIZE(fwnames));
+	if (devinfo->otp.valid)
+		fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev,
+					       brcmf_pcie_otp_fwnames,
+					       ARRAY_SIZE(brcmf_pcie_otp_fwnames),
+					       fwnames, ARRAY_SIZE(fwnames));
+	else
+		fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev,
+					       brcmf_pcie_fwnames,
+					       ARRAY_SIZE(brcmf_pcie_fwnames),
+					       fwnames, ARRAY_SIZE(fwnames));
 	if (!fwreq)
 		return NULL;
 
-- 
2.34.1


  parent reply	other threads:[~2023-01-02 14:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02  7:46 [REGRESSION] Wi-Fi fails to work on BCM4364B2 chips since kernel 6.1 Aditya Garg
2023-01-02  8:21 ` Linux kernel regression tracking (#info)
2023-01-02 10:27   ` Thorsten Leemhuis
2023-01-02  8:47 ` Hector Martin
2023-01-02  8:57   ` Aditya Garg
2023-01-02  9:13     ` Hector Martin
2023-01-02 14:40     ` [PATCH 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Aditya Garg
2023-01-02 14:41       ` [PATCH 2/2] brcmfmac: Add PCIe ID of BCM4355 chip found on T2 Macs Aditya Garg
2023-01-02 14:46         ` Aditya Garg
2023-01-03  2:08         ` kernel test robot
2023-01-02 14:46       ` Aditya Garg [this message]
2023-01-02 14:48         ` [PATCH v2 " Aditya Garg
2023-01-02 15:15       ` [PATCH 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Hector Martin
2023-01-02 15:24         ` Aditya Garg
2023-01-02 18:27         ` Arend Van Spriel
2023-01-03  3:55           ` Hector Martin
2023-01-03 13:30             ` Arend van Spriel
2023-01-03 13:46               ` Hector Martin
2023-01-04  9:32                 ` Arend van Spriel
2023-01-03 19:59               ` Zzy Wysm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E376F3F1-CA88-47B3-B3D1-EEF0B283D25D@live.com \
    --to=gargaditya08@live.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=asahi@lists.linux.dev \
    --cc=aspriel@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=lina@asahilina.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=pabeni@redhat.com \
    --cc=redecorating@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®