From patchwork Mon Jan 2 14:46:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 38132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4188371wrt; Mon, 2 Jan 2023 06:47:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWMIOuLmJF25VYzNuIwajegPfIQiFjiR8SfmYVMYdODS8Rl1lxt2x4lJNUTHahsfWTVNwW X-Received: by 2002:a05:6a21:1509:b0:ad:9aaf:f7ae with SMTP id nq9-20020a056a21150900b000ad9aaff7aemr13328805pzb.3.1672670837651; Mon, 02 Jan 2023 06:47:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672670837; cv=pass; d=google.com; s=arc-20160816; b=ci+5F4Yb5ROhjwvCUHKZ9bfeTxTk8SAZV7w8K/+EV/Z/RFU233HqiJYtLkZicD/AfM ov8+IvARd468PbmfljQZF4yZdR+AZnAujqF7MXYxHN4kAToGymGD2gcc4GTi5chUvNFy +ukGDBub7A9N/h1Rl6Fq61bgDXyaVoyvvG6vQzHh+mS1hxBJiJhefbRwu8j2gMzfeakE 4PmYO5W4hUy5/U6ppwzh1Th1B0wisfuxTVpcAN1D+0gVqJKlGpvwHuICxUi2Cep2Q8Le 3qrQ4/hzql9BLemCiqbQgtD07KZH+xUygMWDQ0qHUR4SUDJKtcJbhs3Z4rydJBrQie1b wJyw== 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=qZ37I/opmU3rDJERneRvzuQ17m+SZRsJlhshlvww2MkNSHA8tV8IefC+qUNmUIcD4h puriVfPD3ZNAECU/3ajNzAfb7NHHO7tyIATP8NPUuQKOVWbo6QINtnQnbNcQ//ByWI4Y Y/V4B9fguY1GpCPdOqYY9DmT7CgWxXx8aQEDDs674zb3EKPLw274XDGzjeHSbe/HlIF3 x4lypHQCpzZ1ejH++f9TdJFFmuU7mNDHkGi01uceRGNS1/qVDYglDIEmtMMPTCgisQv6 DtkTRDrten9LpT8tMl6ZI1ejKtl0N3VZ6W38Fe/z9fLXsQkvGvfrbm0uExI8PBz69h5M DZAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@live.com header.s=selector1 header.b=Pd7ODrvb; 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 l30-20020a63ba5e000000b0047c9e9084c8si156727pgu.855.2023.01.02.06.47.05; Mon, 02 Jan 2023 06:47:17 -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=Pd7ODrvb; 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 S236217AbjABOrD (ORCPT + 99 others); Mon, 2 Jan 2023 09:47:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236205AbjABOrA (ORCPT ); Mon, 2 Jan 2023 09:47:00 -0500 Received: from IND01-BMX-obe.outbound.protection.outlook.com (mail-bmxind01olkn2093.outbound.protection.outlook.com [40.92.103.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D93E565E8; Mon, 2 Jan 2023 06:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kcuc2TszlR+yah5cfqYg3cOQbMSmYp0vu4MtYcyizcBIWwO5Nyo7nnLj55s8CfiTDea6DWSUsD2pmoaLFBHmo2uniVLEX2o+IkXu6MtA53GFgRkjNwGU3bmuH5G2KHlCFna4qVBz6GDXYqj1Hc800kaREVh7rfJCCvE4Eu/ctHP6AP3ChTwBY4/rm3gViJJKOYhhY9AiFbnclOMIJSCFck3ZWZxCkocdG30dupZ6QPpt6514QMul+dDcqXc6Xum/wjWkq3cZc5k7rEmudjpU0ACxbZh5aFY+XTlWrNOlETGW+ogBknOJoZfXSfLfJbsb/z9WT5agFwPBk/9cmB24TA== 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=Lx1BD+hG+b5/zuOt/GnTBwIYRFH/fM7TeIeAHWzL0+FE6tFnsoCO8ddVPy651oO0Js9MeU9FJ4xwNKDxUKHRIKAHpDf5c4+KA/Kwac87mCx1lsvK0YH3C8fsO2SB8ySxZucvxXiFgh3vLhI3ens57xavdA8/H/wh7IxUtG7+Qmjs3y1CGL43cPRI6UpUCVvi9QglCi5tDlLpx8uGOUpdRel42nB1CX8jrM14XYkqtbDLiyBuI13TUZS5FR34AdaKq5RQ8kTGIOW6iTuO5r4yXh39/uefMjEFk2Ztu8NUnxPH9EeQxTR3lQdDRPPgY9UgCds8LLIU+Sui5BBZH5ckGg== 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=Pd7ODrvbzu0GRlOSQq5fnSsloDm4EunJcFfaFPyIpCGj8GRLk8m8mKfWRW0bPUnNzbQCEtjZHayLZ31HmSSwq9n2l+mra9tHuaQRiaqf4qLRDVGLXer+Hi9/jE0i63+sS7Iqd75rtKgSJNoADQlptzJ3ASD2VTOFmFzxuBDWB2j/pt1N8KJMUq2+414uuHDuexN18Hjms1G/gyeKLoW76K25jxTmjFLACg7oNMrF7onL2BQtf2ZlmAPWIuN6Udc/aB1VeBX6G4rto/7waYGKF29b9kAQFaTKvXKiV+qi3czR5n3xXxqQvHT9/5zT8bPGQEk2yhasYmCTpvwJzsRyRA== 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:46:51 +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:46:51 +0000 From: Aditya Garg To: Hector Martin , "aspriel@gmail.com" , "hante.meuleman@broadcom.com" , "kvalo@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "lina@asahilina.net" , "franky.lin@broadcom.com" , Arend van Spriel CC: Orlando Chamberlain , "brcm80211-dev-list@broadcom.com" , "brcm80211-dev-list.pdl@broadcom.com" , "linux-wireless@vger.kernel.org" , LKML , Asahi Linux Subject: [PATCH v2 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Thread-Topic: [PATCH v2 1/2] brcmfmac: Use separate struct to declare firmware names for Apple OTP chips Thread-Index: AQHZHrkMuK4g+OysPUWm6aVQADl1dg== Date: Mon, 2 Jan 2023 14:46:51 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [lE+doef27XN+R3eLz67aI62vxHZFpk3vwOnVbrHr9y1HW2VNOe0cXUIxLoCQmNwl] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BM1PR01MB0931:EE_|PN2PR01MB9277:EE_ x-ms-office365-filtering-correlation-id: fb39b637-d25a-428a-01ed-08daecd02f0f x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Oib+/PRz/NwHYRxnvymmuhQa2MWdX5195KEa32UcERqobRPvMmUoCthSJGQhrI9pV5CQH69HfDi12Cc1rjDAFIxbb53+ysETXFKvIl9IUrll1eMKvIYfsl2KOeWW1jvEo7O16AsAyn7xpzIAZ8MaDbjo2Of6zeH4Lz7VaFXixvo6xtXza6CsyCRb178kMx1ZoqQYpjNpPbrEP1lYqGYpK0OiDRu3wrdH663o8J9f04BiD0OAXf8ZSORzI/2oEDFStUReP33nKDLg7R6QjX0G0qBw6lz5/3r35lF8F+GoU6sBOErFZ/Fsv1fO4F5X9zxFNFqPFqP8fgUr1rPEOlgT3oOo1MwNKV6JSJh+NAbzD4Fxbc8odCe/lGPbXeRRgIKsjzUU/GvKKEA4RmoTLIB2YSlGktj3/6D885v4XpazxqlmQ49nd6H9mYesx+pQsku6Q2cWyvZ40Xw0snSONPZgsmaQ1pPPDGD1sf6GOZhqQltC0UL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0+bw6iEnDuGds4NHJuU2zVVfJeCY39H/AS3c9aWZDQRUBrivgLcyS6/jPbS344MyhcD9ry/ME8Jc6quzz8I26YDvWQNMmOVaioSg9QmNVQOc3FnusV28aFcZdQKxNHGHkSEzg8zVeEyVwyaAcIJZrOKkB0ZL0u8hQ/sQaEywV5mf4z+TneUe5JovkKUTn94mvvbbnFMu069oKQVxySDHtX7bgVp2mRcxJRIVHni6WJhOBsQNIm0YpJx4/UxUi2+0X0pilwUyoJED7l/v+i5mpS/mn7eTNybP+NV/X18uBVLniMsaZI6n9JFLDSI84hTrfolNHE0qiKPntSoNlxMQ+ZZFIQcI05LaSPNhJIwWKdruB6IJzLXHbD+96PbmJUTn9OSY08hCvxZ/yXGRyWyezFL6ElY7q1fBJG0XobVQDqRvPI2OycmoEwOlBWzz6z+2QsSWzzYTwKnmkaYbWuECA== Content-ID: <9A73CC9E09CEDA4CA13916ECCEEBD568@INDPRD01.PROD.OUTLOOK.COM> 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: fb39b637-d25a-428a-01ed-08daecd02f0f X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jan 2023 14:46:51.3055 (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,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: 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?1753922496209312858?= From: Aditya Garg 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 --- .../broadcom/brcm80211/brcmfmac/pcie.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c index ae57a9a3a..ad7a780cd 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c @@ -92,10 +92,13 @@ static const struct brcmf_firmware_mapping brcmf_pcie_fwnames[] = { BRCMF_FW_ENTRY(BRCM_CC_43664_CHIP_ID, 0xFFFFFFF0, 4366C), BRCMF_FW_ENTRY(BRCM_CC_43666_CHIP_ID, 0xFFFFFFF0, 4366C), BRCMF_FW_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), - BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* revision ID 3 */ BRCMF_FW_ENTRY(CY_CC_89459_CHIP_ID, 0xFFFFFFFF, 4355), }; +static const struct brcmf_firmware_mapping brcmf_pcie_otp_fwnames[] = { + BRCMF_FW_ENTRY(BRCM_CC_4378_CHIP_ID, 0xFFFFFFFF, 4378B1), /* revision ID 3 */ +}; + #define BRCMF_PCIE_FW_UP_TIMEOUT 5000 /* msec */ #define BRCMF_PCIE_REG_MAP_SIZE (32 * 1024) @@ -2165,10 +2168,16 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo) { ".clm_blob", devinfo->clm_name }, }; - fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev, - brcmf_pcie_fwnames, - ARRAY_SIZE(brcmf_pcie_fwnames), - fwnames, ARRAY_SIZE(fwnames)); + if (devinfo->otp.valid) + fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev, + brcmf_pcie_otp_fwnames, + ARRAY_SIZE(brcmf_pcie_otp_fwnames), + fwnames, ARRAY_SIZE(fwnames)); + else + fwreq = brcmf_fw_alloc_request(devinfo->ci->chip, devinfo->ci->chiprev, + brcmf_pcie_fwnames, + ARRAY_SIZE(brcmf_pcie_fwnames), + fwnames, ARRAY_SIZE(fwnames)); if (!fwreq) return NULL;