Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294791
b: refs/heads/master
c: 38973ba
h: refs/heads/master
i:
  294789: 6cfe3dd
  294787: 78576f8
  294783: 696bf24
v: v3
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Mar 20, 2012
1 parent 8805be7 commit 8b2e0dd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d85c6d97d3d2601332f8250f06738cdeb4da71d2
refs/heads/master: 38973ba7903fa0660a31b2bdc50ff711ec8d08c9
1 change: 1 addition & 0 deletions trunk/arch/powerpc/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
resource_size_t *start, resource_size_t *end);

extern resource_size_t pcibios_io_space_offset(struct pci_controller *hose);
extern void pcibios_setup_bus_devices(struct pci_bus *bus);
extern void pcibios_setup_bus_self(struct pci_bus *bus);
extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,11 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
return pci_enable_resources(dev, mask);
}

resource_size_t pcibios_io_space_offset(struct pci_controller *hose)
{
return (unsigned long) hose->io_base_virt - _IO_BASE;
}

static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, struct list_head *resources)
{
struct resource *res;
Expand All @@ -1516,8 +1521,7 @@ static void __devinit pcibios_setup_phb_resources(struct pci_controller *hose, s
(unsigned long long)res->start,
(unsigned long long)res->end,
(unsigned long)res->flags);
pci_add_resource_offset(resources, res,
(resource_size_t) hose->io_base_virt - _IO_BASE);
pci_add_resource_offset(resources, res, pcibios_io_space_offset(hose));

/* Hookup PHB Memory resources */
for (i = 0; i < 3; ++i) {
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ void __devinit pcibios_setup_phb_io_space(struct pci_controller *hose)
struct resource *res = &hose->io_resource;

/* Fixup IO space offset */
io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
res->start = (res->start + io_offset) & 0xffffffffu;
res->end = (res->end + io_offset) & 0xffffffffu;
io_offset = pcibios_io_space_offset(hose);
res->start += io_offset;
res->end += io_offset;
}

static int __init pcibios_init(void)
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static int __devinit pcibios_map_phb_io_space(struct pci_controller *hose)
return -ENOMEM;

/* Fixup hose IO resource */
io_virt_offset = (unsigned long)hose->io_base_virt - _IO_BASE;
io_virt_offset = pcibios_io_space_offset(hose);
hose->io_resource.start += io_virt_offset;
hose->io_resource.end += io_virt_offset;

Expand Down

0 comments on commit 8b2e0dd

Please sign in to comment.