Skip to content

Commit 0ad4b55

Browse files
jwrdegoedeKalle Valo
authored andcommitted
brcmfmac: Set board_type used for nvram file selection to machine-compatible
For of/devicetree using machines, set the board_type used for nvram file selection to the first string listed in the top-level's node compatible string, aka the machine-compatible as used by of_machine_is_compatible(). The board_type setting is used to load the board-specific nvram file with a board-specific name so that we can ship files for each supported board in linux-firmware. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
1 parent eae8e50 commit 0ad4b55

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct brcmf_mp_device {
5959
bool iapp;
6060
bool ignore_probe_fail;
6161
struct brcmfmac_pd_cc *country_codes;
62+
const char *board_type;
6263
union {
6364
struct brcmfmac_sdio_pd sdio;
6465
} bus;

drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
2727
struct brcmf_mp_device *settings)
2828
{
2929
struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio;
30-
struct device_node *np = dev->of_node;
30+
struct device_node *root, *np = dev->of_node;
31+
struct property *prop;
3132
int irq;
3233
u32 irqf;
3334
u32 val;
3435

36+
/* Set board-type to the first string of the machine compatible prop */
37+
root = of_find_node_by_path("/");
38+
if (root) {
39+
prop = of_find_property(root, "compatible", NULL);
40+
settings->board_type = of_prop_next_string(prop, NULL);
41+
of_node_put(root);
42+
}
43+
3544
if (!np || bus_type != BRCMF_BUSTYPE_SDIO ||
3645
!of_device_is_compatible(np, "brcm,bcm4329-fmac"))
3746
return;

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,7 @@ brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo)
17851785
fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
17861786
fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
17871787
fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL;
1788+
fwreq->board_type = devinfo->settings->board_type;
17881789
/* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */
17891790
fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1;
17901791
fwreq->bus_nr = devinfo->pdev->bus->number;

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4174,6 +4174,7 @@ brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus)
41744174

41754175
fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY;
41764176
fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM;
4177+
fwreq->board_type = bus->sdiodev->settings->board_type;
41774178

41784179
return fwreq;
41794180
}

0 commit comments

Comments
 (0)