}
return NULL;
}
+
+/*
+ * ppc64 can have multifunction devices that do not respond to function 0.
+ * In this case we must scan all functions.
+ */
+int
+pcibios_scan_all_fns(struct pci_bus *bus, int devfn)
+{
+ struct device_node *busdn, *dn;
+
+ if (bus->self)
+ busdn = pci_device_to_OF_node(bus->self);
+ else
+ busdn = bus->sysdata; /* must be a phb */
+
+ /*
+ * Check to see if there is any of the 8 functions are in the
+ * device tree. If they are then we need to scan all the
+ * functions of this slot.
+ */
+ for (dn = busdn->child; dn; dn = dn->sibling)
+ if ((dn->devfn >> 3) == (devfn >> 3))
+ return 1;
+
+ return 0;
+}
int __devinit pci_scan_slot(struct pci_bus *bus, int devfn)
{
int func, nr = 0;
+ int scan_all_fns;
+
+ scan_all_fns = pcibios_scan_all_fns(bus, devfn);
for (func = 0; func < 8; func++, devfn++) {
struct pci_dev *dev;
}
}
} else {
- if (func == 0)
+ if (func == 0 && !scan_all_fns)
break;
}
}
bus numbers. */
#define pcibios_assign_all_busses() 1
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO alpha_mv.min_io_address
#define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
#endif
+#define pcibios_scan_all_fns(a, b) 0
+
static inline void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
/* Should not be needed. IDE stupidity */
/* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */
-#define PCI_DMA_BUS_IS_PHYS 0
+#define PCI_DMA_BUS_IS_PHYS 0
+#define pcibios_scan_all_fns(a, b) 0
region->end = res->end;
}
+#define pcibios_scan_all_fns(a, b) 0
+
#endif
*/
#define pcibios_assign_all_busses() 0
+#define pcibios_scan_all_fns(a, b) 0
extern inline void pcibios_set_master(struct pci_dev *dev)
{
#else
#define pcibios_assign_all_busses() 0
#endif
+#define pcibios_scan_all_fns(a, b) 0
extern unsigned long pci_mem_start;
#define PCIBIOS_MIN_IO 0x1000
* loader.
*/
#define pcibios_assign_all_busses() 0
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000
};
#define pcibios_assign_all_busses() 0
+#define pcibios_scan_all_fns(a, b) 0
static inline void pcibios_set_master(struct pci_dev *dev)
{
#define PCIBIOS_MIN_IO 0x100
#define PCIBIOS_MIN_MEM 0x00010000
+#define pcibios_scan_all_fns(a, b) 0
+
/*
* Return whether the given PCI device DMA address mask can
* be supported properly. For example, if your device can
#else
#define pcibios_assign_all_busses() 0
#endif
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000
** to zero for legacy platforms and one for PAT platforms.
*/
#define pcibios_assign_all_busses() (pdc_type == PDC_TYPE_PAT)
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0x10
#define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */
extern int pci_assign_all_busses;
#define pcibios_assign_all_busses() (pci_assign_all_busses)
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000
#define PCIBIOS_MIN_IO 0x1000
#define PCIBIOS_MIN_MEM 0x10000000
+extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn);
+
static inline void pcibios_set_master(struct pci_dev *dev)
{
/* No special bus mastering setup handling */
or architectures with incomplete PCI setup by the loader */
#define pcibios_assign_all_busses() 1
+#define pcibios_scan_all_fns(a, b) 0
/*
* A board can define one or more PCI channels that represent built-in (or
* or architectures with incomplete PCI setup by the loader.
*/
#define pcibios_assign_all_busses() 0
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0UL
#define PCIBIOS_MIN_MEM 0UL
* or architectures with incomplete PCI setup by the loader.
*/
#define pcibios_assign_all_busses() 0
+#define pcibios_scan_all_fns(a, b) 0
#define PCIBIOS_MIN_IO 0UL
#define PCIBIOS_MIN_MEM 0UL
#define __UM_PCI_H
#define PCI_DMA_BUS_IS_PHYS (1)
+#define pcibios_scan_all_fns(a, b) 0
#endif
/* Get any platform-dependent definitions. */
#include <asm/machdep.h>
+#define pcibios_scan_all_fns(a, b) 0
+
/* Generic declarations. */
struct scatterlist;
#else
#define pcibios_assign_all_busses() 0
#endif
+#define pcibios_scan_all_fns(a, b) 0
extern int no_iommu, force_iommu;