aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-09-07 15:07:11 -0400
committerRob Herring <rob.herring@calxeda.com>2013-10-09 21:04:06 -0400
commit25ff79443cbfa924b8df1d4a8a0fbff83816938a (patch)
treee7a9ac5cb39449b55d132c0838f7d866bc7d703c
parentba904f0649357a3cbd67e752d30898c42b1fc91a (diff)
of: implement pci_address_to_pio as weak function
Implement pci_address_to_pio as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@linaro.org> Cc: Michal Simek <monstr@monstr.eu> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Cc: Grant Likely <grant.likely@linaro.org>
-rw-r--r--arch/microblaze/include/asm/prom.h9
-rw-r--r--arch/mips/include/asm/prom.h11
-rw-r--r--arch/powerpc/include/asm/prom.h5
-rw-r--r--arch/x86/include/asm/prom.h3
-rw-r--r--arch/x86/kernel/devicetree.c10
-rw-r--r--drivers/of/address.c8
-rw-r--r--drivers/of/of_pci.c1
-rw-r--r--include/linux/of_address.h5
8 files changed, 9 insertions, 43 deletions
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index f05bedce70d0..0ebd924902df 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -26,13 +26,4 @@ enum early_consoles {
26 26
27extern int of_early_console(void *version); 27extern int of_early_console(void *version);
28 28
29/*
30 * OF address retreival & translation
31 */
32
33#ifdef CONFIG_PCI
34extern unsigned long pci_address_to_pio(phys_addr_t address);
35#define pci_address_to_pio pci_address_to_pio
36#endif /* CONFIG_PCI */
37
38#endif /* _ASM_MICROBLAZE_PROM_H */ 29#endif /* _ASM_MICROBLAZE_PROM_H */
diff --git a/arch/mips/include/asm/prom.h b/arch/mips/include/asm/prom.h
index e3dbd0e0608e..ccd2b75f152c 100644
--- a/arch/mips/include/asm/prom.h
+++ b/arch/mips/include/asm/prom.h
@@ -19,17 +19,6 @@
19 19
20extern void device_tree_init(void); 20extern void device_tree_init(void);
21 21
22static inline unsigned long pci_address_to_pio(phys_addr_t address)
23{
24 /*
25 * The ioport address can be directly used by inX() / outX()
26 */
27 BUG_ON(address > IO_SPACE_LIMIT);
28
29 return (unsigned long) address;
30}
31#define pci_address_to_pio pci_address_to_pio
32
33struct boot_param_header; 22struct boot_param_header;
34 23
35extern void __dt_setup_arch(struct boot_param_header *bph); 24extern void __dt_setup_arch(struct boot_param_header *bph);
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 7d0c7f3a7171..bd215f74df0f 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -30,11 +30,6 @@
30extern u64 of_translate_dma_address(struct device_node *dev, 30extern u64 of_translate_dma_address(struct device_node *dev,
31 const __be32 *in_addr); 31 const __be32 *in_addr);
32 32
33#ifdef CONFIG_PCI
34extern unsigned long pci_address_to_pio(phys_addr_t address);
35#define pci_address_to_pio pci_address_to_pio
36#endif /* CONFIG_PCI */
37
38/* Parse the ibm,dma-window property of an OF node into the busno, phys and 33/* Parse the ibm,dma-window property of an OF node into the busno, phys and
39 * size parameters. 34 * size parameters.
40 */ 35 */
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index bade6ac3b14f..8ef2ec70858f 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -39,9 +39,6 @@ static inline void x86_dtb_init(void) { }
39 39
40extern char cmd_line[COMMAND_LINE_SIZE]; 40extern char cmd_line[COMMAND_LINE_SIZE];
41 41
42#define pci_address_to_pio pci_address_to_pio
43unsigned long pci_address_to_pio(phys_addr_t addr);
44
45#define HAVE_ARCH_DEVTREE_FIXUPS 42#define HAVE_ARCH_DEVTREE_FIXUPS
46 43
47#endif /* __ASSEMBLY__ */ 44#endif /* __ASSEMBLY__ */
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 679d676a30d7..cffd07368547 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -27,16 +27,6 @@ char __initdata cmd_line[COMMAND_LINE_SIZE];
27 27
28int __initdata of_ioapic; 28int __initdata of_ioapic;
29 29
30unsigned long pci_address_to_pio(phys_addr_t address)
31{
32 /*
33 * The ioport address can be directly used by inX / outX
34 */
35 BUG_ON(address >= (1 << 16));
36 return (unsigned long)address;
37}
38EXPORT_SYMBOL_GPL(pci_address_to_pio);
39
40void __init early_init_dt_scan_chosen_arch(unsigned long node) 30void __init early_init_dt_scan_chosen_arch(unsigned long node)
41{ 31{
42 BUG(); 32 BUG();
diff --git a/drivers/of/address.c b/drivers/of/address.c
index b55c21890760..556a7fb6ead3 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -626,6 +626,14 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size,
626} 626}
627EXPORT_SYMBOL(of_get_address); 627EXPORT_SYMBOL(of_get_address);
628 628
629unsigned long __weak pci_address_to_pio(phys_addr_t address)
630{
631 if (address > IO_SPACE_LIMIT)
632 return (unsigned long)-1;
633
634 return (unsigned long) address;
635}
636
629static int __of_address_to_resource(struct device_node *dev, 637static int __of_address_to_resource(struct device_node *dev,
630 const __be32 *addrp, u64 size, unsigned int flags, 638 const __be32 *addrp, u64 size, unsigned int flags,
631 const char *name, struct resource *r) 639 const char *name, struct resource *r)
diff --git a/drivers/of/of_pci.c b/drivers/of/of_pci.c
index e5ca00893c0c..848199633798 100644
--- a/drivers/of/of_pci.c
+++ b/drivers/of/of_pci.c
@@ -2,7 +2,6 @@
2#include <linux/export.h> 2#include <linux/export.h>
3#include <linux/of.h> 3#include <linux/of.h>
4#include <linux/of_pci.h> 4#include <linux/of_pci.h>
5#include <asm/prom.h>
6 5
7static inline int __of_pci_pci_compare(struct device_node *node, 6static inline int __of_pci_pci_compare(struct device_node *node,
8 unsigned int data) 7 unsigned int data)
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 4c2e6f26432c..f6fc6899ceae 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -52,10 +52,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
52extern const __be32 *of_get_address(struct device_node *dev, int index, 52extern const __be32 *of_get_address(struct device_node *dev, int index,
53 u64 *size, unsigned int *flags); 53 u64 *size, unsigned int *flags);
54 54
55#ifndef pci_address_to_pio 55extern unsigned long pci_address_to_pio(phys_addr_t addr);
56static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
57#define pci_address_to_pio pci_address_to_pio
58#endif
59 56
60extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, 57extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
61 struct device_node *node); 58 struct device_node *node);