aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/pci/pci.c17
-rw-r--r--include/asm-mips/pci.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 8a5b52250bda..a8d499b0a36f 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -292,8 +292,25 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
292 region->end = res->end - offset; 292 region->end = res->end - offset;
293} 293}
294 294
295void __devinit
296pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
297 struct pci_bus_region *region)
298{
299 struct pci_controller *hose = (struct pci_controller *)dev->sysdata;
300 unsigned long offset = 0;
301
302 if (res->flags & IORESOURCE_IO)
303 offset = hose->io_offset;
304 else if (res->flags & IORESOURCE_MEM)
305 offset = hose->mem_offset;
306
307 res->start = region->start + offset;
308 res->end = region->end + offset;
309}
310
295#ifdef CONFIG_HOTPLUG 311#ifdef CONFIG_HOTPLUG
296EXPORT_SYMBOL(pcibios_resource_to_bus); 312EXPORT_SYMBOL(pcibios_resource_to_bus);
313EXPORT_SYMBOL(pcibios_bus_to_resource);
297EXPORT_SYMBOL(PCIBIOS_MIN_IO); 314EXPORT_SYMBOL(PCIBIOS_MIN_IO);
298EXPORT_SYMBOL(PCIBIOS_MIN_MEM); 315EXPORT_SYMBOL(PCIBIOS_MIN_MEM);
299#endif 316#endif
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index 049f01f648ed..c9a00ca1c012 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -142,6 +142,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
142 142
143extern void pcibios_resource_to_bus(struct pci_dev *dev, 143extern void pcibios_resource_to_bus(struct pci_dev *dev,
144 struct pci_bus_region *region, struct resource *res); 144 struct pci_bus_region *region, struct resource *res);
145extern void pcibios_bus_to_resource(struct pci_dev *dev,
146 struct resource *res, struct pci_bus_region *region);
145 147
146#ifdef CONFIG_PCI_DOMAINS 148#ifdef CONFIG_PCI_DOMAINS
147 149