bcma: enable support for PCIe Gen 2 host devices
authorRafał Miłecki <zajec5@gmail.com>
Sun, 8 Feb 2015 16:11:50 +0000 (17:11 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 2 Mar 2015 14:59:45 +0000 (16:59 +0200)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/bcma/bcma_private.h
drivers/bcma/host_pci.c
drivers/bcma/main.c

index 3692912..29565e3 100644 (file)
@@ -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);
index 5fb87a8..a62a2f9 100644 (file)
@@ -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 */
index 38bde6e..9635f10 100644 (file)
@@ -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;