diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-11-30 00:57:28 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 22:51:26 -0500 |
commit | d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (patch) | |
tree | 9c40a9ab9a04839f2d578f9d47985b399074ce58 /arch/powerpc/kernel/pci_64.c | |
parent | bb6b9b28d6847bc71f910e2e82c9040ff4b97ec0 (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/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 5f241fcd88e8..0988222741f0 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -1181,6 +1181,20 @@ void phbs_remap_io(void) | |||
1181 | remap_bus_range(hose->bus); | 1181 | remap_bus_range(hose->bus); |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | unsigned int pci_address_to_pio(phys_addr_t address) | ||
1185 | { | ||
1186 | struct pci_controller *hose, *tmp; | ||
1187 | |||
1188 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { | ||
1189 | if (address >= hose->io_base_phys && | ||
1190 | address < (hose->io_base_phys + hose->pci_io_size)) | ||
1191 | return (unsigned int)hose->io_base_virt + | ||
1192 | (address - hose->io_base_phys); | ||
1193 | } | ||
1194 | return (unsigned int)-1; | ||
1195 | } | ||
1196 | EXPORT_SYMBOL_GPL(pci_address_to_pio); | ||
1197 | |||
1184 | static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) | 1198 | static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev) |
1185 | { | 1199 | { |
1186 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 1200 | struct pci_controller *hose = pci_bus_to_host(dev->bus); |