aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorGavin Shan <shangw@linux.vnet.ibm.com>2013-07-31 04:47:01 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 00:57:25 -0400
commitf1b7cc3ec1ed9fe684872b248b166280650c4976 (patch)
treed61a4e4480fffacb50abe09cf04f613003cabfa2 /arch/powerpc/platforms
parent58d714ec7a73bfdf0780862d7e79302e084d49ca (diff)
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')
-rw-r--r--arch/powerpc/platforms/powernv/pci-ioda.c13
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,
1109 unsigned long size, m32map_off, iomap_off, pemap_off; 1109 unsigned long size, m32map_off, iomap_off, pemap_off;
1110 const u64 *prop64; 1110 const u64 *prop64;
1111 const u32 *prop32; 1111 const u32 *prop32;
1112 int len;
1112 u64 phb_id; 1113 u64 phb_id;
1113 void *aux; 1114 void *aux;
1114 long rc; 1115 long rc;
@@ -1140,9 +1141,15 @@ void __init pnv_pci_init_ioda_phb(struct device_node *np,
1140 } 1141 }
1141 1142
1142 spin_lock_init(&phb->lock); 1143 spin_lock_init(&phb->lock);
1143 /* XXX Use device-tree */ 1144 prop32 = of_get_property(np, "bus-range", &len);
1144 hose->first_busno = 0; 1145 if (prop32 && len == 8) {
1145 hose->last_busno = 0xff; 1146 hose->first_busno = prop32[0];
1147 hose->last_busno = prop32[1];
1148 } else {
1149 pr_warn(" Broken <bus-range> on %s\n", np->full_name);
1150 hose->first_busno = 0;
1151 hose->last_busno = 0xff;
1152 }
1146 hose->private_data = phb; 1153 hose->private_data = phb;
1147 phb->hub_id = hub_id; 1154 phb->hub_id = hub_id;
1148 phb->opal_id = phb_id; 1155 phb->opal_id = phb_id;