|
@@ -1,5 +1,5 @@
|
|
|
-#ifndef __PPC64_PCI_H
|
|
|
-#define __PPC64_PCI_H
|
|
|
+#ifndef __ASM_POWERPC_PCI_H
|
|
|
+#define __ASM_POWERPC_PCI_H
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
|
/*
|
|
@@ -18,6 +18,7 @@
|
|
|
#include <asm/scatterlist.h>
|
|
|
#include <asm/io.h>
|
|
|
#include <asm/prom.h>
|
|
|
+#include <asm/pci-bridge.h>
|
|
|
|
|
|
#include <asm-generic/pci-dma-compat.h>
|
|
|
|
|
@@ -26,11 +27,21 @@
|
|
|
|
|
|
struct pci_dev;
|
|
|
|
|
|
-#ifdef CONFIG_PPC_ISERIES
|
|
|
+/* Values for the `which' argument to sys_pciconfig_iobase syscall. */
|
|
|
+#define IOBASE_BRIDGE_NUMBER 0
|
|
|
+#define IOBASE_MEMORY 1
|
|
|
+#define IOBASE_IO 2
|
|
|
+#define IOBASE_ISA_IO 3
|
|
|
+#define IOBASE_ISA_MEM 4
|
|
|
+
|
|
|
+/*
|
|
|
+ * Set this to 1 if you want the kernel to re-assign all PCI
|
|
|
+ * bus numbers
|
|
|
+ */
|
|
|
+extern int pci_assign_all_buses;
|
|
|
+#define pcibios_assign_all_busses() (pci_assign_all_buses)
|
|
|
+
|
|
|
#define pcibios_scan_all_fns(a, b) 0
|
|
|
-#else
|
|
|
-extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn);
|
|
|
-#endif
|
|
|
|
|
|
static inline void pcibios_set_master(struct pci_dev *dev)
|
|
|
{
|
|
@@ -50,6 +61,7 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
|
|
return channel ? 15 : 14;
|
|
|
}
|
|
|
|
|
|
+#ifdef CONFIG_PPC64
|
|
|
#define HAVE_ARCH_PCI_MWI 1
|
|
|
static inline int pcibios_prep_mwi(struct pci_dev *dev)
|
|
|
{
|
|
@@ -64,12 +76,10 @@ static inline int pcibios_prep_mwi(struct pci_dev *dev)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-extern unsigned int pcibios_assign_all_busses(void);
|
|
|
-
|
|
|
extern struct dma_mapping_ops pci_dma_ops;
|
|
|
|
|
|
/* For DAC DMA, we currently don't support it by default, but
|
|
|
- * we let the platform override this
|
|
|
+ * we let 64-bit platforms override this.
|
|
|
*/
|
|
|
static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
|
|
|
{
|
|
@@ -102,6 +112,35 @@ extern int pci_domain_nr(struct pci_bus *bus);
|
|
|
/* Decide whether to display the domain number in /proc */
|
|
|
extern int pci_proc_domain(struct pci_bus *bus);
|
|
|
|
|
|
+#else /* 32-bit */
|
|
|
+
|
|
|
+#ifdef CONFIG_PCI
|
|
|
+static inline void pci_dma_burst_advice(struct pci_dev *pdev,
|
|
|
+ enum pci_dma_burst_strategy *strat,
|
|
|
+ unsigned long *strategy_parameter)
|
|
|
+{
|
|
|
+ *strat = PCI_DMA_BURST_INFINITY;
|
|
|
+ *strategy_parameter = ~0UL;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+/*
|
|
|
+ * At present there are very few 32-bit PPC machines that can have
|
|
|
+ * memory above the 4GB point, and we don't support that.
|
|
|
+ */
|
|
|
+#define pci_dac_dma_supported(pci_dev, mask) (0)
|
|
|
+
|
|
|
+/* Return the index of the PCI controller for device PDEV. */
|
|
|
+#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
|
|
|
+
|
|
|
+/* Set the name of the bus as it appears in /proc/bus/pci */
|
|
|
+static inline int pci_proc_domain(struct pci_bus *bus)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+#endif /* CONFIG_PPC64 */
|
|
|
+
|
|
|
struct vm_area_struct;
|
|
|
/* Map a range of PCI memory or I/O space for a device into user space */
|
|
|
int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
|
|
@@ -110,6 +149,7 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
|
|
|
/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
|
|
|
#define HAVE_PCI_MMAP 1
|
|
|
|
|
|
+#ifdef CONFIG_PPC64
|
|
|
/* pci_unmap_{single,page} is not a nop, thus... */
|
|
|
#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
|
|
|
dma_addr_t ADDR_NAME;
|
|
@@ -124,22 +164,40 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
|
|
|
#define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
|
|
|
(((PTR)->LEN_NAME) = (VAL))
|
|
|
|
|
|
-/* The PCI address space does equal the physical memory
|
|
|
- * address space. The networking and block device layers use
|
|
|
+/* The PCI address space does not equal the physical memory address
|
|
|
+ * space (we have an IOMMU). The IDE and SCSI device layers use
|
|
|
* this boolean for bounce buffer decisions.
|
|
|
*/
|
|
|
#define PCI_DMA_BUS_IS_PHYS (0)
|
|
|
+
|
|
|
+#else /* 32-bit */
|
|
|
+
|
|
|
+/* The PCI address space does equal the physical memory
|
|
|
+ * address space (no IOMMU). The IDE and SCSI device layers use
|
|
|
+ * this boolean for bounce buffer decisions.
|
|
|
+ */
|
|
|
+#define PCI_DMA_BUS_IS_PHYS (1)
|
|
|
+
|
|
|
+/* pci_unmap_{page,single} is a nop so... */
|
|
|
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
|
|
|
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
|
|
|
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
|
|
|
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
|
|
|
+#define pci_unmap_len(PTR, LEN_NAME) (0)
|
|
|
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
|
|
|
+
|
|
|
+#endif /* CONFIG_PPC64 */
|
|
|
|
|
|
-extern void
|
|
|
-pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
|
|
|
+extern void pcibios_resource_to_bus(struct pci_dev *dev,
|
|
|
+ struct pci_bus_region *region,
|
|
|
struct resource *res);
|
|
|
|
|
|
-extern void
|
|
|
-pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
|
|
|
+extern void pcibios_bus_to_resource(struct pci_dev *dev,
|
|
|
+ struct resource *res,
|
|
|
struct pci_bus_region *region);
|
|
|
|
|
|
-static inline struct resource *
|
|
|
-pcibios_select_root(struct pci_dev *pdev, struct resource *res)
|
|
|
+static inline struct resource *pcibios_select_root(struct pci_dev *pdev,
|
|
|
+ struct resource *res)
|
|
|
{
|
|
|
struct resource *root = NULL;
|
|
|
|
|
@@ -151,14 +209,12 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res)
|
|
|
return root;
|
|
|
}
|
|
|
|
|
|
-extern int
|
|
|
-unmap_bus_range(struct pci_bus *bus);
|
|
|
+extern int unmap_bus_range(struct pci_bus *bus);
|
|
|
|
|
|
-extern int
|
|
|
-remap_bus_range(struct pci_bus *bus);
|
|
|
+extern int remap_bus_range(struct pci_bus *bus);
|
|
|
|
|
|
-extern void
|
|
|
-pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus);
|
|
|
+extern void pcibios_fixup_device_resources(struct pci_dev *dev,
|
|
|
+ struct pci_bus *bus);
|
|
|
|
|
|
extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
|
|
|
|
|
@@ -180,14 +236,12 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
|
|
|
unsigned long size,
|
|
|
pgprot_t prot);
|
|
|
|
|
|
-#ifdef CONFIG_PPC_MULTIPLATFORM
|
|
|
+#if defined(CONFIG_PPC_MULTIPLATFORM) || defined(CONFIG_PPC32)
|
|
|
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
|
|
|
extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
|
|
|
const struct resource *rsrc,
|
|
|
u64 *start, u64 *end);
|
|
|
-#endif /* CONFIG_PPC_MULTIPLATFORM */
|
|
|
-
|
|
|
+#endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */
|
|
|
|
|
|
#endif /* __KERNEL__ */
|
|
|
-
|
|
|
-#endif /* __PPC64_PCI_H */
|
|
|
+#endif /* __ASM_POWERPC_PCI_H */
|