diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2013-07-31 10:47:01 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-14 06:57:25 +0200 |
commit | f1b7cc3ec1ed9fe684872b248b166280650c4976 (patch) | |
tree | d61a4e4480fffacb50abe09cf04f613003cabfa2 /arch/powerpc/platforms/powernv/pci-ioda.c | |
parent | powerpc/powernv: Free PHB instance upon error (diff) | |
download | linux-f1b7cc3ec1ed9fe684872b248b166280650c4976.tar.xz linux-f1b7cc3ec1ed9fe684872b248b166280650c4976.zip |
powerpc/powernv: Fetch PHB bus range from dev-tree
The patch enables fetching bus range from device-tree for the
specific PHB. If we can't get that from device-tree, the default
range [0 255] will be used.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci-ioda.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/pci-ioda.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 9cccdc7007d4..f472228148cc 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -1109,6 +1109,7 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, unsigned long size, m32map_off, iomap_off, pemap_off; const u64 *prop64; const u32 *prop32; + int len; u64 phb_id; void *aux; long rc; @@ -1140,9 +1141,15 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np, } spin_lock_init(&phb->lock); - /* XXX Use device-tree */ - hose->first_busno = 0; - hose->last_busno = 0xff; + prop32 = of_get_property(np, "bus-range", &len); + if (prop32 && len == 8) { + hose->first_busno = prop32[0]; + hose->last_busno = prop32[1]; + } else { + pr_warn(" Broken <bus-range> on %s\n", np->full_name); + hose->first_busno = 0; + hose->last_busno = 0xff; + } hose->private_data = phb; phb->hub_id = hub_id; phb->opal_id = phb_id; |