aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/kernel
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-30 00:57:28 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:51:26 -0500
commitd2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (patch)
tree9c40a9ab9a04839f2d578f9d47985b399074ce58 /arch/ppc/kernel
parentbb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 (diff)
[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 'arch/ppc/kernel')
-rw-r--r--arch/ppc/kernel/pci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
index 0aa184112fb1..af364003880b 100644
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -1805,6 +1805,21 @@ void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
1805EXPORT_SYMBOL(pci_iomap); 1805EXPORT_SYMBOL(pci_iomap);
1806EXPORT_SYMBOL(pci_iounmap); 1806EXPORT_SYMBOL(pci_iounmap);
1807 1807
1808unsigned int pci_address_to_pio(phys_addr_t address)
1809{
1810 struct pci_controller* hose = hose_head;
1811
1812 for (; hose; hose = hose->next) {
1813 unsigned int size = hose->io_resource.end -
1814 hose->io_resource.start + 1;
1815 if (address >= hose->io_base_phys &&
1816 address < (hose->io_base_phys + size))
1817 return (unsigned int)hose->io_base_virt +
1818 (address - hose->io_base_phys);
1819 }
1820 return (unsigned int)-1;
1821}
1822EXPORT_SYMBOL(pci_address_to_pio);
1808 1823
1809/* 1824/*
1810 * Null PCI config access functions, for the case when we can't 1825 * Null PCI config access functions, for the case when we can't