From patchwork Fri Feb 10 02:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 55196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp716235wrn; Thu, 9 Feb 2023 18:58:42 -0800 (PST) X-Google-Smtp-Source: AK7set9wtWSLmZxxb1kYsKAJ0vk0c1tl71vvvlaLP2692RAvAH/ZvS5Psj1y4y53DLbAzUOehCVb X-Received: by 2002:a17:90b:1bca:b0:22c:79bf:bee1 with SMTP id oa10-20020a17090b1bca00b0022c79bfbee1mr15074923pjb.10.1675997921691; Thu, 09 Feb 2023 18:58:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675997921; cv=none; d=google.com; s=arc-20160816; b=gkPbXGJC9qrNVXDYow0vPfL/iv4Q6v4+J7BRcpd9ZoIwqK8u7w9a81F5LRv3oXLdmH fnuZIfNesOhR7yucwOYZk8TCeENt9HuCdQE8FBhTb+2OSpE9Ci5M426y98vmC260DP3T +lYE43sod6eP1yFokghFh+53niTvYMl5n/TS90ALMnUE9DwhjbWVH9l3RJrqNmUsjf0D dXc+5gTD09/axadK7EhPNKE2YQiBf9WIQM5vOa+eBv3A1YHctmP05v4ERNsw7jTYrT7n 3V2Ek8EkQVoQPv/uz8GlpfWlEqrQsp44nf/dciMTib8GjF8hFJPUHue1h5X98gdtA9Ss fNzg== 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=Ipp8J9QN6Z4en2wqbo4mCZUNEmiRyI2I4WK5X/p5CEk=; b=sLkONMs9X2Prm1l/HyXWW4us0R1j0NfWJg/22WTLegJHYa7iAsJXnhKWbr8W/YrRTz BXL0pYBXvicB1ppYcn2PoY4UtExE5fw003pXnQu3mZAsLfpGvput2mB8Ia1ysNnBlqV4 Os4vJrH/0mlN8X3By1mJKqnhb+xhph3FSMDrI/JTSyeyMs81llmxXNmKSS6rRGfMLxEL GCjhFY4NutBBRxfOKvIG37kr1ID4L3M3ongoRSNYvirIMjgMniA84XHx6WuN5fDTkWuT 2ryjnzB1nUkeUg8qwjHK1OQaPY0FTK5MLDz9Y1jBFjf1WJWZkS/ft5vPK4lQpRU5CShr jXGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=SrwgyPSN; 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 bf18-20020a17090b0b1200b00231237e8577si2486195pjb.52.2023.02.09.18.58.29; Thu, 09 Feb 2023 18:58:41 -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=SrwgyPSN; 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 S230369AbjBJCu5 (ORCPT + 99 others); Thu, 9 Feb 2023 21:50:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbjBJCux (ORCPT ); Thu, 9 Feb 2023 21:50:53 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A2FA74304; Thu, 9 Feb 2023 18:50:48 -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 CA14E424A3; Fri, 10 Feb 2023 02:50:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675997446; bh=adcFx8+Ki3/6rJCB6FOrhipz/dSoNnMHTrkx6UZeD+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SrwgyPSNj/B+ZZvbJbQz3hhMPPW/7Cjnq51Qln1Lp/3wv+da8V72Trf2qdSN5yQc9 jIG+7YQmY0swWPe1ScfN29F75Sc72VmpoSJgAuncmNuz1oYJQCviwAnt+A/aJ7yKMg 4SVjmUYYQkIEv1kvsM/2s+8STeaQKRdiNc+vTEE1eBNlzv9tH9k5d2qrXqDoA0jMNs QMT+NzEleIMiWANUpP5A5Rc9Qyy010XpZML5GjnzJT0nZvUKT0eY4b2SN5+mdEvi8r Q9AC4PchLAmYO/KymOvO9vsRvSXVlbPcgnEIDJ2RYaNrKyghLKKrlu3/1Vw/Mzy6gB Ni7MWF79Ml9ag== 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 , Aditya Garg , Jonas Gorski , 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 , Arend van Spriel Subject: [PATCH v3 2/4] brcmfmac: pcie: Add IDs/properties for BCM4355 Date: Fri, 10 Feb 2023 11:50:07 +0900 Message-Id: <20230210025009.21873-3-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230210025009.21873-1-marcan@marcan.st> References: <20230210025009.21873-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?1757411196717354299?= X-GMAIL-MSGID: =?utf-8?q?1757411196717354299?= This chip is present on at least these Apple T2 Macs: * hawaii: MacBook Air 13" (Late 2018) * hawaii: MacBook Air 13" (True Tone, 2019) Users report seeing PCI revision ID 12 for this chip, which Arend reports should be revision C2, but Apple has the firmware tagged as revision C1. Assume the right cutoff point for firmware versions is revision ID 11 then, and leave older revisions using the non-versioned firmware filename (Apple only uses C1 firmware builds). Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin --- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 10 +++++++++- .../wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 96608174a123..7135f889907a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -52,6 +52,7 @@ BRCMF_FW_DEF(43602, "brcmfmac43602-pcie"); BRCMF_FW_DEF(4350, "brcmfmac4350-pcie"); BRCMF_FW_DEF(4350C, "brcmfmac4350c2-pcie"); BRCMF_FW_CLM_DEF(4355, "brcmfmac4355-pcie"); +BRCMF_FW_CLM_DEF(4355C1, "brcmfmac4355c1-pcie"); BRCMF_FW_CLM_DEF(4356, "brcmfmac4356-pcie"); BRCMF_FW_CLM_DEF(43570, "brcmfmac43570-pcie"); BRCMF_FW_DEF(4358, "brcmfmac4358-pcie"); @@ -78,7 +79,8 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_4350_CHIP_ID, 0x000000FF, 4350C), BRCMF_FW_ENTRY(BRCM_CC_4350_CHIP_ID, 0xFFFFFF00, 4350), BRCMF_FW_ENTRY(BRCM_CC_43525_CHIP_ID, 0xFFFFFFF0, 4365C), - BRCMF_FW_ENTRY(BRCM_CC_4355_CHIP_ID, 0xFFFFFFFF, 4355), + BRCMF_FW_ENTRY(BRCM_CC_4355_CHIP_ID, 0x000007FF, 4355), + BRCMF_FW_ENTRY(BRCM_CC_4355_CHIP_ID, 0xFFFFF800, 4355C1), /* rev ID 12/C2 seen */ BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), BRCMF_FW_ENTRY(BRCM_CC_43567_CHIP_ID, 0xFFFFFFFF, 43570), BRCMF_FW_ENTRY(BRCM_CC_43569_CHIP_ID, 0xFFFFFFFF, 43570), @@ -1994,6 +1996,11 @@ static int brcmf_pcie_read_otp(struct brcmf_pciedev_info *devinfo) int ret; switch (devinfo->ci->chip) { + case BRCM_CC_4355_CHIP_ID: + coreid = BCMA_CORE_CHIPCOMMON; + base = 0x8c0; + words = 0xb2; + break; case BRCM_CC_4378_CHIP_ID: coreid = BCMA_CORE_GCI; base = 0x1120; @@ -2590,6 +2597,7 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4354_RAW_DEVICE_ID, WCC), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4355_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID, WCC), diff --git a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h index 28b6cf8ff286..6e27e3966655 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -72,6 +72,7 @@ #define BRCM_PCIE_4350_DEVICE_ID 0x43a3 #define BRCM_PCIE_4354_DEVICE_ID 0x43df #define BRCM_PCIE_4354_RAW_DEVICE_ID 0x4354 +#define BRCM_PCIE_4355_DEVICE_ID 0x43dc #define BRCM_PCIE_4356_DEVICE_ID 0x43ec #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 #define BRCM_PCIE_43570_DEVICE_ID 0x43d9