diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/pci.h (renamed from include/asm-ppc64/pci.h) | 110 | ||||
-rw-r--r-- | include/asm-powerpc/ppc-pci.h | 2 |
2 files changed, 82 insertions, 30 deletions
diff --git a/include/asm-ppc64/pci.h b/include/asm-powerpc/pci.h index fafdf885a3cc..d5934a076bd0 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-powerpc/pci.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __PPC64_PCI_H | 1 | #ifndef __ASM_POWERPC_PCI_H |
2 | #define __PPC64_PCI_H | 2 | #define __ASM_POWERPC_PCI_H |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | /* | 5 | /* |
@@ -18,6 +18,7 @@ | |||
18 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | #include <asm/prom.h> | 20 | #include <asm/prom.h> |
21 | #include <asm/pci-bridge.h> | ||
21 | 22 | ||
22 | #include <asm-generic/pci-dma-compat.h> | 23 | #include <asm-generic/pci-dma-compat.h> |
23 | 24 | ||
@@ -26,11 +27,21 @@ | |||
26 | 27 | ||
27 | struct pci_dev; | 28 | struct pci_dev; |
28 | 29 | ||
29 | #ifdef CONFIG_PPC_ISERIES | 30 | /* Values for the `which' argument to sys_pciconfig_iobase syscall. */ |
31 | #define IOBASE_BRIDGE_NUMBER 0 | ||
32 | #define IOBASE_MEMORY 1 | ||
33 | #define IOBASE_IO 2 | ||
34 | #define IOBASE_ISA_IO 3 | ||
35 | #define IOBASE_ISA_MEM 4 | ||
36 | |||
37 | /* | ||
38 | * Set this to 1 if you want the kernel to re-assign all PCI | ||
39 | * bus numbers | ||
40 | */ | ||
41 | extern int pci_assign_all_buses; | ||
42 | #define pcibios_assign_all_busses() (pci_assign_all_buses) | ||
43 | |||
30 | #define pcibios_scan_all_fns(a, b) 0 | 44 | #define pcibios_scan_all_fns(a, b) 0 |
31 | #else | ||
32 | extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn); | ||
33 | #endif | ||
34 | 45 | ||
35 | static inline void pcibios_set_master(struct pci_dev *dev) | 46 | static inline void pcibios_set_master(struct pci_dev *dev) |
36 | { | 47 | { |
@@ -50,6 +61,7 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) | |||
50 | return channel ? 15 : 14; | 61 | return channel ? 15 : 14; |
51 | } | 62 | } |
52 | 63 | ||
64 | #ifdef CONFIG_PPC64 | ||
53 | #define HAVE_ARCH_PCI_MWI 1 | 65 | #define HAVE_ARCH_PCI_MWI 1 |
54 | static inline int pcibios_prep_mwi(struct pci_dev *dev) | 66 | static inline int pcibios_prep_mwi(struct pci_dev *dev) |
55 | { | 67 | { |
@@ -64,12 +76,10 @@ static inline int pcibios_prep_mwi(struct pci_dev *dev) | |||
64 | return 0; | 76 | return 0; |
65 | } | 77 | } |
66 | 78 | ||
67 | extern unsigned int pcibios_assign_all_busses(void); | ||
68 | |||
69 | extern struct dma_mapping_ops pci_dma_ops; | 79 | extern struct dma_mapping_ops pci_dma_ops; |
70 | 80 | ||
71 | /* For DAC DMA, we currently don't support it by default, but | 81 | /* For DAC DMA, we currently don't support it by default, but |
72 | * we let the platform override this | 82 | * we let 64-bit platforms override this. |
73 | */ | 83 | */ |
74 | static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask) | 84 | static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask) |
75 | { | 85 | { |
@@ -102,6 +112,35 @@ extern int pci_domain_nr(struct pci_bus *bus); | |||
102 | /* Decide whether to display the domain number in /proc */ | 112 | /* Decide whether to display the domain number in /proc */ |
103 | extern int pci_proc_domain(struct pci_bus *bus); | 113 | extern int pci_proc_domain(struct pci_bus *bus); |
104 | 114 | ||
115 | #else /* 32-bit */ | ||
116 | |||
117 | #ifdef CONFIG_PCI | ||
118 | static inline void pci_dma_burst_advice(struct pci_dev *pdev, | ||
119 | enum pci_dma_burst_strategy *strat, | ||
120 | unsigned long *strategy_parameter) | ||
121 | { | ||
122 | *strat = PCI_DMA_BURST_INFINITY; | ||
123 | *strategy_parameter = ~0UL; | ||
124 | } | ||
125 | #endif | ||
126 | |||
127 | /* | ||
128 | * At present there are very few 32-bit PPC machines that can have | ||
129 | * memory above the 4GB point, and we don't support that. | ||
130 | */ | ||
131 | #define pci_dac_dma_supported(pci_dev, mask) (0) | ||
132 | |||
133 | /* Return the index of the PCI controller for device PDEV. */ | ||
134 | #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index | ||
135 | |||
136 | /* Set the name of the bus as it appears in /proc/bus/pci */ | ||
137 | static inline int pci_proc_domain(struct pci_bus *bus) | ||
138 | { | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | #endif /* CONFIG_PPC64 */ | ||
143 | |||
105 | struct vm_area_struct; | 144 | struct vm_area_struct; |
106 | /* Map a range of PCI memory or I/O space for a device into user space */ | 145 | /* Map a range of PCI memory or I/O space for a device into user space */ |
107 | int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | 146 | 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, | |||
110 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ | 149 | /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ |
111 | #define HAVE_PCI_MMAP 1 | 150 | #define HAVE_PCI_MMAP 1 |
112 | 151 | ||
152 | #ifdef CONFIG_PPC64 | ||
113 | /* pci_unmap_{single,page} is not a nop, thus... */ | 153 | /* pci_unmap_{single,page} is not a nop, thus... */ |
114 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ | 154 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \ |
115 | dma_addr_t ADDR_NAME; | 155 | dma_addr_t ADDR_NAME; |
@@ -124,22 +164,40 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, | |||
124 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ | 164 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \ |
125 | (((PTR)->LEN_NAME) = (VAL)) | 165 | (((PTR)->LEN_NAME) = (VAL)) |
126 | 166 | ||
127 | /* The PCI address space does equal the physical memory | 167 | /* The PCI address space does not equal the physical memory address |
128 | * address space. The networking and block device layers use | 168 | * space (we have an IOMMU). The IDE and SCSI device layers use |
129 | * this boolean for bounce buffer decisions. | 169 | * this boolean for bounce buffer decisions. |
130 | */ | 170 | */ |
131 | #define PCI_DMA_BUS_IS_PHYS (0) | 171 | #define PCI_DMA_BUS_IS_PHYS (0) |
172 | |||
173 | #else /* 32-bit */ | ||
174 | |||
175 | /* The PCI address space does equal the physical memory | ||
176 | * address space (no IOMMU). The IDE and SCSI device layers use | ||
177 | * this boolean for bounce buffer decisions. | ||
178 | */ | ||
179 | #define PCI_DMA_BUS_IS_PHYS (1) | ||
180 | |||
181 | /* pci_unmap_{page,single} is a nop so... */ | ||
182 | #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) | ||
183 | #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) | ||
184 | #define pci_unmap_addr(PTR, ADDR_NAME) (0) | ||
185 | #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0) | ||
186 | #define pci_unmap_len(PTR, LEN_NAME) (0) | ||
187 | #define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) | ||
188 | |||
189 | #endif /* CONFIG_PPC64 */ | ||
132 | 190 | ||
133 | extern void | 191 | extern void pcibios_resource_to_bus(struct pci_dev *dev, |
134 | pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, | 192 | struct pci_bus_region *region, |
135 | struct resource *res); | 193 | struct resource *res); |
136 | 194 | ||
137 | extern void | 195 | extern void pcibios_bus_to_resource(struct pci_dev *dev, |
138 | pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, | 196 | struct resource *res, |
139 | struct pci_bus_region *region); | 197 | struct pci_bus_region *region); |
140 | 198 | ||
141 | static inline struct resource * | 199 | static inline struct resource *pcibios_select_root(struct pci_dev *pdev, |
142 | pcibios_select_root(struct pci_dev *pdev, struct resource *res) | 200 | struct resource *res) |
143 | { | 201 | { |
144 | struct resource *root = NULL; | 202 | struct resource *root = NULL; |
145 | 203 | ||
@@ -151,14 +209,12 @@ pcibios_select_root(struct pci_dev *pdev, struct resource *res) | |||
151 | return root; | 209 | return root; |
152 | } | 210 | } |
153 | 211 | ||
154 | extern int | 212 | extern int unmap_bus_range(struct pci_bus *bus); |
155 | unmap_bus_range(struct pci_bus *bus); | ||
156 | 213 | ||
157 | extern int | 214 | extern int remap_bus_range(struct pci_bus *bus); |
158 | remap_bus_range(struct pci_bus *bus); | ||
159 | 215 | ||
160 | extern void | 216 | extern void pcibios_fixup_device_resources(struct pci_dev *dev, |
161 | pcibios_fixup_device_resources(struct pci_dev *dev, struct pci_bus *bus); | 217 | struct pci_bus *bus); |
162 | 218 | ||
163 | extern struct pci_controller *init_phb_dynamic(struct device_node *dn); | 219 | extern struct pci_controller *init_phb_dynamic(struct device_node *dn); |
164 | 220 | ||
@@ -180,14 +236,12 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, | |||
180 | unsigned long size, | 236 | unsigned long size, |
181 | pgprot_t prot); | 237 | pgprot_t prot); |
182 | 238 | ||
183 | #ifdef CONFIG_PPC_MULTIPLATFORM | 239 | #if defined(CONFIG_PPC_MULTIPLATFORM) || defined(CONFIG_PPC32) |
184 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | 240 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
185 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, | 241 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, |
186 | const struct resource *rsrc, | 242 | const struct resource *rsrc, |
187 | u64 *start, u64 *end); | 243 | u64 *start, u64 *end); |
188 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 244 | #endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */ |
189 | |||
190 | 245 | ||
191 | #endif /* __KERNEL__ */ | 246 | #endif /* __KERNEL__ */ |
192 | 247 | #endif /* __ASM_POWERPC_PCI_H */ | |
193 | #endif /* __PPC64_PCI_H */ | ||
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h index 2e36e5a7f4f3..36cdc869e580 100644 --- a/include/asm-powerpc/ppc-pci.h +++ b/include/asm-powerpc/ppc-pci.h | |||
@@ -48,8 +48,6 @@ extern void pSeries_final_fixup(void); | |||
48 | extern void pSeries_irq_bus_setup(struct pci_bus *bus); | 48 | extern void pSeries_irq_bus_setup(struct pci_bus *bus); |
49 | 49 | ||
50 | extern unsigned long pci_probe_only; | 50 | extern unsigned long pci_probe_only; |
51 | extern unsigned long pci_assign_all_buses; | ||
52 | extern int pci_read_irq_line(struct pci_dev *pci_dev); | ||
53 | 51 | ||
54 | /* ---- EEH internal-use-only related routines ---- */ | 52 | /* ---- EEH internal-use-only related routines ---- */ |
55 | #ifdef CONFIG_EEH | 53 | #ifdef CONFIG_EEH |