diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-30 16:57:28 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-09 14:51:26 +1100 |
commit | d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (patch) | |
tree | 9c40a9ab9a04839f2d578f9d47985b399074ce58 /include/asm-ppc/prom.h | |
parent | bb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 (diff) | |
download | op-kernel-dev-d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c.zip op-kernel-dev-d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c.tar.gz |
[PATCH] powerpc: Update OF address parsers
This updates the OF address parsers to return the IO flags
indicating the type of address obtained. It also adds a PCI
call for converting physical addresses that hit IO space into
into IO tokens, and add routines that return the translated
addresses into struct resource
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc/prom.h')
-rw-r--r-- | include/asm-ppc/prom.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h index a10a2d6..eb317a0 100644 --- a/include/asm-ppc/prom.h +++ b/include/asm-ppc/prom.h @@ -138,12 +138,34 @@ extern unsigned long sub_reloc_offset(unsigned long); /* - * Address translation function(s) + * OF address retreival & translation + */ + + +/* Translate an OF address block into a CPU physical address */ #define OF_BAD_ADDR ((u64)-1) extern u64 of_translate_address(struct device_node *np, u32 *addr); -extern u32 *of_get_address(struct device_node *dev, int index, u64 *size); -extern u32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size); + +/* Extract an address from a device, returns the region size and + * the address space flags too. The PCI version uses a BAR number + * instead of an absolute index + */ +extern u32 *of_get_address(struct device_node *dev, int index, + u64 *size, unsigned int *flags); +extern u32 *of_get_pci_address(struct device_node *dev, int bar_no, + u64 *size, unsigned int *flags); + +/* Get an address as a resource. Note that if your address is + * a PIO address, the conversion will fail if the physical address + * can't be internally converted to an IO token with + * pci_address_to_pio(), that is because it's either called to early + * or it can't be matched to any host bridge IO space + */ +extern int of_address_to_resource(struct device_node *dev, int index, + struct resource *r); +extern int of_pci_address_to_resource(struct device_node *dev, int bar, + struct resource *r); #endif /* _PPC_PROM_H */ |