aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/prom.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-09 13:03:44 -0500
commit6150c32589d1976ca8a5c987df951088c05a7542 (patch)
tree94073696576323ff966e365d8c47b8ecd8372f97 /include/asm-powerpc/prom.h
parent44637a12f80b80157d9c1bc5b7d6ef09c9e05713 (diff)
parentbe42d5fa3772241b8ecebd443f1fb36247959c54 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
Diffstat (limited to 'include/asm-powerpc/prom.h')
-rw-r--r--include/asm-powerpc/prom.h71
1 files changed, 31 insertions, 40 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index f999df1c5c90..329e9bf62260 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -65,49 +65,11 @@ struct boot_param_header
65typedef u32 phandle; 65typedef u32 phandle;
66typedef u32 ihandle; 66typedef u32 ihandle;
67 67
68struct address_range {
69 unsigned long space;
70 unsigned long address;
71 unsigned long size;
72};
73
74struct interrupt_info { 68struct interrupt_info {
75 int line; 69 int line;
76 int sense; /* +ve/-ve logic, edge or level, etc. */ 70 int sense; /* +ve/-ve logic, edge or level, etc. */
77}; 71};
78 72
79struct pci_address {
80 u32 a_hi;
81 u32 a_mid;
82 u32 a_lo;
83};
84
85struct isa_address {
86 u32 a_hi;
87 u32 a_lo;
88};
89
90struct isa_range {
91 struct isa_address isa_addr;
92 struct pci_address pci_addr;
93 unsigned int size;
94};
95
96struct reg_property {
97 unsigned long address;
98 unsigned long size;
99};
100
101struct reg_property32 {
102 unsigned int address;
103 unsigned int size;
104};
105
106struct reg_property64 {
107 u64 address;
108 u64 size;
109};
110
111struct property { 73struct property {
112 char *name; 74 char *name;
113 int length; 75 int length;
@@ -120,8 +82,6 @@ struct device_node {
120 char *type; 82 char *type;
121 phandle node; 83 phandle node;
122 phandle linux_phandle; 84 phandle linux_phandle;
123 int n_addrs;
124 struct address_range *addrs;
125 int n_intrs; 85 int n_intrs;
126 struct interrupt_info *intrs; 86 struct interrupt_info *intrs;
127 char *full_name; 87 char *full_name;
@@ -223,5 +183,36 @@ extern struct resource *request_OF_resource(struct device_node* node,
223 int index, const char* name_postfix); 183 int index, const char* name_postfix);
224extern int release_OF_resource(struct device_node* node, int index); 184extern int release_OF_resource(struct device_node* node, int index);
225 185
186
187/*
188 * OF address retreival & translation
189 */
190
191
192/* Translate an OF address block into a CPU physical address
193 */
194#define OF_BAD_ADDR ((u64)-1)
195extern u64 of_translate_address(struct device_node *np, u32 *addr);
196
197/* Extract an address from a device, returns the region size and
198 * the address space flags too. The PCI version uses a BAR number
199 * instead of an absolute index
200 */
201extern u32 *of_get_address(struct device_node *dev, int index,
202 u64 *size, unsigned int *flags);
203extern u32 *of_get_pci_address(struct device_node *dev, int bar_no,
204 u64 *size, unsigned int *flags);
205
206/* Get an address as a resource. Note that if your address is
207 * a PIO address, the conversion will fail if the physical address
208 * can't be internally converted to an IO token with
209 * pci_address_to_pio(), that is because it's either called to early
210 * or it can't be matched to any host bridge IO space
211 */
212extern int of_address_to_resource(struct device_node *dev, int index,
213 struct resource *r);
214extern int of_pci_address_to_resource(struct device_node *dev, int bar,
215 struct resource *r);
216
226#endif /* __KERNEL__ */ 217#endif /* __KERNEL__ */
227#endif /* _POWERPC_PROM_H */ 218#endif /* _POWERPC_PROM_H */