aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/prom.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc/prom.h')
-rw-r--r--include/asm-powerpc/prom.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index fb732c992bd2..73d27bad55fa 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -223,14 +223,36 @@ extern struct resource *request_OF_resource(struct device_node* node,
223 int index, const char* name_postfix); 223 int index, const char* name_postfix);
224extern int release_OF_resource(struct device_node* node, int index); 224extern int release_OF_resource(struct device_node* node, int index);
225 225
226
226/* 227/*
227 * Address translation function(s) 228 * OF address retreival & translation
229 */
230
231
232/* Translate an OF address block into a CPU physical address
228 */ 233 */
229#define OF_BAD_ADDR ((u64)-1) 234#define OF_BAD_ADDR ((u64)-1)
230extern u64 of_translate_address(struct device_node *np, u32 *addr); 235extern u64 of_translate_address(struct device_node *np, u32 *addr);
231extern u32 *of_get_address(struct device_node *dev, int index, u64 *size);
232extern u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size);
233 236
237/* Extract an address from a device, returns the region size and
238 * the address space flags too. The PCI version uses a BAR number
239 * instead of an absolute index
240 */
241extern u32 *of_get_address(struct device_node *dev, int index,
242 u64 *size, unsigned int *flags);
243extern u32 *of_get_pci_address(struct device_node *dev, int bar_no,
244 u64 *size, unsigned int *flags);
245
246/* Get an address as a resource. Note that if your address is
247 * a PIO address, the conversion will fail if the physical address
248 * can't be internally converted to an IO token with
249 * pci_address_to_pio(), that is because it's either called to early
250 * or it can't be matched to any host bridge IO space
251 */
252extern int of_address_to_resource(struct device_node *dev, int index,
253 struct resource *r);
254extern int of_pci_address_to_resource(struct device_node *dev, int bar,
255 struct resource *r);
234 256
235#endif /* __KERNEL__ */ 257#endif /* __KERNEL__ */
236#endif /* _POWERPC_PROM_H */ 258#endif /* _POWERPC_PROM_H */