From: hdegoede@redhat.com (Hans de Goede)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] brcmfmac: Add brcm,nvram_file_name dt property
Date: Wed, 29 Jun 2016 16:04:31 +0200 [thread overview]
Message-ID: <1467209074-15634-1-git-send-email-hdegoede@redhat.com> (raw)
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 <hdegoede@redhat.com>
---
.../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 at 01c12000 {
brcmf: bcrmf at 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;
--
2.7.4
next reply other threads:[~2016-06-29 14:04 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 14:04 Hans de Goede [this message]
2016-06-29 14:04 ` [PATCH 2/4] ARM: dts: sun7i-a20-cubietruck: Set brcm,nvram_file_name Hans de Goede
2016-06-29 17:01 ` [PATCH 2/4] ARM: dts: sun7i-a20-cubietruck: Set brcm, nvram_file_name Kalle Valo
2016-06-29 18:01 ` [linux-sunxi] Re: [PATCH 2/4] ARM: dts: sun7i-a20-cubietruck: Set brcm,nvram_file_name Hans de Goede
2016-06-29 14:04 ` [PATCH 3/4] ARM: dts: sun7i-a20-wits-pro-a20-dkt: Set brcm, nvram_file_name Hans de Goede
2016-06-29 14:04 ` [PATCH 4/4] ARM: dts: sun5i-a10s-auxtek-t004: " Hans de Goede
2016-06-29 14:42 ` [PATCH 1/4] brcmfmac: Add brcm,nvram_file_name dt property Jonas Gorski
2016-06-29 15:16 ` Hans de Goede
2016-06-29 17:00 ` Kalle Valo
2016-06-29 18:01 ` [linux-sunxi] Re: [PATCH 1/4] brcmfmac: Add brcm, nvram_file_name " Hans de Goede
2016-06-29 18:51 ` Arend Van Spriel
2016-06-29 18:57 ` Arend Van Spriel
2016-06-30 8:50 ` Kalle Valo
2016-06-29 19:33 ` Arnd Bergmann
2016-06-29 19:54 ` [linux-sunxi] Re: [PATCH 1/4] brcmfmac: Add brcm,nvram_file_name " Priit Laes
2016-06-29 20:07 ` [linux-sunxi] Re: [PATCH 1/4] brcmfmac: Add brcm, nvram_file_name " Arnd Bergmann
2016-06-30 9:02 ` Kalle Valo
2016-06-30 9:50 ` Hans de Goede
2016-06-30 9:58 ` Kalle Valo
2016-06-30 10:04 ` Hans de Goede
2016-06-30 10:18 ` Jonas Gorski
2016-06-30 10:25 ` Hans de Goede
2016-06-30 11:31 ` Arnd Bergmann
2016-06-30 19:23 ` Arend Van Spriel
2016-07-01 8:51 ` Arnd Bergmann
2016-07-01 8:58 ` Jonas Gorski
2016-07-02 6:59 ` Kalle Valo
2016-07-02 18:20 ` Arend Van Spriel
2016-07-02 21:30 ` Arnd Bergmann
2016-07-04 8:41 ` Arend Van Spriel
2016-07-04 8:55 ` Arnd Bergmann
2016-07-04 9:08 ` Arend Van Spriel
2016-07-04 14:54 ` Arnd Bergmann
2016-07-04 18:36 ` Arend van Spriel
2016-07-05 13:43 ` Arnd Bergmann
2016-07-06 8:08 ` Arend Van Spriel
2016-07-06 13:42 ` Arnd Bergmann
2016-07-06 19:19 ` Arend Van Spriel
2016-07-07 8:46 ` Arnd Bergmann
2016-07-07 9:16 ` Arend Van Spriel
2016-07-07 9:24 ` Arnd Bergmann
2016-07-17 21:45 ` Rob Herring
2016-07-18 7:51 ` Arend Van Spriel
2016-06-30 8:46 ` Kalle Valo
2016-06-30 9:49 ` Hans de Goede
2016-06-30 9:53 ` Hans de Goede
2016-07-01 2:08 ` [PATCH 1/4] brcmfmac: Add brcm,nvram_file_name " Rob Herring
2016-07-01 8:17 ` Arend Van Spriel
2016-07-01 9:20 ` Arnd Bergmann
2016-07-04 16:12 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467209074-15634-1-git-send-email-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).