diff options
author | Yinghai Lu <yinghai@kernel.org> | 2017-04-21 08:04:48 +0300 |
---|---|---|
committer | Bjorn Helgaas <helgaas@kernel.org> | 2018-02-16 00:07:30 +0300 |
commit | b4a304489ef95b6b921d1faa46438d9ea89cfd4b (patch) | |
tree | f6105882b0c7a6404faa37eea5c82fa90f0a030f /arch/sparc/kernel/pci.c | |
parent | 7928b2cbe55b2a410a0f5c1f154610059c57b1b2 (diff) | |
download | linux-b4a304489ef95b6b921d1faa46438d9ea89cfd4b.tar.xz |
sparc/PCI: Support arbitrary host bridge address offset
Add support for arbitrary bus address offset. Previously we ignored the
child (PCI) address in the "ranges" property and assumed it was always
zero. That means every host bridge window mapped to PCI bus address zero,
e.g.,
pci_bus 0000:00: root bus resource [mem 0x2000000000000-0x200007fffffff] (bus address [0x00000000-0x7fffffff])
But some systems have host bridge windows with non-zero child addresses, so
parse the child address and compute the offset between the parent (CPU) and
child (PCI) addresses. This allows windows like these:
/pci@305: PCI MEM [mem 0x2000000100000-0x200007effffff] offset 2000000000000
pci_sun4v f02ae7f8: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [mem 0x2000000100000-0x200007effffff] (bus address [0x00100000-0x7effffff])
[bhelgaas: changelog]
Tested-by: Khalid Aziz <khalid.aziz@oracle.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Diffstat (limited to 'arch/sparc/kernel/pci.c')
-rw-r--r-- | arch/sparc/kernel/pci.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 220d0f36560a..41b20edb427d 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c @@ -664,12 +664,12 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, printk("PCI: Scanning PBM %s\n", node->full_name); pci_add_resource_offset(&resources, &pbm->io_space, - pbm->io_space.start); + pbm->io_offset); pci_add_resource_offset(&resources, &pbm->mem_space, - pbm->mem_space.start); + pbm->mem_offset); if (pbm->mem64_space.flags) pci_add_resource_offset(&resources, &pbm->mem64_space, - pbm->mem_space.start); + pbm->mem64_offset); pbm->busn.start = pbm->pci_first_busno; pbm->busn.end = pbm->pci_last_busno; pbm->busn.flags = IORESOURCE_BUS; |