pandora: reserve CMA area for c64_tools
[pandora-kernel.git] / drivers / bcma / driver_pci.c
index 25f3ddf..4fde625 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include "bcma_private.h"
+#include <linux/export.h>
 #include <linux/bcma/bcma.h>
 
 /**************************************************
@@ -173,7 +174,7 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
                return false;
 
 #ifdef CONFIG_SSB_DRIVER_PCICORE
-       if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
+       if (bus->sprom.boardflags_lo & SSB_BFL_NOPCI)
                return false;
 #endif /* CONFIG_SSB_DRIVER_PCICORE */
 
@@ -189,6 +190,9 @@ static bool bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc)
 
 void bcma_core_pci_init(struct bcma_drv_pci *pc)
 {
+       if (pc->setup_done)
+               return;
+
        if (bcma_core_pci_is_in_hostmode(pc)) {
 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
                bcma_core_pci_hostmode_init(pc);
@@ -198,6 +202,8 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
        } else {
                bcma_core_pci_clientmode_init(pc);
        }
+
+       pc->setup_done = true;
 }
 
 int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
@@ -205,7 +211,14 @@ int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
 {
        struct pci_dev *pdev = pc->core->bus->host_pci;
        u32 coremask, tmp;
-       int err;
+       int err = 0;
+
+       if (core->bus->hosttype != BCMA_HOSTTYPE_PCI) {
+               /* This bcma device is not on a PCI host-bus. So the IRQs are
+                * not routed through the PCI core.
+                * So we must not enable routing through the PCI core. */
+               goto out;
+       }
 
        err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
        if (err)