From: "Rafał Miłecki" <zajec5@gmail.com>
To: Kalle Valo <kvalo@codeaurora.org>, linux-wireless@vger.kernel.org
Cc: "Hauke Mehrtens" <hauke@hauke-m.de>,
brcm80211-dev-list@broadcom.com,
"Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 4/4] bcma: enable support for PCIe Gen 2 host devices
Date: Fri, 30 Jan 2015 18:22:46 +0100 [thread overview]
Message-ID: <1422638566-7593-4-git-send-email-zajec5@gmail.com> (raw)
In-Reply-To: <1422638566-7593-1-git-send-email-zajec5@gmail.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/bcma/bcma_private.h | 1 +
drivers/bcma/host_pci.c | 15 ++++++++++++++-
drivers/bcma/main.c | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 3692912..29565e3 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 mask, u32 value,
int timeout);
void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
void bcma_init_bus(struct bcma_bus *bus);
+void bcma_unregister_cores(struct bcma_bus *bus);
int bcma_bus_register(struct bcma_bus *bus);
void bcma_bus_unregister(struct bcma_bus *bus);
int __init bcma_bus_early_register(struct bcma_bus *bus);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 5fb87a8..a62a2f9 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
/* Initialize struct, detect chip */
bcma_init_bus(bus);
+ /* Scan bus to find out generation of PCIe core */
+ err = bcma_bus_scan(bus);
+ if (err)
+ goto err_pci_unmap_mmio;
+
+ if (bcma_find_core(bus, BCMA_CORE_PCIE2))
+ bus->host_is_pcie2 = true;
+
/* Register */
err = bcma_bus_register(bus);
if (err)
- goto err_pci_unmap_mmio;
+ goto err_unregister_cores;
pci_set_drvdata(dev, bus);
out:
return err;
+err_unregister_cores:
+ bcma_unregister_cores(bus);
err_pci_unmap_mmio:
pci_iounmap(dev, bus->mmio);
err_pci_release_regions:
@@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 38bde6e..9635f10 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
return 0;
}
-static void bcma_unregister_cores(struct bcma_bus *bus)
+void bcma_unregister_cores(struct bcma_bus *bus)
{
struct bcma_device *core, *tmp;
--
1.8.4.5
next prev parent reply other threads:[~2015-01-30 17:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-30 17:22 [PATCH 1/4] bcma: add helpers bringing PCIe hosted bus up / down Rafał Miłecki
2015-01-30 17:22 ` [PATCH 2/4] bcma: change IRQ control function to accept bus as an argument Rafał Miłecki
2015-01-30 17:22 ` [PATCH 3/4] bcma: support bringing up bus hosted on PCIe Gen 2 Rafał Miłecki
2015-01-30 19:59 ` Hauke Mehrtens
2015-01-30 23:08 ` Rafał Miłecki
2015-02-06 6:56 ` Kalle Valo
2015-02-08 14:12 ` Hauke Mehrtens
2015-01-30 17:22 ` Rafał Miłecki [this message]
2015-02-08 15:31 ` [PATCH V2 1/4] bcma: add helpers bringing PCIe hosted bus up / down Rafał Miłecki
2015-02-08 15:31 ` [PATCH V2 2/4] bcma: change IRQ control function to accept bus as an argument Rafał Miłecki
2015-02-08 15:31 ` [PATCH V2 3/4] bcma: support bringing up bus hosted on PCIe Gen 2 Rafał Miłecki
2015-02-08 15:31 ` [PATCH V2 4/4] bcma: enable support for PCIe Gen 2 host devices Rafał Miłecki
2015-02-08 16:11 ` [PATCH V3 1/4] bcma: add helpers bringing PCIe hosted bus up / down Rafał Miłecki
2015-02-08 16:11 ` [PATCH V3 2/4] bcma: change IRQ control function to accept bus as an argument Rafał Miłecki
2015-02-08 16:11 ` [PATCH V3 3/4] bcma: support bringing up bus hosted on PCIe Gen 2 Rafał Miłecki
2015-02-08 16:11 ` [PATCH V3 4/4] bcma: enable support for PCIe Gen 2 host devices Rafał Miłecki
2015-03-02 15:00 ` [PATCH V3 1/4] bcma: add helpers bringing PCIe hosted bus up / down Kalle Valo
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=1422638566-7593-4-git-send-email-zajec5@gmail.com \
--to=zajec5@gmail.com \
--cc=brcm80211-dev-list@broadcom.com \
--cc=hauke@hauke-m.de \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.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).