Commit bd42440a authored by Paul Mackerras's avatar Paul Mackerras

PPC32: Make a ppc32 version of pcibios_resource_to_bus, which adds

an offset where needed.
parent d99c48c6
...@@ -176,6 +176,21 @@ pcibios_fixup_cardbus(struct pci_dev* dev) ...@@ -176,6 +176,21 @@ pcibios_fixup_cardbus(struct pci_dev* dev)
} }
#endif /* CONFIG_ALL_PPC */ #endif /* CONFIG_ALL_PPC */
void
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
struct resource *res)
{
unsigned long offset = 0;
struct pci_controller *hose = dev->sysdata;
if (hose && res->flags & IORESOURCE_IO)
offset = (unsigned long)hose->io_base_virt - isa_io_base;
else if (hose && res->flags & IORESOURCE_MEM)
offset = hose->pci_mem_offset;
region->start = res->start - offset;
region->end = res->end - offset;
}
/* /*
* We need to avoid collisions with `mirrored' VGA ports * We need to avoid collisions with `mirrored' VGA ports
* and other strange ISA hardware, so we always want the * and other strange ISA hardware, so we always want the
...@@ -579,9 +594,11 @@ pcibios_assign_resources(void) ...@@ -579,9 +594,11 @@ pcibios_assign_resources(void)
*/ */
if ((r->flags & IORESOURCE_UNSET) && r->end && if ((r->flags & IORESOURCE_UNSET) && r->end &&
(!ppc_md.pcibios_enable_device_hook || (!ppc_md.pcibios_enable_device_hook ||
!ppc_md.pcibios_enable_device_hook(dev, 1))) !ppc_md.pcibios_enable_device_hook(dev, 1))) {
r->flags &= ~IORESOURCE_UNSET;
pci_assign_resource(dev, idx); pci_assign_resource(dev, idx);
} }
}
#if 0 /* don't assign ROMs */ #if 0 /* don't assign ROMs */
r = &dev->resource[PCI_ROM_RESOURCE]; r = &dev->resource[PCI_ROM_RESOURCE];
......
...@@ -271,9 +271,10 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma, ...@@ -271,9 +271,10 @@ int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */ /* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
#define HAVE_PCI_MMAP 1 #define HAVE_PCI_MMAP 1
#endif /* __KERNEL__ */ extern void
pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
struct resource *res);
/* generic pci stuff */ #endif /* __KERNEL__ */
#include <asm-generic/pci.h>
#endif /* __PPC_PCI_H */ #endif /* __PPC_PCI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment