Message ID | ACC0D1F6-7857-4FF0-A474-4EC699572E1B@live.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4187428wrt; Mon, 2 Jan 2023 06:44:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXsA0RkpwMQJFDNZOMLJjs+8k4c3pjsEFeveWtDUDCnxNX+G2Qrn/5rQUVjawaCDGQJcLHHd X-Received: by 2002:a05:6a21:164a:b0:b2:44dc:407d with SMTP id no10-20020a056a21164a00b000b244dc407dmr12028037pzb.4.1672670674359; Mon, 02 Jan 2023 06:44:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672670674; cv=pass; d=google.com; s=arc-20160816; b=UQAH4o14wjMAf4kyljhTGzVn09B6ToyLZbOLWrPD/Luyy84FBR3jNlzrxyxKETs5ra 4FuZRgYhkBtDY0wno/sO2ObSZ3iJi/6flgx++CuW1Ab/5izsgXCs2s78E6IQkqslMgft 6gItpFDENjzLHgqwZsopdUwbrcAlExvJSFMK9UVf0hKKgSD5ufzJiDDav0x0qv46CKZw AaE9arSiwQUWZYbtUAHyPtGAnc8v5v5BfTgNtPdJx3gWobPah3Qs4jEdx+9qsHZFMStC 3c+ykyQc6hjnN9narjmqLVeMQjeATKSNKohPFlFJ62nt32GGmZQ7rzM/DpZYGI+Y1oEQ AkqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=QQUbrmMNNYrvHRXeGi9a9FXrDhRZ4NV7kKsuKyXQTAQ=; b=PlNadQscMEAJVZZUUOXC7unqm+a8Pn2fT8MBKHf6HdwT9WbRuCLOvf9veyT5Xg3hSJ x6GP4cZOlWDS7SLqhJ4gQh72MKu7zf3O8W4038YgWV/qfUSJBJq6ciDrBYV2MJQwkfEu daD0vWYSMfkPFqEPIRXbqjqSpmX5zv+YpM2CgnDrd3ZbEINyCp3hyfGErln4VT6iZb4I BSI21IeFm8jsF4PnIX5nVPNYbugT8p78e/VytZEwtM/mI0DGAvH7ksYBXPbbwwr7Mb4J j7ofi7IZID6z/GkgbYJqX8pwxBE7M2iTDogFM8JFMQB7/dEg8KmDvZ25mjc1TfEROkFd Gpkg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@live.com header.s=selector1 header.b=sGVFXaMQ; arc=pass (i=1); 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=NONE sp=QUARANTINE dis=NONE) header.from=live.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b00478d123065bsi31083298pgk.402.2023.01.02.06.44.21; Mon, 02 Jan 2023 06:44:34 -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=@live.com header.s=selector1 header.b=sGVFXaMQ; arc=pass (i=1); 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=NONE sp=QUARANTINE dis=NONE) header.from=live.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232479AbjABOkO (ORCPT <rfc822;yugsuo@gmail.com> + 99 others); Mon, 2 Jan 2023 09:40:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjABOkM (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Jan 2023 09:40:12 -0500 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2068.outbound.protection.outlook.com [40.92.103.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AA9D300; Mon, 2 Jan 2023 06:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nffK1i+fHIvyLsJuQYpcuB+AyUK7cwaxAlbbkI1B0UuSdjf3LqynRIuOVUXECmdSL0JjYZot9kD2bNUmmUI7HzB4QATNVTattRKRuzR3c37+jAFIKtYP/TLTCLFNr/vSNj6/oktPmSQQApD/fRYvXN3PRNebmIOlyGb4xQYtJUsAVeia7Owk0mdtPBZauW/JVI//j0Ojn0zchXzY5B5JgssDIAtjzp+DvnLVGs/9+tjB+4W5ehsrUOiKjjjQ1hGrXJQryOE3lxBMAYBB3RSFHshdqHIWTma5wO7oOVbdW/oHbnH58VRTpXkWQhLHj3graBQLmrciyajWuHAClWW1IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QQUbrmMNNYrvHRXeGi9a9FXrDhRZ4NV7kKsuKyXQTAQ=; b=HkiWp1Ju7AER7fBtE7UozeObxCLEsCpmtOAug8GdNQW6UhGhnicE5jxrcsswqEEZ7ITM0WluHFqeygJ/zN13uyMyI2SPBrx/vffT0L4CqwjO7IAHvikkrOh2S09y+OCRYkssLzwjMBXis+lYxVx1t5kgr6ioXaHQN0H73jKT+XrvMPFvK6JvITgsNbl6K3yFz7rbNoRLErfQHXnCUcD7tPt+1sKa9XyxT/5X3wG0VGVs6HftaXeb6S+YH7EaYbwQYJP7rGGv+ygmSbwUiVHt32qMT7DmC2hDSRv+FBYLTdiWqS5svNYFwxoOuXPGl16d+kvMJg8z0np0Q3luVkFyBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QQUbrmMNNYrvHRXeGi9a9FXrDhRZ4NV7kKsuKyXQTAQ=; b=sGVFXaMQ+GC91FEuxLp2+toI2fopZhNBmWGbxEPFdSmF+rr0++hOaYAxF/PBBYSEMb5I2mDLZhJvzQFGAkQMJ7rtn6wuYuCJVV4Z6WkMedAqgOdpq3NobdEWSrJYuRzahT1WyvQg8WNklfOqbfkR4Zh5AEorli40E5zi01b79sSLqKX+37Pi1VQGbmguBM2qR5TST88+6XMyr8bzrV/fRatCiAv5iq0mzZ+JDehXTvJhTeiRmwKBXrSL8R7t2C/SgNMpCBv1x4sL9S65UiINEFwuB32pUIGs5Uu2Cc20zvILTPZJ2l2myPtEDzGQOQb6kD3Bb4ERZghIfmEHWeGQog== Received: from BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2::9) by PN2PR01MB9277.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:117::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Mon, 2 Jan 2023 14:40:03 +0000 Received: from BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM ([fe80::f90e:46bc:7a0f:23bc]) by BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM ([fe80::f90e:46bc:7a0f:23bc%7]) with mapi id 15.20.5944.019; Mon, 2 Jan 2023 14:40:03 +0000 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 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Thread-Topic: [PATCH 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Thread-Index: AQHZHrgZDnaanKJG6k6Y1zElujNaAQ== Date: Mon, 2 Jan 2023 14:40:02 +0000 Message-ID: <ACC0D1F6-7857-4FF0-A474-4EC699572E1B@live.com> References: <F8829A7C-909E-4A1F-A22C-668220C5C06D@live.com> <f36dd8e3-9905-f04a-ed34-4be91ed1fec6@marcan.st> <F9EFCCD1-4407-42CC-8316-2F58AAC1AE7F@live.com> In-Reply-To: <F9EFCCD1-4407-42CC-8316-2F58AAC1AE7F@live.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [/xxa1By3errEM3v4mna0krMW7j3tH3EX/bIjP5/cXzFzt4cAe5imbucn5S+tO96O] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BM1PR01MB0931:EE_|PN2PR01MB9277:EE_ x-ms-office365-filtering-correlation-id: a39661f7-856f-434f-0470-08daeccf3bb7 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: r+pUXhuBEfdRc4r0zzY4dwxTPwDXCIkULou9NNxz62gr852viBV0pTLZfj6/1YZ+9VayoWYDew5zS9BfQUxP8w7+cquRJUgRXLeaLS5jP1eHECUkULAINHhBkwaOXBaL4mzdON/SPaT5WU2H1IwNaWql0+BR/UfrvgVdAMGfxQk3iTbxKhPpdYSvedqUNgyjxk5lDG9iKRgw9xEAGk8lu9IaHSt6gBO+Gv5dRJh3Crxe8opJfT3kuF8eFOxSybDwbEOZ6f5HA5qXxaPztneUQIpxK/uF4zdQ/tuP7THTS8UKYiKtP/sL1FCIbnlNgaMXPYvS3NSOcVhpWjQ5eYnC8nPLMN94Z8EkEVvY8C4vxhpLM6AgJfKC2WrS1UHOqcSy6OmHmPt0owBJeLp6UTRpU4A3Qz/R0INdJDrj2WhteWaEGvqvWZkHKOfOqwQwM4YZY3m1lPPYG76ICgicJWzBYjZHmjHhoafmp8ZTYgWqTEE/PbnRY2oAZ8FCKZ7WKUa9pow+13FVxjps2G4ZOyurEAsFuBvbo0Eq3qybSiptOScpSUB7Ks+mS2VkPE9EPBUOvmSFtK9z+ikrCvRNyPWe7vDJfvL3Nd+W4+N2A/O7wu0= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: Vh/Pp3B2gGcTEw+fpN8IqyzIkwtt9Lk2sdGPEWAI3jU9xxYykeA6UPsEUE6jUrb+hNt1Tx9R2wkqk7bLGDIb+/nSyL45sxOBbiuH6s/lAgKg2x1egI2t1Ik7cEB1YRLLrRjiI2PsN4rpLkCtQ1piycYlX/L0WOYPXYvheuClUc5JTa/F8GUqYca5CW4oEvIPlJW84n+3KoecglHvI1h3E+yIm647m60dOYZj65TIQ6sLOj51PpiVarM0zG+z1KPxJqaPZwiwucmcNfLx83j6flHpxsrwJX3TwNJZduI4qQQx3pSAsoZOolG9QexwikRoYp99PeX59As29lGfGOb5EGfx+rimFA0HOCFzfWwbH24CgAHsdusaRB9gYphZYWDI6fJFJ5//YbAGjf9lJ2ntYNj5U8qVmCtmJpXoDZVOUWTfkXh9310rpt8huVkeENRVlDpwO3TGhnSQVGYhhm9iqCNz2pl035aAM8WIy8Ntky+NVasKyYFQwOhyd1sXcg3/9m+M3YfQjfHJrpAW74KvuDQHydi8Pb2VbRrPIKY1yK6FU6Lk2fUBK1lYf9Aa0PHRCPy4FK/CKsFI1RLNNDEdkKGtY24geLVunuFv2SDQwfo0ESBQ6QChfq3Do6KKX/MPFyqPwvAtFcOJi812aNeYBkTWNFKG3S+o788Xlai3ToWd0wuY1nGDbRpyYsz7WLp1BN7/Y0HqWpCtMzkd7Zeqr3Geio8tct0mEJ1diiMIWNPXnUSTxZ+ftHHT3wNlh4RRBpxCIfkPBhtttuOQ6c8XRIi/gHf3FvxXV8nHD1PJHSQT7sNDgms1F49MK5BjASZeiUFC5zXXTkHXSu2rqZJ9c7dO90IlyMDUt0euDHfhlEvRoLkuTC+aPMMUTnukZVahyLXwxJOXcMvWlgtYFHfkmpUISS+Hv1t2i/IYQ++hmxbFA3zAB5mJ+scaK8f1MXAeZJOzbZf1//1GTn80zztY4fWIy6NdP1owXo2m+tQtwiSm3xQcwQe4XNQS7ApFgn3VGD41bNdw+P5yDe0imFKR/uy3L1UwgyWsWJsQvLZQYox73C8qNv42p4iHh8qHLn2n8G/io+bLmxtiT6il0lNZLxkfhTBBjNY5yzaeB/W7CY9J0sG4dfD+d1oN47cO7kJsdDV4avbSqKvLcE5cBhVgbdz+GwfHUWl2SL1c/LLH+zQxZ8eF0px0ElPXpr22ypcehZ5lTazV5ghQjyAgg/bJy50Vqt/+1HG1tL3E0Q4heVe2J0LZ8kbrUhb7K0EM9KGrh3OJjxUtjxS3w7ydpjtPERL8ADCROISoWxUwcobTu3Sk87R7SONRJ9NIVMpTtyZzVv00k7cIcRj1mpDea9tOxQ== Content-Type: text/plain; charset="us-ascii" Content-ID: <479D565AC9470C46B41E26623076DDA2@INDPRD01.PROD.OUTLOOK.COM> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-42ed3.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BM1PR01MB0931.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a39661f7-856f-434f-0470-08daeccf3bb7 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2023 14:40:03.0113 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN2PR01MB9277 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753922324856020691?= X-GMAIL-MSGID: =?utf-8?q?1753922324856020691?= |
Series |
[1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips
|
|
Commit Message
Aditya Garg
Jan. 2, 2023, 2:40 p.m. UTC
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(-)
Comments
On 02/01/2023 23.40, Aditya Garg wrote: > 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. > I think my reply to Arend flew over your head. My point was that I'd rather have the Broadcom/Cypress people actually answer my question so we can figure out how to do this *properly*, instead of doing "safer-but-dumb" things (like this patch) because we just don't have the information to do it properly. - Hector
> I think my reply to Arend flew over your head. Sorry. I am not that good in English so sometimes do misinterpret things. > > My point was that I'd rather have the Broadcom/Cypress people actually > answer my question so we can figure out how to do this *properly*, > instead of doing "safer-but-dumb" things (like this patch) because we > just don't have the information to do it properly. > > - Hector
On January 2, 2023 4:15:41 PM Hector Martin <marcan@marcan.st> wrote: > On 02/01/2023 23.40, Aditya Garg wrote: >> 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. > > I think my reply to Arend flew over your head. > > My point was that I'd rather have the Broadcom/Cypress people actually > answer my question so we can figure out how to do this *properly*, > instead of doing "safer-but-dumb" things (like this patch) because we > just don't have the information to do it properly. Fair enough. Can you accurately (re)state your question and I will try to answer it. Regards, Arend > - Hector
On 2023/01/03 3:27, Arend Van Spriel wrote: > On January 2, 2023 4:15:41 PM Hector Martin <marcan@marcan.st> wrote: > >> On 02/01/2023 23.40, Aditya Garg wrote: >>> 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. >> >> I think my reply to Arend flew over your head. >> >> My point was that I'd rather have the Broadcom/Cypress people actually >> answer my question so we can figure out how to do this *properly*, >> instead of doing "safer-but-dumb" things (like this patch) because we >> just don't have the information to do it properly. > > Fair enough. Can you accurately (re)state your question and I will try to > answer it. As per my original email: Is the CYW89459 just a rebrand of the BCM4355, or just a subset? Can we consider them equivalent, and equivalent to the Apple part (BCM4355C1 / revision 12)? More specifically: - What BCM4355 variants exist in the wild, and what are their PCI device IDs and revision IDs? - Is a single firmware nominally intended to be compatible with all of those variants? Does that include the CYW89459 branded parts? - If CYW89459 is a rebrand of BCM4355, is it complete, or are there still chips being sold as BCM4355? Even more specifically, bcmdhd has these device IDs: #define BCM4355_D11AC_ID 0x43dc /* 4355 802.11ac dualband device */ #define BCM4355_D11AC2G_ID 0x43fc /* 4355 802.11ac 2.4G device */ #define BCM4355_D11AC5G_ID 0x43fd /* 4355 802.11ac 5G device */ But the patch I'm replying to uses PCI ID 0x4355, which instead should be: #define BCM43237_D11N_ID 0x4355 /* 43237 802.11n dualband device */ #define BCM43237_D11N5G_ID 0x4356 /* 43237 802.11n 5GHz device */ So what's up with the BCM43237? Is that a 4355 variant? Is this what got rebranded as CYW89459? Is it firmware-compatible with the others? <rant> I'm going to be honest here: I'm quite saddened by the state of brcmfmac and Broadcom's neglect of this driver. Other than the Apple OTP / firmware selection shenanigans, everything else I'm having to implement to support Apple machines are features that Broadcom's downstream bcmdhd driver *already* supports on non-Apple machines, not Apple-specific. Not only that, people are asking for modern WiFi features like newer crypto modes that bcmdhd supports but brcmfmac doesn't. It seems clear that Broadcom isn't interested in maintaining this driver and updating it to support newer chips and features. So I'm basically doing your job for you all. Which is fine, but if I'm going to be in charge of implementing all this stuff for you, *please* help me by at least clarifying the device variant / firmware feature related issues, because getting that wrong will cause regressions or firmware naming scheme breaks down the line, and that sucks for users. </rant> - Hector
On 1/3/2023 4:55 AM, Hector Martin wrote: > On 2023/01/03 3:27, Arend Van Spriel wrote: >> On January 2, 2023 4:15:41 PM Hector Martin <marcan@marcan.st> wrote: >> >>> On 02/01/2023 23.40, Aditya Garg wrote: >>>> 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. >>> >>> I think my reply to Arend flew over your head. >>> >>> My point was that I'd rather have the Broadcom/Cypress people actually >>> answer my question so we can figure out how to do this *properly*, >>> instead of doing "safer-but-dumb" things (like this patch) because we >>> just don't have the information to do it properly. >> >> Fair enough. Can you accurately (re)state your question and I will try to >> answer it. > > As per my original email: Is the CYW89459 just a rebrand of the BCM4355, > or just a subset? Can we consider them equivalent, and equivalent to the > Apple part (BCM4355C1 / revision 12)? There is probably no easy answer. Mainly because Cypress is a separate entity. However, they use the same/similar technology and code base. So let me first start with the chip naming. The wifi chip primarily has a number and revision. The chip number is straighforward and can be read from the device. The chip revision comes in two variants: 1) simple increasing number as read from the device, and 2) a <letter><digit> format. The latter start at a0, which you almost never see in the wild unless we do it "first time right". Whenever spinning a new chip we either increase the digit or the letter depending on type/amount of changes. There is not predictable mapping between the revision variants. Depending on the hurdles in a chip project we may move from a0 to b0, or from b0 to b1 or whatever. If CYW89459 chip reads chip number 0x4355 than it is a BCM4355. If it is a different revision it may require different firmware. A different letter will always require different firmware. A different digit may work although the firmware can have code paths for a specific revision. The firmware tables in pcie.c have the revmask. With our crystal ball being out-of-order we tend to enable a firmware for all revisions (0xFFFFFFFF) unless proven otherwise. If otherwise, we come up with a sensible new name and add a new entry to the firmware table changing the revmasks accordingly. > More specifically: > - What BCM4355 variants exist in the wild, and what are their PCI device > IDs and revision IDs? Who knows. The PCI revision ID always equals the chip revision afaik. The PCI device IDs should be as below. > - Is a single firmware nominally intended to be compatible with all of > those variants? Does that include the CYW89459 branded parts? > - If CYW89459 is a rebrand of BCM4355, is it complete, or are there > still chips being sold as BCM4355? > > Even more specifically, bcmdhd has these device IDs: > > #define BCM4355_D11AC_ID 0x43dc /* 4355 802.11ac dualband device */ > #define BCM4355_D11AC2G_ID 0x43fc /* 4355 802.11ac 2.4G device */ > #define BCM4355_D11AC5G_ID 0x43fd /* 4355 802.11ac 5G device */ > > But the patch I'm replying to uses PCI ID 0x4355, which instead should be: > > #define BCM43237_D11N_ID 0x4355 /* 43237 802.11n dualband device */ > #define BCM43237_D11N5G_ID 0x4356 /* 43237 802.11n 5GHz device */ > > So what's up with the BCM43237? Is that a 4355 variant? Is this what got > rebranded as CYW89459? Is it firmware-compatible with the others? Right. If you have come across a BCM4355 with PCI device ID 0x4355 than my best guess would be that their OTP is corrupted and the PCIe core on the chip uses its default as stored in hardware, which equals the chip number. This is really a fallback for a faulty device (or a device which does not have its OTP programmed). > <rant> > > I'm going to be honest here: I'm quite saddened by the state of brcmfmac > and Broadcom's neglect of this driver. Other than the Apple OTP / > firmware selection shenanigans, everything else I'm having to implement > to support Apple machines are features that Broadcom's downstream bcmdhd > driver *already* supports on non-Apple machines, not Apple-specific. Not > only that, people are asking for modern WiFi features like newer crypto > modes that bcmdhd supports but brcmfmac doesn't. It seems clear that > Broadcom isn't interested in maintaining this driver and updating it to > support newer chips and features. So I'm basically doing your job for > you all. Which is fine, but if I'm going to be in charge of implementing > all this stuff for you, *please* help me by at least clarifying the > device variant / firmware feature related issues, because getting that > wrong will cause regressions or firmware naming scheme breaks down the > line, and that sucks for users. > > </rant> Happy New year to you. Thanks for clearly marking the rant. Makes it easier to ignore, but let me get into this. I would not call bcmdhd the downstream driver. It is a separate out-of-tree driver. Indeed resources were pulled from brcm80211 development, but there always have been only 2 or 3 people working on it. Me being the constant working mule and these days only for 20% of my working hours to do the job. So you are not really doing our job as we are not assigned to do so. I guess there is no ROI for Broadcom or so it is perceived and there is no customer pushing for it. That said I am always happy to help and clarify whatever I can. Regards, Arend
On 03/01/2023 22.30, Arend van Spriel wrote: > On 1/3/2023 4:55 AM, Hector Martin wrote: >> On 2023/01/03 3:27, Arend Van Spriel wrote: >>> On January 2, 2023 4:15:41 PM Hector Martin <marcan@marcan.st> wrote: >>> >>>> On 02/01/2023 23.40, Aditya Garg wrote: >>>>> 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. >>>> >>>> I think my reply to Arend flew over your head. >>>> >>>> My point was that I'd rather have the Broadcom/Cypress people actually >>>> answer my question so we can figure out how to do this *properly*, >>>> instead of doing "safer-but-dumb" things (like this patch) because we >>>> just don't have the information to do it properly. >>> >>> Fair enough. Can you accurately (re)state your question and I will try to >>> answer it. >> >> As per my original email: Is the CYW89459 just a rebrand of the BCM4355, >> or just a subset? Can we consider them equivalent, and equivalent to the >> Apple part (BCM4355C1 / revision 12)? > > There is probably no easy answer. Mainly because Cypress is a separate > entity. However, they use the same/similar technology and code base. So > let me first start with the chip naming. The wifi chip primarily has a > number and revision. The chip number is straighforward and can be read > from the device. The chip revision comes in two variants: 1) simple > increasing number as read from the device, and 2) a <letter><digit> > format. The latter start at a0, which you almost never see in the wild > unless we do it "first time right". Whenever spinning a new chip we > either increase the digit or the letter depending on type/amount of > changes. There is not predictable mapping between the revision variants. > Depending on the hurdles in a chip project we may move from a0 to b0, or > from b0 to b1 or whatever. Right, this is standard chip spin numbering, that much I know. > If CYW89459 chip reads chip number 0x4355 than it is a BCM4355. If it is > a different revision it may require different firmware. A different > letter will always require different firmware. A different digit may > work although the firmware can have code paths for a specific revision. So is it always correct to have the same firmware (in a generic situation, not a customized OEM build) for, say, a BCM4355 rev 12, regardless of what the PCI ID programmed into the OTP is (and what the marketing device name is)? If so, then my conclusion is that the original patch I replied to is incorrect, all the defines should've been called BCM4355 (not the Cypress part number), and we probably need two firmware table entries since (judging by the revision check elsewhere in that patch) there are other revisions in the wild than the one Apple uses, and therefore there should at the very least be a firmware name split at C1. It would then be very helpful to know what revisions *do* exist and their correct naming. If different PCI device IDs might need different firmware, then the exiting firmware selection/table mechanism is insufficient. > Happy New year to you. Thanks for clearly marking the rant. Makes it > easier to ignore, but let me get into this. I would not call bcmdhd the > downstream driver. It is a separate out-of-tree driver. Indeed resources > were pulled from brcm80211 development, but there always have been only > 2 or 3 people working on it. Me being the constant working mule and > these days only for 20% of my working hours to do the job. So you are > not really doing our job as we are not assigned to do so. I guess there > is no ROI for Broadcom or so it is perceived and there is no customer > pushing for it. That said I am always happy to help and clarify whatever > I can. Is there any chance you can provide a list of chips/shipping revisions and revision IDs, so we can stop guessing at the mappings in the firmware table? Because this is effectively breaking userspace ABI every time we make a change to an existing chip, as it can change the firmware file name that userspace loads. This already happened with BCM4364, where (at least) B2 and B3 revisions exist in the wild and we need separate firmwares, yet it was added with a full mask, resulting in people copying "the right firmware for them" manually and my patch to split it into properly named firmwares will break those users. - Hector
> On Jan 3, 2023, at 8:30 AM, Arend van Spriel <arend.vanspriel@broadcom.com> wrote: > > On 1/3/2023 4:55 AM, Hector Martin wrote: >> More specifically: >> - What BCM4355 variants exist in the wild, and what are their PCI device >> IDs and revision IDs? > > Who knows. The PCI revision ID always equals the chip revision afaik. The PCI device IDs should be as below. If the day ever came where the FCC inquired about a theoretical spurious radio emissions issue in such a chipset, and asked Broadcom for a list of all affected hardware releases, would the FCC also be told “who knows”? I guess the difference is that the FCC has the statutory authority to yank Broadcom’s certifications to sell their product, whereas Hector is merely improving your driver support for no monetary compensation from you. Maybe the Broadcom drivers should be yanked from Linux if this is what passes for Broadcom release engineering. zzy
On 1/3/2023 2:46 PM, Hector Martin wrote: > On 03/01/2023 22.30, Arend van Spriel wrote: >> On 1/3/2023 4:55 AM, Hector Martin wrote: >>> On 2023/01/03 3:27, Arend Van Spriel wrote: >>>> On January 2, 2023 4:15:41 PM Hector Martin <marcan@marcan.st> wrote: >>>> >>>>> On 02/01/2023 23.40, Aditya Garg wrote: >>>>>> 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. >>>>> >>>>> I think my reply to Arend flew over your head. >>>>> >>>>> My point was that I'd rather have the Broadcom/Cypress people actually >>>>> answer my question so we can figure out how to do this *properly*, >>>>> instead of doing "safer-but-dumb" things (like this patch) because we >>>>> just don't have the information to do it properly. >>>> >>>> Fair enough. Can you accurately (re)state your question and I will try to >>>> answer it. >>> >>> As per my original email: Is the CYW89459 just a rebrand of the BCM4355, >>> or just a subset? Can we consider them equivalent, and equivalent to the >>> Apple part (BCM4355C1 / revision 12)? >> >> There is probably no easy answer. Mainly because Cypress is a separate >> entity. However, they use the same/similar technology and code base. So >> let me first start with the chip naming. The wifi chip primarily has a >> number and revision. The chip number is straighforward and can be read >> from the device. The chip revision comes in two variants: 1) simple >> increasing number as read from the device, and 2) a <letter><digit> >> format. The latter start at a0, which you almost never see in the wild >> unless we do it "first time right". Whenever spinning a new chip we >> either increase the digit or the letter depending on type/amount of >> changes. There is not predictable mapping between the revision variants. >> Depending on the hurdles in a chip project we may move from a0 to b0, or >> from b0 to b1 or whatever. > > Right, this is standard chip spin numbering, that much I know. > >> If CYW89459 chip reads chip number 0x4355 than it is a BCM4355. If it is >> a different revision it may require different firmware. A different >> letter will always require different firmware. A different digit may >> work although the firmware can have code paths for a specific revision. > > So is it always correct to have the same firmware (in a generic > situation, not a customized OEM build) for, say, a BCM4355 rev 12, > regardless of what the PCI ID programmed into the OTP is (and what the > marketing device name is)? Yes. > If so, then my conclusion is that the original patch I replied to is > incorrect, all the defines should've been called BCM4355 (not the > Cypress part number), and we probably need two firmware table entries > since (judging by the revision check elsewhere in that patch) there are > other revisions in the wild than the one Apple uses, and therefore there > should at the very least be a firmware name split at C1. It would then > be very helpful to know what revisions *do* exist and their correct naming. I can only track down what we have in Broadcom. For the 4355 the revisions B1 (=6), B3 (=8), C0 (=10) and C1 are mentioned as released. Here things get weird, because you mentioned BCM4355 rev12, which would be a C2. So without asking around I can only assume this C2 variant is not different from firmware perspective and can happily run the C1 firmware. > If different PCI device IDs might need different firmware, then the > exiting firmware selection/table mechanism is insufficient. > >> Happy New year to you. Thanks for clearly marking the rant. Makes it >> easier to ignore, but let me get into this. I would not call bcmdhd the >> downstream driver. It is a separate out-of-tree driver. Indeed resources >> were pulled from brcm80211 development, but there always have been only >> 2 or 3 people working on it. Me being the constant working mule and >> these days only for 20% of my working hours to do the job. So you are >> not really doing our job as we are not assigned to do so. I guess there >> is no ROI for Broadcom or so it is perceived and there is no customer >> pushing for it. That said I am always happy to help and clarify whatever >> I can. > > Is there any chance you can provide a list of chips/shipping revisions > and revision IDs, so we can stop guessing at the mappings in the > firmware table? Because this is effectively breaking userspace ABI every > time we make a change to an existing chip, as it can change the firmware > file name that userspace loads. This already happened with BCM4364, > where (at least) B2 and B3 revisions exist in the wild and we need > separate firmwares, yet it was added with a full mask, resulting in > people copying "the right firmware for them" manually and my patch to > split it into properly named firmwares will break those users. Userspace is not loading anything these days. AFAIK the kernel is directly accessing the firmware file. Anyway, I never considered this as being a big issue. If people change their installed os to get things working, they can expect the reverse can happen anytime and deal with it once more. If this is considered a real issue we should only set the revmask for the revision we know to be working. Regards, Arend
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;