From patchwork Tue Jan 31 11:28:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 50779 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2698437wrn; Tue, 31 Jan 2023 03:36:21 -0800 (PST) X-Google-Smtp-Source: AK7set+VBhLR51ajZXg1An+bqxThMOh5oj3Ne2fGVeqXJqQAuv1Ygk+tSr/qOpqI/j1dyAFC8pJQ X-Received: by 2002:a05:6a00:14d6:b0:592:6522:edd with SMTP id w22-20020a056a0014d600b0059265220eddmr17889586pfu.29.1675164981261; Tue, 31 Jan 2023 03:36:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675164981; cv=none; d=google.com; s=arc-20160816; b=gAip2l/PSEoX7IRKSpOgKInVukTnvdzMARboMau94pVD80AN2g5zf+4iNemUACk4Po ZEZCs28mB3bZJ/yM/yY5k5vTV/4yquNQ0cGDYtApez/9Nuw9pe23Oej8dGsHXkJrNnXE 9GcTpK354eikUiH2O9ljmOFKrZDqbSd5olBQAq2pLvelfbfStcjLUqkabDq+uOcu1U5N 869QzWMN8oIdHM+2gyvDuUtdUZuqoUOJKj5x38F0k3f/hd24ZTH51iKIceSN8wIjdyDc OCmf69+CBOwDsnyaeobyPZi0LWBXuRxIhQOaFZN2oHcsKwCkWAhgw4PC+5PnxOvbIy3m 3t+w== 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=beJ747NUtuhIq1seGz/HlssxUQTTWnhau6f/EJui1Qk=; b=XTLlSmJ4XE6CCZ79es2Lfn5zzs3qogI+YQYnye5h/DHVK6CSJWd6LtzF828OYiFFs2 XhhSyCQVLBow0jzfqXt+qR48Zm0kBnqq+JdSoCXhVuOzejFG3sBOrufkFirzE4eGcpF1 Ca1qQqIchSl6Wb9nXhEDZff9mo9c+aMf7PKAflhtHzV2OpTl94SXC9jWyL3NzlGMF71D NdL7ExksSqIdAP7RTwbOs0kl+c/PHyZzXR2kASSh38RfrNL/bhlxG91dh7k34GjGZKT0 lWeCW56NdRcEzdVaALuVZK9cfF7Hs/7gkhV3xV4dkXPRvn8Iza67cWCtlELnkK1fu7qp 8VOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b="Q/RZ2cdR"; 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 x29-20020aa7941d000000b00593cbf483f7si5102789pfo.184.2023.01.31.03.36.08; Tue, 31 Jan 2023 03:36:21 -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="Q/RZ2cdR"; 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 S231571AbjAaLaY (ORCPT + 99 others); Tue, 31 Jan 2023 06:30:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbjAaLaR (ORCPT ); Tue, 31 Jan 2023 06:30:17 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71BEC4B898; Tue, 31 Jan 2023 03:30:16 -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 E8E6041A36; Tue, 31 Jan 2023 11:30:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675164615; bh=5gnsaR4FOCkWyPrei8p2FxTptYOhZoOOen1N58kwQSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Q/RZ2cdRDe3TsB/aQJ5VzDPNFsFaSH6KMIbBxhm/8hf0gGeJMTZAf7UdKNFQsE/fz BsMtDecgp1UzaAIRdRqO9emk/lmSEr4Sn3CFj+Z/9eVe/HgE0ZjNW9G9K9e9eflnjE q7cib2jY/rUlFN+0+kM1/3lwZLk/smZOMOfUwD4wtSNA9W8QVwGq0uKdTEtnxczwK0 snJEUWbWm+1AtbITcpXT6X8n25k0MNRzM1NGBgHkjrYux4jKjyhRFJNF6DwwqQ9eWB 14F7LTJwQ24mJsRkyyS1NlWK1cH6lFaTpDMcjNqbh+gH3TvvBxUdBIjvgHz3MximC3 BfaIUaBXFkFbA== 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 , 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 Subject: [PATCH v2 1/5] brcmfmac: Drop all the RAW device IDs Date: Tue, 31 Jan 2023 20:28:36 +0900 Message-Id: <20230131112840.14017-2-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230131112840.14017-1-marcan@marcan.st> References: <20230131112840.14017-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?1756537795077750113?= X-GMAIL-MSGID: =?utf-8?q?1756537795077750113?= These device IDs are only supposed to be visible internally, in devices without a proper OTP. They should never be seen in devices in the wild, so drop them to avoid confusion. Signed-off-by: Hector Martin Acked-by: Arend van Spriel --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 4 ---- drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 4 ---- 2 files changed, 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index ae57a9a3ab05..93f961d484c3 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -2589,17 +2589,14 @@ static const struct dev_pm_ops brcmf_pciedrvr_pm = { 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_4356_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID, WCC), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_RAW_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4358_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4359_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID, WCC), - BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4364_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID, BCA), @@ -2611,7 +2608,6 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(CY_PCIE_89459_DEVICE_ID, CYW), - BRCMF_PCIE_DEVICE(CY_PCIE_89459_RAW_DEVICE_ID, CYW), { /* end: all zeroes */ } }; 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 f4939cf62767..a211a72fca42 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -71,17 +71,14 @@ /* PCIE Device IDs */ #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_4356_DEVICE_ID 0x43ec #define BRCM_PCIE_43567_DEVICE_ID 0x43d3 #define BRCM_PCIE_43570_DEVICE_ID 0x43d9 -#define BRCM_PCIE_43570_RAW_DEVICE_ID 0xaa31 #define BRCM_PCIE_4358_DEVICE_ID 0x43e9 #define BRCM_PCIE_4359_DEVICE_ID 0x43ef #define BRCM_PCIE_43602_DEVICE_ID 0x43ba #define BRCM_PCIE_43602_2G_DEVICE_ID 0x43bb #define BRCM_PCIE_43602_5G_DEVICE_ID 0x43bc -#define BRCM_PCIE_43602_RAW_DEVICE_ID 43602 #define BRCM_PCIE_4364_DEVICE_ID 0x4464 #define BRCM_PCIE_4365_DEVICE_ID 0x43ca #define BRCM_PCIE_4365_2G_DEVICE_ID 0x43cb @@ -92,7 +89,6 @@ #define BRCM_PCIE_4371_DEVICE_ID 0x440d #define BRCM_PCIE_4378_DEVICE_ID 0x4425 #define CY_PCIE_89459_DEVICE_ID 0x4415 -#define CY_PCIE_89459_RAW_DEVICE_ID 0x4355 /* brcmsmac IDs */ #define BCM4313_D11N2G_ID 0x4727 /* 4313 802.11n 2.4G device */ From patchwork Tue Jan 31 11:28:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 50780 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2698748wrn; Tue, 31 Jan 2023 03:37:12 -0800 (PST) X-Google-Smtp-Source: AK7set8LXEq/eNCQAcs9HegHx9WLgjtjTEGDuKz5CCjvJMCltyAAKmFr5lhZdudehH3TMSpqEf8s X-Received: by 2002:a05:6a20:441a:b0:be:9629:2cbd with SMTP id ce26-20020a056a20441a00b000be96292cbdmr6978219pzb.14.1675165032160; Tue, 31 Jan 2023 03:37:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675165032; cv=none; d=google.com; s=arc-20160816; b=ahsmOPRq5SAEOlAgigrWZh0O2E0sKVbPA2nzBjtvhz9RK+m+gn3lWm5nZ8Sn1oPvDH h8qUCa+umIvefr6V9Dlclz5QtfmJwwPv1aijzqoYIj9if8YXe1QYe5XwCeTV3a168Ywa sL1Sd5EyzsmmOTBpAX2864djOSmnPMCBX+OGKvT9L5O2RaO6UvvyZxZeHepkXzPCdimn XmrfdHuXrUgwvMYMKRJrwZTBwX/hiS3/JfjtaP2UQ1O5ZmFWYCtTJM31Q9x+C79pClZH K77s4d6Ae5JCTSFKAor8ugs+C+YeO1Vc9twxwIOttx9++9zMVWnOeW9UtCye1AA2ZChV H5GQ== 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=AymYugvi5klFJm7+DURDLFn/srTt3OCHDvaU/ISSZ6U=; b=j/f0J4hZROAEKsKKcgDNvUVFuBOltHmNcqwbhTjkTt93sJGGjynHQWD4tgH9pRUAu/ Woxx7HO8VHIeZTy39tytVuZc+PzUIv80baEmx4XPpbhoIpBoSA8zSOOsISC8d5Afw6Fq MFrx4j0po3k2lRgvSdTSdrnIHitcPRLuQET+OEgsTCihyjBHm0MvBuVpT1xM/HNjTsLi nkXvmmyNi/H7JVxUYgaVeOX9ekUZb+pyR/CGxZLSbjmNSEYv27x8huMX6BnjweM3lXyf iEEExlgLkXfkZyE6tQoXffhbLXvt/RLiE37j3dDBbdtD3F7Mwe3TzQrf/SAcNYJQrNpL ++OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=lku5HmgO; 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 a12-20020a62bd0c000000b0058802fab480si16126573pff.324.2023.01.31.03.36.59; Tue, 31 Jan 2023 03:37:12 -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=lku5HmgO; 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 S231799AbjAaLad (ORCPT + 99 others); Tue, 31 Jan 2023 06:30:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231714AbjAaLa2 (ORCPT ); Tue, 31 Jan 2023 06:30:28 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3422E4B199; Tue, 31 Jan 2023 03:30:23 -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 8490F423CD; Tue, 31 Jan 2023 11:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675164621; bh=QToo3dK1nv6knDYvfMkyOx2zkHr0bW4w8RJevFbAXr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lku5HmgOYwoi2C3kd4bTg6GSEA88cnOktArTK20r9+soKDzbdggvwOzkJ4RgGSUcj I9sTW0e69JvPiAwj7IeMwKKo4IzFB/3zVga9+25MW4aOzmCTaeH1cXiEcY8KAmb5rI vb0dqlyhcyTlolBJNZh5MSRWMg3LwqNrzD4cT85jyuvqw5CVKzK1YKcHoYoAzZPQgU nYxgvPad7O87dI+6QJDXbr14+XN3T7sTrAj8EsWjyQt8o+V5bqISownIraZo/94DHC oej5ps8Z0VFupcYjFeUkOElSjqRKNmAhAG3972C4SfjV2mN3mO5OlQPUTu/ODzJGan TlTFBrXGIrwiw== 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 , 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 v2 2/5] wifi: brcmfmac: Rename Cypress 89459 to BCM4355 Date: Tue, 31 Jan 2023 20:28:37 +0900 Message-Id: <20230131112840.14017-3-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230131112840.14017-1-marcan@marcan.st> References: <20230131112840.14017-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?1756537849059440685?= X-GMAIL-MSGID: =?utf-8?q?1756537849059440685?= The commit that introduced support for this chip incorrectly claimed it is a Cypress-specific part, while in actuality it is just a variant of BCM4355 silicon (as evidenced by the chip ID). The relationship between Cypress products and Broadcom products isn't entirely clear but given what little information is available and prior art in the driver, it seems the convention should be that originally Broadcom parts should retain the Broadcom name. Thus, rename the relevant constants and firmware file. Also rename the specific 89459 PCIe ID to BCM43596, which seems to be the original subvariant name for this PCI ID (as defined in the out-of-tree bcmdhd driver). v2: Since Cypress added this part and will presumably be providing its supported firmware, we keep the CYW designation for this device. Fixes: dce45ded7619 ("brcmfmac: Support 89459 pcie") Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 5 ++--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 6 +++--- .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 121893bbaa1d..3e42c2bd0d9a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -726,6 +726,7 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) case BRCM_CC_43664_CHIP_ID: case BRCM_CC_43666_CHIP_ID: return 0x200000; + case BRCM_CC_4355_CHIP_ID: case BRCM_CC_4359_CHIP_ID: return (ci->pub.chiprev < 9) ? 0x180000 : 0x160000; case BRCM_CC_4364_CHIP_ID: @@ -735,8 +736,6 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) return 0x170000; case BRCM_CC_4378_CHIP_ID: return 0x352000; - case CY_CC_89459_CHIP_ID: - return ((ci->pub.chiprev < 9) ? 0x180000 : 0x160000); default: brcmf_err("unknown chip: %s\n", ci->pub.name); break; @@ -1426,8 +1425,8 @@ bool brcmf_chip_sr_capable(struct brcmf_chip *pub) addr = CORE_CC_REG(base, sr_control1); reg = chip->ops->read32(chip->ctx, addr); return reg != 0; + case BRCM_CC_4355_CHIP_ID: case CY_CC_4373_CHIP_ID: - case CY_CC_89459_CHIP_ID: /* explicitly check SR engine enable bit */ addr = CORE_CC_REG(base, sr_control0); reg = chip->ops->read32(chip->ctx, addr); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 93f961d484c3..6b57cb9444db 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -51,6 +51,7 @@ enum brcmf_pcie_state { 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(4356, "brcmfmac4356-pcie"); BRCMF_FW_CLM_DEF(43570, "brcmfmac43570-pcie"); BRCMF_FW_DEF(4358, "brcmfmac4358-pcie"); @@ -62,7 +63,6 @@ BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); -BRCMF_FW_DEF(4355, "brcmfmac89459-pcie"); /* firmware config files */ MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.txt"); @@ -78,6 +78,7 @@ 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_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), @@ -93,7 +94,6 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { 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), }; #define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */ @@ -2606,8 +2606,8 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC), + BRCMF_PCIE_DEVICE(BRCM_PCIE_43596_DEVICE_ID, CYW), BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC), - BRCMF_PCIE_DEVICE(CY_PCIE_89459_DEVICE_ID, CYW), { /* end: all zeroes */ } }; 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 a211a72fca42..eae609d5f42d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -37,6 +37,7 @@ #define BRCM_CC_4350_CHIP_ID 0x4350 #define BRCM_CC_43525_CHIP_ID 43525 #define BRCM_CC_4354_CHIP_ID 0x4354 +#define BRCM_CC_4355_CHIP_ID 0x4355 #define BRCM_CC_4356_CHIP_ID 0x4356 #define BRCM_CC_43566_CHIP_ID 43566 #define BRCM_CC_43567_CHIP_ID 43567 @@ -56,7 +57,6 @@ #define CY_CC_43012_CHIP_ID 43012 #define CY_CC_43439_CHIP_ID 43439 #define CY_CC_43752_CHIP_ID 43752 -#define CY_CC_89459_CHIP_ID 0x4355 /* USB Device IDs */ #define BRCM_USB_43143_DEVICE_ID 0xbd1e @@ -87,8 +87,8 @@ #define BRCM_PCIE_4366_2G_DEVICE_ID 0x43c4 #define BRCM_PCIE_4366_5G_DEVICE_ID 0x43c5 #define BRCM_PCIE_4371_DEVICE_ID 0x440d +#define BRCM_PCIE_43596_DEVICE_ID 0x4415 #define BRCM_PCIE_4378_DEVICE_ID 0x4425 -#define CY_PCIE_89459_DEVICE_ID 0x4415 /* brcmsmac IDs */ #define BCM4313_D11N2G_ID 0x4727 /* 4313 802.11n 2.4G device */ From patchwork Tue Jan 31 11:28:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 50781 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2698873wrn; Tue, 31 Jan 2023 03:37:32 -0800 (PST) X-Google-Smtp-Source: AK7set9OtF0PwbMmbe6Yw9h4I2dB4At0ZY5ZxU7PFtK170OGD7tWYRB1Fbx+/pW+KTBuefyBbjph X-Received: by 2002:a17:907:2d0e:b0:885:b1e5:b089 with SMTP id gs14-20020a1709072d0e00b00885b1e5b089mr3391819ejc.45.1675165052117; Tue, 31 Jan 2023 03:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675165052; cv=none; d=google.com; s=arc-20160816; b=0EBye92DZZNsi9LFPvpVCF3uLFOahR2Id9IoWdlbyxpUgOBWbdrLXPF1+vJrDrUTg7 xelSZqLlMaY+4mK/ek+glZ4RW+t0g5IESkH7d3OufCqvGXLNEHFqc0mFQaitQhloVXXY jsYRYJdyzHKxidIc6lEzfbouTQ7WtullaWbCr05fzbKpgcAt282PwpYt7xVLOODwpM6K HpyG6mOLY/C4TK/mVwmbS/GlgkbBmlEMclaW9KWkjFs77bUFk7LX+XB92eAaagINCYwc w2WTOMWld2ys7N4JagFwEjhn6V96Y1LIdaAEnK9DeaOkQoqC7c0DnDfXvYlw4ziOR5yO /cbg== 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=6Kf3xIRqZpUbOOM9UNsAmv0Ct/3F6fimyPLAbX6KMhA=; b=jvm1aKFZQfbGPWg5S2ew3Atrs0HOOHmy1Rd0W7aayGSXdfHt8pdAEpFULY0u6q8VkC FpWpPWk9eeSVzbcw9tdpEWk+RMCOqxoxN0XjWb0mbVfaJ9mXMxOCxRLRF3GETC9GDZ0a e/N+oV6HciCN1maR/4tJ3/yI+jeB2BXeadhsb4Lhf1yaiGCrF2WzLoet4qylIRiy+odh hvnVwQceEevBXkg2GoTrKcWqUsVIH3fEFQEOrz86jua5vKTSJBKNJO4Oxw7tal7Fm7ct y2k48/ZLkuWxmmzlnOaA9d7bpdfirXWhy1KhR6W2+uSup0YteRwVuYoiTpRSXZgOInA+ ECSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=VfU4DY0h; 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 22-20020a170906015600b008709928f35asi17987047ejh.367.2023.01.31.03.37.08; Tue, 31 Jan 2023 03:37:32 -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=VfU4DY0h; 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 S231766AbjAaLat (ORCPT + 99 others); Tue, 31 Jan 2023 06:30:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231624AbjAaLak (ORCPT ); Tue, 31 Jan 2023 06:30:40 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 356194C6E5; Tue, 31 Jan 2023 03:30:30 -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 58A303FA55; Tue, 31 Jan 2023 11:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675164628; bh=RAI0h2lA4o/hdKqi2ZNI6zElQfxA1ktCWmEhVcxOT5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VfU4DY0hc8q3MiPg5rUSDHSZ+ihX5G17z1SNmO1/wMQDSRFMrqdnWJFt0b76ApyqZ k2vXnousHaa3m7+JE+s4iawa+QsGieXRw7FlBQ1JjAcYPVPv4uljqN09empGad5uQm gHrBt797b+A8PRW+D7NvtF1Fz21RRDjRGpCYrzAMwfzv4Q8fTzkybA5VpYiv+kFfNu 0oXG6npRqUA8FbQTT6aRRcuiA3tchj0HQgSe8PZdG4Ua/Nc1F7wzDgkuRl4Neqoaf6 92dZCY+dANR6w4EtYh9M0x+dVmCUK+8KhlaqHLIZp0j+SeUXBPGLAdNTAa6XiPjz1E Yv/DjjklNXPzw== 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 , 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 v2 3/5] brcmfmac: pcie: Add IDs/properties for BCM4355 Date: Tue, 31 Jan 2023 20:28:38 +0900 Message-Id: <20230131112840.14017-4-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230131112840.14017-1-marcan@marcan.st> References: <20230131112840.14017-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?1756537869498232771?= X-GMAIL-MSGID: =?utf-8?q?1756537869498232771?= 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 6b57cb9444db..2b7da248fd93 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; @@ -2589,6 +2596,7 @@ static const struct dev_pm_ops brcmf_pciedrvr_pm = { 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_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 eae609d5f42d..f73ca914256f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -71,6 +71,7 @@ /* PCIE Device IDs */ #define BRCM_PCIE_4350_DEVICE_ID 0x43a3 #define BRCM_PCIE_4354_DEVICE_ID 0x43df +#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 From patchwork Tue Jan 31 11:28:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 50782 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2699025wrn; Tue, 31 Jan 2023 03:37:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXvqFyQXBjLVf8hFMDuSgyHmQDabFOvH89uW/j2CKQuhFrOEzLg7pU1ltK1rCx/WBffv6Z+D X-Received: by 2002:a05:6402:28ca:b0:499:c294:77af with SMTP id ef10-20020a05640228ca00b00499c29477afmr58364024edb.12.1675165075787; Tue, 31 Jan 2023 03:37:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675165075; cv=none; d=google.com; s=arc-20160816; b=gHp1Oaws7GPhLIbywhoJSz+75C1p3YcBM4YqbHz21lvtoBz1pvhNdYeeadDY3fk9Rq DCEruNfbxRYYbBeIoFlBjTJzSAY5gkLDb7Z1QEjoePAm570DuLT1fi4BIXxJ9hrAnWd8 EHvyTm6ASEWFnp2KjSFp/DIP4cf3FDG7OqagqhKzhNr4ATcc9NnpL4u8pRPBzbfMrnyg 4NpoRRJtY26/K2qZLUUJX/nWlP9YzIUrCQZTs4j03rVrKZn+V9m+dIKYjF+mBWE0J8T2 Mt3wyAP05UvnOWsDKi7s2e/J0udanGsQubE3fQQfXDpjEdZs91AcBNNI/AntB4fWAbjx NknA== 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=Hfrzjoi4KTGUv8C5a6UizUGXLdIeT1wmZcmcvPNPq3U=; b=Z/XDjehWjz7XzYrVpas1ns4oA9udqAAbv51U+wBbCZ9HjWTiO9tzJM5WiXALI4LE9D VgltRFDNI/igQ6nEnyGPNeby8xIMXGnlKLzmuIb4yYItIUTmRbBK6gueqz7udS4ekwnX qOp8vHV/7zBz2gIwL+BLK0OpqUbeZM7zl7C5I/O40SzJKizyHhM8biCDhcIY9j2z886z Cs+dQq5rvnRZ/3q50/NkhT4kl7h0jWcbBDbqOYCie1TPlmLA4l+/8zYDLGFZgaSsukS7 wvkMwT6nordXmIeRsM8ADuPhMxM7nl551PTm0M5lcNwV7lIUVGk1EsBq4IwL8+x61FVM xCxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=PKUYUaJM; 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 x2-20020a056402414200b004a20a775cd8si16023333eda.298.2023.01.31.03.37.32; Tue, 31 Jan 2023 03:37:55 -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=PKUYUaJM; 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 S229577AbjAaLbH (ORCPT + 99 others); Tue, 31 Jan 2023 06:31:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230271AbjAaLbA (ORCPT ); Tue, 31 Jan 2023 06:31:00 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31B8E4B75E; Tue, 31 Jan 2023 03:30:37 -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 2AEC041A36; Tue, 31 Jan 2023 11:30:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675164635; bh=6GZ4mKZkjFIU+yqkIA0+j7Uf9FvVbijCOYNvLpC5vPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=PKUYUaJMZPNu8OPNu5xkBxkzbYVmhX7iG3YdAIYsrL/bmRREWAh2ax1Op8fSgtsu3 dj4Dse601A9xIovys2IYB+q2taMX5MFq8ePGB9FrFW7RLUs77rKux5zF8ZNevPF2h/ 8rXR+rPJKmC1rzosJDMzbwo6Glq7IYIYB3n1lFwF1IehwkFxAY0TiuDIqiCaDFZzTU Vk0CGShnUXgbtzEAMnZbkApeQx2ZhNvPE8FLxf0K88xQxieT0k5bcjnNnNISFaIoe7 0kS6yPm3UmfWGk4eAi2JmtsVQPtDXHP20HGb4Hy8JlqRtrQNkWCYfQemmRR1Xse30w BJBzk/QVRJ+zw== 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 , 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 , Arend van Spriel Subject: [PATCH v2 4/5] brcmfmac: pcie: Add IDs/properties for BCM4377 Date: Tue, 31 Jan 2023 20:28:39 +0900 Message-Id: <20230131112840.14017-5-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230131112840.14017-1-marcan@marcan.st> References: <20230131112840.14017-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?1756537894451714615?= X-GMAIL-MSGID: =?utf-8?q?1756537894451714615?= This chip is present on at least these Apple T2 Macs: * tahiti: MacBook Pro 13" (2020, 2 TB3) * formosa: MacBook Pro 13" (Touch/2019) * fiji: MacBook Air 13" (Scissor, 2020) Reviewed-by: Linus Walleij Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 1 + drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 5 +++++ .../net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c index 3e42c2bd0d9a..8073f31be27d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c @@ -733,6 +733,7 @@ static u32 brcmf_chip_tcm_rambase(struct brcmf_chip_priv *ci) case CY_CC_4373_CHIP_ID: return 0x160000; case CY_CC_43752_CHIP_ID: + case BRCM_CC_4377_CHIP_ID: return 0x170000; case BRCM_CC_4378_CHIP_ID: return 0x352000; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 2b7da248fd93..141c1872b6c1 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -63,6 +63,7 @@ BRCMF_FW_DEF(4365C, "brcmfmac4365c-pcie"); BRCMF_FW_DEF(4366B, "brcmfmac4366b-pcie"); BRCMF_FW_DEF(4366C, "brcmfmac4366c-pcie"); BRCMF_FW_DEF(4371, "brcmfmac4371-pcie"); +BRCMF_FW_CLM_DEF(4377B3, "brcmfmac4377b3-pcie"); BRCMF_FW_CLM_DEF(4378B1, "brcmfmac4378b1-pcie"); /* firmware config files */ @@ -95,6 +96,7 @@ 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_4377_CHIP_ID, 0xFFFFFFFF, 4377B3), /* revision ID 4 */ BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* revision ID 3 */ }; @@ -2001,6 +2003,7 @@ static int brcmf_pcie_read_otp(struct brcmf_pciedev_info *devinfo) base = 0x8c0; words = 0xb2; break; + case BRCM_CC_4377_CHIP_ID: case BRCM_CC_4378_CHIP_ID: coreid = BCMA_CORE_GCI; base = 0x1120; @@ -2615,7 +2618,9 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43596_DEVICE_ID, CYW), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4377_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC), + { /* end: all zeroes */ } }; 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 f73ca914256f..842e3d44fa49 100644 --- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h @@ -52,6 +52,7 @@ #define BRCM_CC_43664_CHIP_ID 43664 #define BRCM_CC_43666_CHIP_ID 43666 #define BRCM_CC_4371_CHIP_ID 0x4371 +#define BRCM_CC_4377_CHIP_ID 0x4377 #define BRCM_CC_4378_CHIP_ID 0x4378 #define CY_CC_4373_CHIP_ID 0x4373 #define CY_CC_43012_CHIP_ID 43012 @@ -89,6 +90,7 @@ #define BRCM_PCIE_4366_5G_DEVICE_ID 0x43c5 #define BRCM_PCIE_4371_DEVICE_ID 0x440d #define BRCM_PCIE_43596_DEVICE_ID 0x4415 +#define BRCM_PCIE_4377_DEVICE_ID 0x4488 #define BRCM_PCIE_4378_DEVICE_ID 0x4425 /* brcmsmac IDs */ From patchwork Tue Jan 31 11:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 50783 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2699200wrn; Tue, 31 Jan 2023 03:38:21 -0800 (PST) X-Google-Smtp-Source: AK7set/xWV9Qe/H2HsWBckSM/DT4dg6lJibL+jS3gaXB9WZ1BgfcVqJziluOryuIT1B8MgOpSJNW X-Received: by 2002:a17:906:30c4:b0:885:fee4:69ee with SMTP id b4-20020a17090630c400b00885fee469eemr8509143ejb.59.1675165101572; Tue, 31 Jan 2023 03:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675165101; cv=none; d=google.com; s=arc-20160816; b=HVniQJYJzNIVgHw45MS4A0BH5q17D8I2zVunpoF53IAnTH8/rAe7HHg5M68wkVydvC PcaaLznOPt94Dsvckx4QbuxDa+dJenm5MUjenoi0sSawE8rfajpLD5kA7YFSUEhn2dsL okwv6uRXbJFvUuLuIMIBqpaz3G2ukrOozDMmd1VukYgSmoAccNtyTtU+gHHI7NC2T1mE RYF22jalWSuueopxaQGyWvr6/7wwRjJC66ekc2qHTG0786GecGa/0q8t2eUUu1rgBM5Q Qs5D74zrbZi23fW6KuYj1t0zPRByp4qpkve3NqZEvydm/ZaT9RWdmjPmdG6dFGQPEKJs caCQ== 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=WWiUL9/+z/ncuiU0b/7DYl+T7iuW32azsmBNJjBfdBI=; b=aX5HIxjopXf+2mjlbnBaCw/HQ3HxW+lbx89AvGwMWslhLZqEulKo0pkm9qWZ8CDtjN LAVFKQDyuaIBgpgpjA0J2a98oo9DENM7aSc/n2WE83PXa75E7N+D3mWqRvu+3MoWmguI XFpqYtuVlV4CsFk+0HQLXPU4XaffLIt/iM/nymUEZJo7RpuWwjeK5pGp6Vt9dt1aDhXp hBl8N2ZLayJRRXLgheLGrSG4yGGbkNEdj57IM4jYHXN8Nd+PDj+lMJVe492tauK0g5/d rBLTc1qCJJtF/hh2io+G8tQk79JgcP0RfwfSPO38Dx21peEw1QJkMMJ2WlFG4AeWpZ0h Y4ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=T+ERqkns; 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 cz16-20020a0564021cb000b004a230263841si9288927edb.302.2023.01.31.03.37.58; Tue, 31 Jan 2023 03:38:21 -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=T+ERqkns; 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 S229868AbjAaLb0 (ORCPT + 99 others); Tue, 31 Jan 2023 06:31:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbjAaLbZ (ORCPT ); Tue, 31 Jan 2023 06:31:25 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5CD4CE59; Tue, 31 Jan 2023 03:30:51 -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 39773423CD; Tue, 31 Jan 2023 11:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1675164642; bh=nNpdW5NxPShkg4vXiVxBBcvWqNE3yqDDsSvbLwO/4jY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T+ERqknsnKHZYodgZZNx16U1Dk0HZPSjVwprWv/rCWu2e90prVZMHnLBCEG84Dqxb UIncSKnJibUump3mhUwXyT0yZsdpPSSJwQCjBT/5i2dbcVJ1EOm3IgjPi6NElPmLBh 8y5LYywitFX1jSTgZMx2Gl/B8r2OJKnUyefGh+R1JtMce9/X+6IX2+VJXvkBLSTEP4 inhphsUCJXSLTL+rU0NeWicNM9wNDaKuuuUurUeKzK1tHKWwZvdq7vQ0PjJY9pu/Wv bsxnP398dq/HZ+RFgrth1jAx3gyjDGVsASLNUwzcHWaEtXDvpyWPeRkBB9zPBtr45a lZ3MsdEvJaMZw== 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 , 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 , Arend van Spriel Subject: [PATCH v2 5/5] brcmfmac: pcie: Perform correct BCM4364 firmware selection Date: Tue, 31 Jan 2023 20:28:40 +0900 Message-Id: <20230131112840.14017-6-marcan@marcan.st> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230131112840.14017-1-marcan@marcan.st> References: <20230131112840.14017-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?1756537921328675274?= X-GMAIL-MSGID: =?utf-8?q?1756537921328675274?= 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) v2: Also fix the firmware interface for 4364, from BCA to WCC. Fixes: 24f0bd136264 ("brcmfmac: add the BRCM 4364 found in MacBook Pro 15,2") Reviewed-by: Linus Walleij Reviewed-by: Arend van Spriel Signed-off-by: Hector Martin --- .../net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index 141c1872b6c1..5ff2d7689af3 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; @@ -2608,7 +2615,7 @@ static const struct pci_device_id brcmf_pcie_devid_table[] = { BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID, WCC), - BRCMF_PCIE_DEVICE(BRCM_PCIE_4364_DEVICE_ID, BCA), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4364_DEVICE_ID, WCC), BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID, BCA), BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_5G_DEVICE_ID, BCA),