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: 642081 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rfl5N2DJKz9sDG for ; Thu, 30 Jun 2016 00:13:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbcF2ON1 (ORCPT ); Wed, 29 Jun 2016 10:13:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47953 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbcF2ON0 (ORCPT ); Wed, 29 Jun 2016 10:13:26 -0400 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" Cc: Arend van Spriel , Maxime Ripard , Chen-Yu Tsai , linux-wireless@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , linux-sunxi@googlegroups.com, Hans de Goede 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) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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;