Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp5005058rwn; Mon, 12 Sep 2022 02:54:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BZO37AvHYV6+rmDUNTjBAmLw6InGnp0vawqzxfTyV9Ub8ooROMaXoOZNWSMbkTKAUYz9N X-Received: by 2002:a62:5443:0:b0:53b:b934:ee8e with SMTP id i64-20020a625443000000b0053bb934ee8emr27238852pfb.10.1662976451382; Mon, 12 Sep 2022 02:54:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662976451; cv=none; d=google.com; s=arc-20160816; b=Sm+d3SquuQ73vXuQjoGAnVf76IbQoIaPKZjg/QP2ofvlJfZC9LJa1i2ZsobSYm4DgP MHJMhSmCr2ZBVazHiLCrLK9ZSXy5uO3x+1UhcoUcb+paPtWFUwpgDsFTs7xf39P/+NyU KwZn7VWVAmBur0lzwzZIc6dPaMMlJAEqhKLbZ43y3eheYZOUTwci8f23czugajtgq5gY G1rgS8wY3VGNrnsSV8OJnKfuSdxFP+KMAxeYdQ7EjnxTvDdL+bqMOOcpfCQP9ZPMOt6v nQ1oh9rowF9ohkgFsSZE+FIiZJWDrfnf/s612FOdCfHXtlrzOa/jnyP6+FdyjkXFxGEg cqvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=RTMIwL35n5PqDT3Ek+KURvJy7JWn0/URB8eBvCX1/bg=; b=b6vIPIv+2nLlYH+6fKPqmKNsq8559kNYqDb9VxbxJloP0D8yyhDhjJ34AcoHmT4ewm BDwr9Wz/WWYRhkdvma/W25cdnCJr92YLLANnUgFYrrc+lI3YGlZxT/hY6zvbuZo0dexr yvdVg5bcZrG3DCnPKsW/ilNZG3MAZdHhB1FnGFK2w6edzhdwlOrEnumvJC2gOt6Qsq4d MeTQ5vvC16XZWhQt0HFmGyHz1nv/gIg+gj6amWPOS6k1lefnWLdvk6lrmTSt5xg+KP9U adet6/vau7iEO9z9gvHlHOw4b6hRtTlSiBCjLGu9xNYNv90zo910MWl55oZSWiZWuInf nuKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=HW4LHEww; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o65-20020a634144000000b0041b64ff7fe9si8746690pga.79.2022.09.12.02.54.00; Mon, 12 Sep 2022 02:54:11 -0700 (PDT) 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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=HW4LHEww; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiILJxn (ORCPT + 64 others); Mon, 12 Sep 2022 05:53:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbiILJxR (ORCPT ); Mon, 12 Sep 2022 05:53:17 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1500337181; Mon, 12 Sep 2022 02:53:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RTMIwL35n5PqDT3Ek+KURvJy7JWn0/URB8eBvCX1/bg=; b=HW4LHEwwg/A/wZe/0v/ncBX1le F3PutBM2/y6WZg04PLy2Do89Gz/c2CJI+dnqoO0fD71vcSH+IT6cOaL5+5oqQ0hGuQeTRQqGFFIdX Xt9W4XmE68bsT6/1TK+oGVLU92z37SLULohIXUYI7YCxIQgrIXy4Cfyaw9fEDj7x0fYwfkSKJXJ9B znCi/gYvz0fEmRZf6p/aBcKCroGzMOUEy/U4TAbDpQGbi6MRon4INRnZpLdm6XixqP6OSv+bZNGpH sutQxBDdsr5VWXw2iYU+OJ/Lh1vdiDDkaO4gaLNM8P2cf5gvWkintJ/HCQSjVltgdVE2t2Tbf7M2t fBCYJCfg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39650 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oXg7n-0001T9-QP; Mon, 12 Sep 2022 10:53:07 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oXg7n-0064vB-3Y; Mon, 12 Sep 2022 10:53:07 +0100 In-Reply-To: References: From: Russell King (Oracle) To: Arend van Spriel , Franky Lin , Hante Meuleman Cc: Alyssa Rosenzweig , asahi@lists.linux.dev, brcm80211-dev-list.pdl@broadcom.com, "David S. Miller" , devicetree@vger.kernel.org, Eric Dumazet , Hector Martin , Jakub Kicinski , Kalle Valo , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Paolo Abeni , "Rafa__ Mi__ecki" , Rob Herring , SHA-cyfmac-dev-list@infineon.com, Sven Peter Subject: [PATCH wireless-next v2 06/12] brcmfmac: of: Fetch Apple properties MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 12 Sep 2022 10:53:07 +0100 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_NONE, T_SCC_BODY_TEXT_LINE 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 From: Hector Martin On Apple ARM64 platforms, firmware selection requires two properties that come from system firmware: the module-instance (aka "island", a codename representing a given hardware platform) and the antenna-sku. We map Apple's module codenames to board_types in the form "apple,". The mapped board_type is added to the DTS file in that form, while the antenna-sku is forwarded by our bootloader from the Apple Device Tree into the FDT. Grab them from the DT so firmware selection can use them. Reviewed-by: Linus Walleij Signed-off-by: Hector Martin Signed-off-by: Russell King (Oracle) --- .../wireless/broadcom/brcm80211/brcmfmac/common.h | 1 + .../net/wireless/broadcom/brcm80211/brcmfmac/of.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h index 6c5a22a32a96..aa25abffcc7d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h @@ -53,6 +53,7 @@ struct brcmf_mp_device { struct brcmfmac_pd_cc *country_codes; const char *board_type; unsigned char mac[ETH_ALEN]; + const char *antenna_sku; union { struct brcmfmac_sdio_pd sdio; } bus; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index 79388d49c256..a83699de01ec 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -70,14 +70,24 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, { struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio; struct device_node *root, *np = dev->of_node; + const char *prop; int irq; int err; u32 irqf; u32 val; + /* Apple ARM64 platforms have their own idea of board type, passed in + * via the device tree. They also have an antenna SKU parameter + */ + if (!of_property_read_string(np, "brcm,board-type", &prop)) + settings->board_type = prop; + + if (!of_property_read_string(np, "apple,antenna-sku", &prop)) + settings->antenna_sku = prop; + /* Set board-type to the first string of the machine compatible prop */ root = of_find_node_by_path("/"); - if (root) { + if (root && !settings->board_type) { char *board_type; const char *tmp; -- 2.30.2