Usually, the property "ibm,opal-num-pes" of PHB dev-tree node
indicates the number of total PEs. If that property isn't existing
or valid, we should fall back to pick the correct number of total
PEs according to PHB type: IODA1 or IODA2.

Signed-off-by: Gavin Shan <[email protected]>
---
 arch/powerpc/platforms/powernv/pci-ioda.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c 
b/arch/powerpc/platforms/powernv/pci-ioda.c
index 829047b..6386bb4 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1172,11 +1172,14 @@ void __init pnv_pci_init_ioda_phb(struct device_node 
*np,
 
        /* Initialize more IODA stuff */
        prop32 = of_get_property(np, "ibm,opal-num-pes", NULL);
-       if (!prop32)
-               phb->ioda.total_pe = 1;
-       else
+       if (prop32)
                phb->ioda.total_pe = *prop32;
-
+       else if (phb->type == PNV_PHB_IODA1)
+               phb->ioda.total_pe = 128;
+       else if (phb->type == PNV_PHB_IODA2)
+               phb->ioda.total_pe = 256;
+       else
+               phb->ioda.total_pe = 1;
        phb->ioda.m32_size = resource_size(&hose->mem_resources[0]);
        /* FW Has already off top 64k of M32 space (MSI space) */
        phb->ioda.m32_size += 0x10000;
-- 
1.7.5.4

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to