From patchwork Wed Jun 29 14:04:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9205405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 16856607D8 for ; Wed, 29 Jun 2016 14:07:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 073B12842C for ; Wed, 29 Jun 2016 14:07:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F02A228662; Wed, 29 Jun 2016 14:07:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC3612842C for ; Wed, 29 Jun 2016 14:07:34 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIG7j-0004Ff-8t; Wed, 29 Jun 2016 14:05:51 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIG6x-000240-QX for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2016 14:05:07 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 02DF97F340; Wed, 29 Jun 2016 14:04:43 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-127.ams2.redhat.com [10.36.6.127]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5TE4bni014842; Wed, 29 Jun 2016 10:04:38 -0400 From: Hans de Goede To: "John W . Linville" Subject: [PATCH 1/4] brcmfmac: Add brcm,nvram_file_name dt property Date: Wed, 29 Jun 2016 16:04:31 +0200 Message-Id: <1467209074-15634-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 29 Jun 2016 14:04:43 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_070504_108824_9D6E1857 X-CRM114-Status: GOOD ( 15.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , linux-wireless@vger.kernel.org, linux-sunxi@googlegroups.com, Hans de Goede , Chen-Yu Tsai , Arend van Spriel , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a brcm,nvram_file_name dt property to allow overruling the default nvram filename for sdio devices. The idea is that we can specify a board specific nvram file, e.g. brcmfmac43362-ap6210.txt for boards with an ap6210 wifi sdio module and ship this in linux-firmware, so that wifi will work out of the box, without requiring users to find and then manually install the right nvram file for their board. Signed-off-by: Hans de Goede --- .../devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt | 2 ++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 2 ++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 6 ++++++ include/linux/platform_data/brcmfmac.h | 2 ++ 4 files changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt index 5dbf169..2ba13a6 100644 --- a/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt +++ b/Documentation/devicetree/bindings/net/wireless/brcm,bcm43xx-fmac.txt @@ -11,6 +11,7 @@ Required properties: Optional properties: - brcm,drive-strength : drive strength used for SDIO pins on device in mA (default = 6). + - brcm,nvram_file_name : name of the nvram file to load - interrupt-parent : the phandle for the interrupt controller to which the device interrupts are connected. - interrupts : specifies attributes for the out-of-band interrupt (host-wake). @@ -34,6 +35,7 @@ mmc3: mmc@01c12000 { brcmf: bcrmf@1 { reg = <1>; compatible = "brcm,bcm4329-fmac"; + brcm,nvram_file_name = "brcm/brcmfmac43362-ap6210.txt"; interrupt-parent = <&pio>; interrupts = <10 8>; /* PH10 / EINT10 */ interrupt-names = "host-wake"; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c index 425c41d..a054122 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c @@ -36,6 +36,8 @@ void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio) if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) sdio->drive_strength = val; + of_property_read_string(np, "brcm,nvram_file_name", &sdio->nvram_name); + /* make sure there are interrupts defined in the node */ if (!of_find_property(np, "interrupts", NULL)) return; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index 67e69bf..2655409 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -4201,6 +4201,12 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev) if (ret) goto fail; + if (sdiodev->settings->bus.sdio.nvram_name) { + strlcpy(sdiodev->nvram_name, + sdiodev->settings->bus.sdio.nvram_name, + BRCMF_FW_NAME_LEN); + } + ret = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM, sdiodev->fw_name, sdiodev->nvram_name, brcmf_sdio_firmware_callback); diff --git a/include/linux/platform_data/brcmfmac.h b/include/linux/platform_data/brcmfmac.h index 1d30bf2..a5515dd 100644 --- a/include/linux/platform_data/brcmfmac.h +++ b/include/linux/platform_data/brcmfmac.h @@ -65,6 +65,7 @@ enum brcmf_bus_type { * the target drive strength, the exact drive strength * which will be used depends on the capabilities of the * device. + * @nvram_name: name of nvram file to load. * @oob_irq_supported: does the board have support for OOB interrupts. SDIO * in-band interrupts are relatively slow and for having * less overhead on interrupt processing an out of band @@ -91,6 +92,7 @@ enum brcmf_bus_type { struct brcmfmac_sdio_pd { int txglomsz; unsigned int drive_strength; + const char *nvram_name; bool oob_irq_supported; unsigned int oob_irq_nr; unsigned long oob_irq_flags;