Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13462136rwl; Wed, 4 Jan 2023 08:28:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXtQmX5Kz7BTNhYQjUrbKLZAkLG9nv2T7NojB86RyrMCDJPM8K93wRCPqvwU3E17NxO+Cd5M X-Received: by 2002:a05:6a20:548e:b0:ac:19cf:1553 with SMTP id i14-20020a056a20548e00b000ac19cf1553mr67976680pzk.61.1672849715939; Wed, 04 Jan 2023 08:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672849715; cv=none; d=google.com; s=arc-20160816; b=u2B3deKvzcHmL66JKwiNVgGnedTAlA0uPT5FzAE6+WzHxAisMUNZkYz7sZRKFG8SDf 3h3ah2U5/MJg3ya00lKFXBQt9s5vq3/9gEblRqSsPmqAaD0+FBnIy9h0yPaK+rKEYdhQ rZEHbbydEFBZMAJ/4v67jiQCKcGmhvkjPGPgCEcYCJFFGEZ46fbpYlOg9Ew9Nr1TrxVT 0NH9LSbYgJ6O0CXYjMOUkBISKjd3MsEWqU5rB7MmDksvREiHq0sh4lZplvL2AUABe74Y GpVRxOD+en0fpU2BCfYx0+IM1IYc4JEPnbx/HQyF7sYMUmFtn5wRjqkfuwJXsflsZqa0 0yGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=qYLE2dy8acIKTYT1JExe6B0SlzB3AQQsKArHX7jN54M=; b=MLxjnEnBHxb038eHLuJwhpEIxtlJXA9Oo3mc/sFI8v1nvhwDv5MVP9h33izpyE1Trz QtPaNYzVbhAWEVcys8K309oJVFuF1sz/LA6mv2/Q1EbxPXrtYib9wRuNtUzuSEtT49o7 lYMUkn/IL3SUtJguj475nAljUsfbzZfXS9fytTBJlG67OMPBn5ktDEsWWN6Fu2iBgq4d 8Q7VSluF0pIaVxjPbeL4On1QVzDqo2MZedvPp4eiaVlnF5AQmxlxQMyF1OjNsUMddWZT GW04X1SV6OsqvSWtG8CXYUaevAuc8Ra0dPWLKGwUnWoZUvpzl8Us7rJ2nYgs4zTqn9G1 h/Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=ZFcYfazb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a63d752000000b0046e9babe7a1si34957591pgi.54.2023.01.04.08.28.25; Wed, 04 Jan 2023 08:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=ZFcYfazb; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S240032AbjADQ1f (ORCPT + 67 others); Wed, 4 Jan 2023 11:27:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239980AbjADQ1U (ORCPT ); Wed, 4 Jan 2023 11:27:20 -0500 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 341593F10A; Wed, 4 Jan 2023 08:27:14 -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)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 9FA1A41DF4; Wed, 4 Jan 2023 16:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1672849632; bh=CyB6nBdwWKmnMF5EnKIpG3XVjcUbBPWolPGePYu6aHs=; h=Date:To:Cc:References:From:Subject:In-Reply-To; b=ZFcYfazb5ofGvHpZhd4vo4wCI/Euispc2vhvGew9YeFe0W6od6eOyJfBvn8XX4J14 M+OqOZ9tmBNHZEo2BYLybSCDVkcBr4i88ejbzqQd5N/NuRKr4d2tdvkOtVLm8VFtKT nNbbbCXBXPPCL/D0vf0XTB5CVCBbRdEVoiEo+UxpATWG2RhRFHj49Z6wS5VGXt2nbu wJCnQIk/OS3MS+sIiuP33sSoHkgizDyXFZ7Ah5T2MlJX4NtvumXL1+CoKvKbi8eJdr NWydl6B6H41U+laQ1EVo2MSSC1CJ9Usc1R9ZXSDOMI10m50GXKhFFkVassPW9vHcaU Wd8kZ+GXW9uFg== Message-ID: Date: Thu, 5 Jan 2023 01:27:03 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Content-Language: en-US To: Arend van Spriel , Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Prutskov , Chi-Hsien Lin , Wright Feng , Ian Lin , Soontak Lee , Joseph chuang , Sven Peter , Alyssa Rosenzweig , asahi@lists.linux.dev, linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230104100116.729-1-marcan@marcan.st> <20230104100116.729-3-marcan@marcan.st> From: Hector Martin Subject: Re: [PATCH v1 2/4] brcmfmac: pcie: Add IDs/properties for BCM4355 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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-wireless@vger.kernel.org On 04/01/2023 22.35, Arend van Spriel wrote: > On 1/4/2023 11:01 AM, 'Hector Martin' via BRCM80211-DEV-LIST,PDL wrote: >> 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 3264be485e20..bb4faea0f0b6 100644 >> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c >> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c > > [...] > >> @@ -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; > > This bit is not described in the commit message. Can you remind me why > the driver needs to read OTP? Apple platforms use a vendor-specific OTP area to store identification information used to select the right firmware/txcap/clm/nvram blobs. See 6bad3eeab6d3d (already upstream) and the immediately preceding commits for how this all works. In principle this should just return gracefully if that part of the OTP is empty, though when I originally wrote this code we only knew of Apple platforms using these chips anyway. If you think this might possibly introduce issues to other platforms using the same chips (e.g. if reading the OTP fails outright for some reason), we could gate it on the presence of a valid devinfo->settings->antenna_sku, which would indicate an Apple platform (since that property is specific to the Apple firmware-selection process and only populated on those platforms). - Hector