aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-02-08 11:11:50 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-03-02 09:59:45 -0500
commit9b6cc9a807c79c3c356af6f4e6c55e62c6554226 (patch)
treeb46b492ed06e0db3d96af53e45fd322728a2a657
parent804e27dee49e20c0addd1b7276654220cc3768ae (diff)
bcma: enable support for PCIe Gen 2 host devices
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/bcma/bcma_private.h1
-rw-r--r--drivers/bcma/host_pci.c15
-rw-r--r--drivers/bcma/main.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 36929126a206..29565e30700a 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,
26 int timeout); 26 int timeout);
27void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core); 27void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
28void bcma_init_bus(struct bcma_bus *bus); 28void bcma_init_bus(struct bcma_bus *bus);
29void bcma_unregister_cores(struct bcma_bus *bus);
29int bcma_bus_register(struct bcma_bus *bus); 30int bcma_bus_register(struct bcma_bus *bus);
30void bcma_bus_unregister(struct bcma_bus *bus); 31void bcma_bus_unregister(struct bcma_bus *bus);
31int __init bcma_bus_early_register(struct bcma_bus *bus); 32int __init bcma_bus_early_register(struct bcma_bus *bus);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 5fb87a899a24..a62a2f9091f5 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,
213 /* Initialize struct, detect chip */ 213 /* Initialize struct, detect chip */
214 bcma_init_bus(bus); 214 bcma_init_bus(bus);
215 215
216 /* Scan bus to find out generation of PCIe core */
217 err = bcma_bus_scan(bus);
218 if (err)
219 goto err_pci_unmap_mmio;
220
221 if (bcma_find_core(bus, BCMA_CORE_PCIE2))
222 bus->host_is_pcie2 = true;
223
216 /* Register */ 224 /* Register */
217 err = bcma_bus_register(bus); 225 err = bcma_bus_register(bus);
218 if (err) 226 if (err)
219 goto err_pci_unmap_mmio; 227 goto err_unregister_cores;
220 228
221 pci_set_drvdata(dev, bus); 229 pci_set_drvdata(dev, bus);
222 230
223out: 231out:
224 return err; 232 return err;
225 233
234err_unregister_cores:
235 bcma_unregister_cores(bus);
226err_pci_unmap_mmio: 236err_pci_unmap_mmio:
227 pci_iounmap(dev, bus->mmio); 237 pci_iounmap(dev, bus->mmio);
228err_pci_release_regions: 238err_pci_release_regions:
@@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
283 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) }, 293 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
284 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) }, 294 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
285 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) }, 295 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
296 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
286 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) }, 297 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
298 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
287 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) }, 299 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
288 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) }, 300 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
301 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
289 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) }, 302 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
290 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */ 303 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) }, /* 0xa8db, BCM43217 (sic!) */
291 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */ 304 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) }, /* 0xa8dc */
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 38bde6eab8a4..9635f1033ce5 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
363 return 0; 363 return 0;
364} 364}
365 365
366static void bcma_unregister_cores(struct bcma_bus *bus) 366void bcma_unregister_cores(struct bcma_bus *bus)
367{ 367{
368 struct bcma_device *core, *tmp; 368 struct bcma_device *core, *tmp;
369 369