diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-07-29 13:49:01 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-08-01 03:42:42 -0400 |
commit | 22ae782f86b726f9cea752c0f269ff6dcdf2f6e1 (patch) | |
tree | 9458a01b24d65fa2eab27ad5bdb2fa399b3c389f /arch/powerpc/include/asm | |
parent | 12b15e83289bc7cf2ec9a342412e0c955beeb395 (diff) |
of/address: Clean up function declarations
This patch moves the declaration of of_get_address(), of_get_pci_address(),
and of_pci_address_to_resource() out of arch code and into the common
linux/of_address header file.
This patch also fixes some of the asm/prom.h ordering issues. It still
includes some header files that it ideally shouldn't be, but at least the
ordering is consistent now so that of_* overrides work.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc/include/asm')
-rw-r--r-- | arch/powerpc/include/asm/prom.h | 49 |
1 files changed, 11 insertions, 38 deletions
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 55bccc0a21c3..ae26f2efd089 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -17,11 +17,6 @@ | |||
17 | * 2 of the License, or (at your option) any later version. | 17 | * 2 of the License, or (at your option) any later version. |
18 | */ | 18 | */ |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/of_fdt.h> | ||
21 | #include <linux/of_address.h> | ||
22 | #include <linux/of_irq.h> | ||
23 | #include <linux/proc_fs.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
26 | #include <asm/atomic.h> | 21 | #include <asm/atomic.h> |
27 | 22 | ||
@@ -49,41 +44,9 @@ extern void pci_create_OF_bus_map(void); | |||
49 | extern u64 of_translate_dma_address(struct device_node *dev, | 44 | extern u64 of_translate_dma_address(struct device_node *dev, |
50 | const u32 *in_addr); | 45 | const u32 *in_addr); |
51 | 46 | ||
52 | /* Extract an address from a device, returns the region size and | ||
53 | * the address space flags too. The PCI version uses a BAR number | ||
54 | * instead of an absolute index | ||
55 | */ | ||
56 | extern const u32 *of_get_address(struct device_node *dev, int index, | ||
57 | u64 *size, unsigned int *flags); | ||
58 | #ifdef CONFIG_PCI | ||
59 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
60 | u64 *size, unsigned int *flags); | ||
61 | #else | ||
62 | static inline const u32 *of_get_pci_address(struct device_node *dev, | ||
63 | int bar_no, u64 *size, unsigned int *flags) | ||
64 | { | ||
65 | return NULL; | ||
66 | } | ||
67 | #endif /* CONFIG_PCI */ | ||
68 | |||
69 | #ifdef CONFIG_PCI | ||
70 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
71 | struct resource *r); | ||
72 | #else | ||
73 | static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
74 | struct resource *r) | ||
75 | { | ||
76 | return -ENOSYS; | ||
77 | } | ||
78 | #endif /* CONFIG_PCI */ | ||
79 | |||
80 | #ifdef CONFIG_PCI | 47 | #ifdef CONFIG_PCI |
81 | extern unsigned long pci_address_to_pio(phys_addr_t address); | 48 | extern unsigned long pci_address_to_pio(phys_addr_t address); |
82 | #else | 49 | #define pci_address_to_pio pci_address_to_pio |
83 | static inline unsigned long pci_address_to_pio(phys_addr_t address) | ||
84 | { | ||
85 | return (unsigned long)-1; | ||
86 | } | ||
87 | #endif /* CONFIG_PCI */ | 50 | #endif /* CONFIG_PCI */ |
88 | 51 | ||
89 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and | 52 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and |
@@ -122,9 +85,19 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; } | |||
122 | * resolving using the OF tree walking. | 85 | * resolving using the OF tree walking. |
123 | */ | 86 | */ |
124 | struct pci_dev; | 87 | struct pci_dev; |
88 | struct of_irq; | ||
125 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); | 89 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
126 | 90 | ||
127 | extern void of_instantiate_rtc(void); | 91 | extern void of_instantiate_rtc(void); |
128 | 92 | ||
93 | /* These includes are put at the bottom because they may contain things | ||
94 | * that are overridden by this file. Ideally they shouldn't be included | ||
95 | * by this file, but there are a bunch of .c files that currently depend | ||
96 | * on it. Eventually they will be cleaned up. */ | ||
97 | #include <linux/of_fdt.h> | ||
98 | #include <linux/of_address.h> | ||
99 | #include <linux/of_irq.h> | ||
100 | #include <linux/platform_device.h> | ||
101 | |||
129 | #endif /* __KERNEL__ */ | 102 | #endif /* __KERNEL__ */ |
130 | #endif /* _POWERPC_PROM_H */ | 103 | #endif /* _POWERPC_PROM_H */ |