aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-06-08 09:48:09 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-05 18:14:26 -0400
commit1f5bef30cf6c66f097ea5dfc580a41924df888d1 (patch)
tree345d9db4b6b20de814599cb7129005abd945ceea /arch/powerpc/include/asm
parent6b884a8d50a6eea2fb3dad7befe748f67193073b (diff)
of/address: merge of_address_to_resource()
Merge common code between PowerPC and Microblaze. This patch also moves the prototype of pci_address_to_pio() out of pci-bridge.h and into prom.h because the only user of pci_address_to_pio() is of_address_to_resource(). Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Michal Simek <monstr@monstr.eu> CC: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h5
-rw-r--r--arch/powerpc/include/asm/prom.h17
2 files changed, 9 insertions, 13 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 76e1f313a58e..51e9e6f90d12 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -303,13 +303,8 @@ extern void pcibios_free_controller(struct pci_controller *phb);
303extern void pcibios_setup_phb_resources(struct pci_controller *hose); 303extern void pcibios_setup_phb_resources(struct pci_controller *hose);
304 304
305#ifdef CONFIG_PCI 305#ifdef CONFIG_PCI
306extern unsigned long pci_address_to_pio(phys_addr_t address);
307extern int pcibios_vaddr_is_ioport(void __iomem *address); 306extern int pcibios_vaddr_is_ioport(void __iomem *address);
308#else 307#else
309static inline unsigned long pci_address_to_pio(phys_addr_t address)
310{
311 return (unsigned long)-1;
312}
313static inline int pcibios_vaddr_is_ioport(void __iomem *address) 308static inline int pcibios_vaddr_is_ioport(void __iomem *address)
314{ 309{
315 return 0; 310 return 0;
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 0abe379c6f33..ceace966c51c 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -70,14 +70,6 @@ static inline const u32 *of_get_pci_address(struct device_node *dev,
70} 70}
71#endif /* CONFIG_PCI */ 71#endif /* CONFIG_PCI */
72 72
73/* Get an address as a resource. Note that if your address is
74 * a PIO address, the conversion will fail if the physical address
75 * can't be internally converted to an IO token with
76 * pci_address_to_pio(), that is because it's either called to early
77 * or it can't be matched to any host bridge IO space
78 */
79extern int of_address_to_resource(struct device_node *dev, int index,
80 struct resource *r);
81#ifdef CONFIG_PCI 73#ifdef CONFIG_PCI
82extern int of_pci_address_to_resource(struct device_node *dev, int bar, 74extern int of_pci_address_to_resource(struct device_node *dev, int bar,
83 struct resource *r); 75 struct resource *r);
@@ -89,6 +81,15 @@ static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
89} 81}
90#endif /* CONFIG_PCI */ 82#endif /* CONFIG_PCI */
91 83
84#ifdef CONFIG_PCI
85extern unsigned long pci_address_to_pio(phys_addr_t address);
86#else
87static inline unsigned long pci_address_to_pio(phys_addr_t address)
88{
89 return (unsigned long)-1;
90}
91#endif /* CONFIG_PCI */
92
92/* Parse the ibm,dma-window property of an OF node into the busno, phys and 93/* Parse the ibm,dma-window property of an OF node into the busno, phys and
93 * size parameters. 94 * size parameters.
94 */ 95 */