Commit b1d94be5 authored by Arend van Spriel's avatar Arend van Spriel Committed by Kalle Valo

wifi: brcmfmac: add support Broadcom BCA firmware api

Broadcom BCA division develops its own firmware api and as such will
likely diverge over time (or already has). Add support for handling
this.
Reviewed-by: default avatarHante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: default avatarFranky Lin <franky.lin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221129135446.151065-6-arend.vanspriel@broadcom.com
parent f74f1ec2
......@@ -52,7 +52,9 @@ brcmfmac-$(CONFIG_DMI) += \
ifeq ($(CONFIG_BRCMFMAC),m)
obj-m += wcc/
obj-m += cyw/
obj-m += bca/
else
brcmfmac-$(CONFIG_BRCMFMAC) += wcc/core.o
brcmfmac-$(CONFIG_BRCMFMAC) += cyw/core.o
brcmfmac-$(CONFIG_BRCMFMAC) += bca/core.o
endif
# SPDX-License-Identifier: ISC
#
# Copyright (c) 2022 Broadcom Corporation
ccflags-y += \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/.. \
-I $(srctree)/$(src)/../../include
obj-m += brcmfmac-bca.o
brcmfmac-bca-objs += \
core.o module.o
// SPDX-License-Identifier: ISC
/*
* Copyright (c) 2022 Broadcom Corporation
*/
#include <linux/errno.h>
#include <linux/types.h>
#include <core.h>
#include <bus.h>
#include <fwvid.h>
#include "vops.h"
static int brcmf_bca_attach(struct brcmf_pub *drvr)
{
pr_err("%s: executing\n", __func__);
return 0;
}
static void brcmf_bca_detach(struct brcmf_pub *drvr)
{
pr_err("%s: executing\n", __func__);
}
const struct brcmf_fwvid_ops brcmf_bca_ops = {
.attach = brcmf_bca_attach,
.detach = brcmf_bca_detach,
};
// SPDX-License-Identifier: ISC
/*
* Copyright (c) 2022 Broadcom Corporation
*/
#include <linux/module.h>
#include <bus.h>
#include <core.h>
#include <fwvid.h>
#include "vops.h"
static int __init brcmf_bca_init(void)
{
return brcmf_fwvid_register_vendor(BRCMF_FWVENDOR_BCA, THIS_MODULE,
&brcmf_bca_ops);
}
static void __exit brcmf_bca_exit(void)
{
brcmf_fwvid_unregister_vendor(BRCMF_FWVENDOR_BCA, THIS_MODULE);
}
MODULE_LICENSE("Dual BSD/GPL");
module_init(brcmf_bca_init);
module_exit(brcmf_bca_exit);
/* SPDX-License-Identifier: ISC */
/*
* Copyright (c) 2022 Broadcom Corporation
*/
#ifndef _BRCMFMAC_BCA_VOPS_H
#define _BRCMFMAC_BCA_VOPS_H
extern const struct brcmf_fwvid_ops brcmf_bca_ops;
#define BCA_VOPS (&brcmf_bca_ops)
#endif /* _BRCMFMAC_BCA_VOPS_H */
......@@ -34,6 +34,7 @@
enum brcmf_fwvendor {
BRCMF_FWVENDOR_WCC,
BRCMF_FWVENDOR_CYW,
BRCMF_FWVENDOR_BCA,
/* keep last */
BRCMF_FWVENDOR_NUM,
BRCMF_FWVENDOR_INVALID
......
......@@ -20,6 +20,7 @@
#include "wcc/vops.h"
#include "cyw/vops.h"
#include "bca/vops.h"
struct brcmf_fwvid_entry {
const char *name;
......@@ -52,6 +53,7 @@ static DEFINE_MUTEX(fwvid_list_lock);
static struct brcmf_fwvid_entry fwvid_list[BRCMF_FWVENDOR_NUM] = {
FWVID_ENTRY_INIT(WCC, wcc),
FWVID_ENTRY_INIT(CYW, cyw),
FWVID_ENTRY_INIT(BCA, bca),
};
#if IS_MODULE(CONFIG_BRCMFMAC)
......
......@@ -2571,47 +2571,47 @@ static const struct dev_pm_ops brcmf_pciedrvr_pm = {
#endif /* CONFIG_PM */
#define BRCMF_PCIE_DEVICE(dev_id) \
#define BRCMF_PCIE_DEVICE(dev_id, fw_vend) \
{ \
BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id), \
PCI_ANY_ID, PCI_ANY_ID, \
PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, \
BRCMF_FWVENDOR_WCC \
BRCMF_FWVENDOR_ ## fw_vend \
}
#define BRCMF_PCIE_DEVICE_SUB(dev_id, subvend, subdev) \
#define BRCMF_PCIE_DEVICE_SUB(dev_id, subvend, subdev, fw_vend) \
{ \
BRCM_PCIE_VENDOR_ID_BROADCOM, (dev_id), \
(subvend), (subdev), \
PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, \
BRCMF_FWVENDOR_WCC \
BRCMF_FWVENDOR_ ## fw_vend \
}
static const struct pci_device_id brcmf_pcie_devid_table[] = {
BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID),
BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4354_RAW_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_RAW_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4358_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4359_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4364_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_5G_DEVICE_ID),
BRCMF_PCIE_DEVICE_SUB(0x4365, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4365),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID),
BRCMF_PCIE_DEVICE(CY_PCIE_89459_DEVICE_ID),
BRCMF_PCIE_DEVICE(CY_PCIE_89459_RAW_DEVICE_ID),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4354_RAW_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_RAW_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4358_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4359_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_2G_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_5G_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_43602_RAW_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4364_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_2G_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4365_5G_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE_SUB(0x4365, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4365, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_2G_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4366_5G_DEVICE_ID, BCA),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4371_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(BRCM_PCIE_4378_DEVICE_ID, WCC),
BRCMF_PCIE_DEVICE(CY_PCIE_89459_DEVICE_ID, CYW),
BRCMF_PCIE_DEVICE(CY_PCIE_89459_RAW_DEVICE_ID, CYW),
{ /* end: all zeroes */ }
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment