aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2009-08-25 12:20:45 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-28 00:24:15 -0400
commit89c2dd62a389c5fed07c4b13c906c43214fc7491 (patch)
treef36a94c317f9731d303d0bed029fbd6b267930b7 /arch/powerpc/include
parentfbe65447197789a3ccccc27755956f6a4c445089 (diff)
powerpc/pci: Pull ppc32 PCI features into common
Some of the PCI features we have in ppc32 we will need on ppc64 platforms in the future. These include support for: * ppc_md.pci_exclude_device * indirect config cycles * early config cycles We also simplified the logic in fake_pci_bus() to assume it will always get a valid pci_controller. Since all current callers seem to pass it one. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/machdep.h6
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h35
2 files changed, 19 insertions, 22 deletions
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 11d1fc3a8962..9efa2be78331 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -209,14 +209,14 @@ struct machdep_calls {
209 /* 209 /*
210 * optional PCI "hooks" 210 * optional PCI "hooks"
211 */ 211 */
212 /* Called in indirect_* to avoid touching devices */
213 int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
214
215 /* Called at then very end of pcibios_init() */ 212 /* Called at then very end of pcibios_init() */
216 void (*pcibios_after_init)(void); 213 void (*pcibios_after_init)(void);
217 214
218#endif /* CONFIG_PPC32 */ 215#endif /* CONFIG_PPC32 */
219 216
217 /* Called in indirect_* to avoid touching devices */
218 int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
219
220 /* Called after PPC generic resource fixup to perform 220 /* Called after PPC generic resource fixup to perform
221 machine specific fixups */ 221 machine specific fixups */
222 void (*pcibios_fixup_resources)(struct pci_dev *); 222 void (*pcibios_fixup_resources)(struct pci_dev *);
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 3faf575f6b06..76e1f313a58e 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -77,9 +77,7 @@ struct pci_controller {
77 77
78 int first_busno; 78 int first_busno;
79 int last_busno; 79 int last_busno;
80#ifndef CONFIG_PPC64
81 int self_busno; 80 int self_busno;
82#endif
83 81
84 void __iomem *io_base_virt; 82 void __iomem *io_base_virt;
85#ifdef CONFIG_PPC64 83#ifdef CONFIG_PPC64
@@ -104,7 +102,6 @@ struct pci_controller {
104 unsigned int __iomem *cfg_addr; 102 unsigned int __iomem *cfg_addr;
105 void __iomem *cfg_data; 103 void __iomem *cfg_data;
106 104
107#ifndef CONFIG_PPC64
108 /* 105 /*
109 * Used for variants of PCI indirect handling and possible quirks: 106 * Used for variants of PCI indirect handling and possible quirks:
110 * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1 107 * SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
@@ -128,7 +125,6 @@ struct pci_controller {
128#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010 125#define PPC_INDIRECT_TYPE_BIG_ENDIAN 0x00000010
129#define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020 126#define PPC_INDIRECT_TYPE_BROKEN_MRM 0x00000020
130 u32 indirect_type; 127 u32 indirect_type;
131#endif /* !CONFIG_PPC64 */
132 /* Currently, we limit ourselves to 1 IO range and 3 mem 128 /* Currently, we limit ourselves to 1 IO range and 3 mem
133 * ranges since the common pci_bus structure can't handle more 129 * ranges since the common pci_bus structure can't handle more
134 */ 130 */
@@ -146,21 +142,6 @@ struct pci_controller {
146#endif /* CONFIG_PPC64 */ 142#endif /* CONFIG_PPC64 */
147}; 143};
148 144
149#ifndef CONFIG_PPC64
150
151static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
152{
153 return bus->sysdata;
154}
155
156static inline int isa_vaddr_is_ioport(void __iomem *address)
157{
158 /* No specific ISA handling on ppc32 at this stage, it
159 * all goes through PCI
160 */
161 return 0;
162}
163
164/* These are used for config access before all the PCI probing 145/* These are used for config access before all the PCI probing
165 has been done. */ 146 has been done. */
166extern int early_read_config_byte(struct pci_controller *hose, int bus, 147extern int early_read_config_byte(struct pci_controller *hose, int bus,
@@ -182,6 +163,22 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
182extern void setup_indirect_pci(struct pci_controller* hose, 163extern void setup_indirect_pci(struct pci_controller* hose,
183 resource_size_t cfg_addr, 164 resource_size_t cfg_addr,
184 resource_size_t cfg_data, u32 flags); 165 resource_size_t cfg_data, u32 flags);
166
167#ifndef CONFIG_PPC64
168
169static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
170{
171 return bus->sysdata;
172}
173
174static inline int isa_vaddr_is_ioport(void __iomem *address)
175{
176 /* No specific ISA handling on ppc32 at this stage, it
177 * all goes through PCI
178 */
179 return 0;
180}
181
185#else /* CONFIG_PPC64 */ 182#else /* CONFIG_PPC64 */
186 183
187/* 184/*