From patchwork Wed Jan 4 10:01:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 38842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5062966wrt; Wed, 4 Jan 2023 02:07:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXtD0fq/WISuOCpbLYS41SF3PWdd+/DwnwxxRxtlGRw+n8cJ48oEgtVfPd7+APU5huuSQc2R X-Received: by 2002:a17:90a:2d7:b0:226:711d:6e4a with SMTP id d23-20020a17090a02d700b00226711d6e4amr10315050pjd.6.1672826856529; Wed, 04 Jan 2023 02:07:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672826856; cv=none; d=google.com; s=arc-20160816; b=Soa30ZmOJy0Si1u9GC+qhvOxiXXaDBztLNqMOK7X1kXOLfKK7DqHUuO50clY7hmTFb w4kahGix0ydj/lmqmO1nSeF9KiprsZnr2AOg0/h+6CU+3gmZL7SvXGL7wxD630DdWTtC 842235qfbUQYgtuCpVKxvAzD0KnV0vnDv9p/wTikA0cSxnNrKTy3ORvtwSaFZFa6U6nG Klw9iWQsf6HbB2yOs9yOenQA/6tQdO8UmslhltkEbpDInv09mZP/eDl28yCMTtJNJHoo R9DXzYanInDz+/JzMYzU9v7tUaeIgnN1CQgXBdOO/LrpQqgaQhx/fWxxnb3at9ixnJ1Z hUsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6EbqDUzHmtO2VX1mqSEC5WpqBCQK/AmyuQhq3H6MgjM=; b=wXOB66OOUGQ3F8DRtK1hHviVeqTFQIuYXz3tBZpUPMZS94y5LCIxDTo9thqq0cUJGY KvdQuy1f7GRH5cXk57m7CzYgrG/wtujuCo3MNvqmBOGuOPJ5CHBLuelL+7Gpw5ZOwmy4 sdXLJNED1SHfDbifD1aoAs4CrlH1CuOxfvwzCXpJREbVws+1DdeXTQwpKjClBPXjPx0t nzRMTO90OLY7xL5OECgqRbWsQ5r4+HE9xtsY0W/pwddTAZtMoTnhAOnf5PKRnOlOAmVG /+GWF1IcpNvwdJs/tgD2R5op9XTJmw7GrZp9UPOlClpbFYVNMW7RR+DmfIxX/wDjr9EO YkZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=tduLWqcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw10-20020a17090b4d0a00b00218a37dc58dsi36115023pjb.27.2023.01.04.02.07.24; Wed, 04 Jan 2023 02:07:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=tduLWqcu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238864AbjADKEo (ORCPT + 99 others); Wed, 4 Jan 2023 05:04:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238660AbjADKEY (ORCPT ); Wed, 4 Jan 2023 05:04:24 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3741EC4C; Wed, 4 Jan 2023 02:04:04 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id BD67D3FB17; Wed, 4 Jan 2023 10:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672826642; bh=mOkwVVJsiF2o68VapbxsbLp3kJIi/NRtPGVxBs/LkVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tduLWqcuVmmegdi78Vufu0LCcxOzMpvUVRexGQ6cqOQfGC8bcgvy6t1xgGwOB5i4a V+0KKlGdeM6OH1gl5YQeg1Wt9433ni6phTfsuRA2G9NUflHxyVCqzBFQ3++chO2rx8 OK1uNaUp9/5Si2kculkTLn/JjPw924yAvKpWMg4y5CgV8MGCtxG9UFsn4drCl1OTI0 iMByomQr/Z60wT2S4ahgcTRYuZ/wuN7IUCdJjmXv5Ev0UrAB2VpmRUm+PSrZfW9MTz Nqhq11L0WLTaVkYj2oI8+sVO8cOpA2AhkTRZyxnWENXB30bcaA61+qP48RkmyoE7uy QaO+EmRYL/lUw== From: Hector Martin To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Prutskov , Chi-Hsien Lin , Wright Feng , Ian Lin , Soontak Lee , Joseph chuang , Sven Peter , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Hector Martin , Linus Walleij Subject: [PATCH v1 4/4] brcmfmac: pcie: Perform correct BCM4364 firmware selection Date: Wed, 4 Jan 2023 19:01:16 +0900 Message-Id: <20230104100116.729-5-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230104100116.729-1-marcan@marcan.st> References: <20230104100116.729-1-marcan@marcan.st> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754086094169082567?= X-GMAIL-MSGID: =?utf-8?q?1754086094169082567?= This chip exists in two revisions (B2=r3 and B3=r4) on different platforms, and was added without regard to doing proper firmware selection or differentiating between them. Fix this to have proper per-revision firmwares and support Apple NVRAM selection. Revision B2 is present on at least these Apple T2 Macs: kauai: MacBook Pro 15" (Touch/2018-2019) maui: MacBook Pro 13" (Touch/2018-2019) lanai: Mac mini (Late 2018) ekans: iMac Pro 27" (5K, Late 2017) And these non-T2 Macs: nihau: iMac 27" (5K, 2019) Revision B3 is present on at least these Apple T2 Macs: bali: MacBook Pro 16" (2019) trinidad: MacBook Pro 13" (2020, 4 TB3) borneo: MacBook Pro 16" (2019, 5600M) kahana: Mac Pro (2019) kahana: Mac Pro (2019, Rack) hanauma: iMac 27" (5K, 2020) kure: iMac 27" (5K, 2020, 5700/XT) Fixes: 24f0bd136264 ("brcmfmac: add the BRCM 4364 found in MacBook Pro 15,2") Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Reviewed-by: Arend van Spriel --- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index c203f14343d3..65e0604c0c42 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -57,7 +57,8 @@ BRCMF_FW_CLM_DEF(4356, "brcmfmac4356-pcie"); BRCMF_FW_CLM_DEF(43570, "brcmfmac43570-pcie"); BRCMF_FW_DEF(4358, "brcmfmac4358-pcie"); BRCMF_FW_DEF(4359, "brcmfmac4359-pcie"); -BRCMF_FW_DEF(4364, "brcmfmac4364-pcie"); +BRCMF_FW_CLM_DEF(4364B2, "brcmfmac4364b2-pcie"); +BRCMF_FW_CLM_DEF(4364B3, "brcmfmac4364b3-pcie"); BRCMF_FW_DEF(4365B, "brcmfmac4365b-pcie"); BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); @@ -88,7 +89,8 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_43570_CHIP_ID, 0xFFFFFFFF, 43570), BRCMF_FW_ENTRY(BRCM_CC_4358_CHIP_ID, 0xFFFFFFFF, 4358), BRCMF_FW_ENTRY(BRCM_CC_4359_CHIP_ID, 0xFFFFFFFF, 4359), - BRCMF_FW_ENTRY(BRCM_CC_4364_CHIP_ID, 0xFFFFFFFF, 4364), + BRCMF_FW_ENTRY(BRCM_CC_4364_CHIP_ID, 0x0000000F, 4364B2), /* 3 */ + BRCMF_FW_ENTRY(BRCM_CC_4364_CHIP_ID, 0xFFFFFFF0, 4364B3), /* 4 */ BRCMF_FW_ENTRY(BRCM_CC_4365_CHIP_ID, 0x0000000F, 4365B), BRCMF_FW_ENTRY(BRCM_CC_4365_CHIP_ID, 0xFFFFFFF0, 4365C), BRCMF_FW_ENTRY(BRCM_CC_4366_CHIP_ID, 0x0000000F, 4366B), @@ -2003,6 +2005,11 @@ static int brcmf_pcie_read_otp(struct brcmf_pciedev_info *devinfo) base = 0x8c0; words = 0xb2; break; + case BRCM_CC_4364_CHIP_ID: + coreid = BCMA_CORE_CHIPCOMMON; + base = 0x8c0; + words = 0x1a0; + break; case BRCM_CC_4377_CHIP_ID: case BRCM_CC_4378_CHIP_ID: coreid = BCMA_CORE_GCI;