diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-08-19 23:49:20 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-17 02:35:15 -0400 |
commit | c40a4210a4b55284a71ed52721d9894b5bdb1953 (patch) | |
tree | 62c667c822fe832e98f4e10682e928865720a839 /arch/powerpc/platforms | |
parent | e47747f479502cf5dc1f8043fbc7513a4dc8fd9f (diff) |
powerpc/powernv: Using PCI core to do resource assignment
Currently, the PCI probe flags "PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC"
used on powernv platform. That means the platform has to do the PCI
resource assignment by itself.
The patch changes the PCI probe flag to "PCI_REASSIGN_ALL_RSRC" so
that the PCI core will do the resource assignment. Also, the I/O
and MMIO minimal alignment for P2P bridges have been configured
while doing fixup for the PHBs.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Reviewed-by: Ram Pai <linuxram@us.ibm.com>
Reviewed-by: Richard Yang <weiyang@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.c | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 40559bf2b9ec..d65f84c87fbe 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -1123,36 +1123,6 @@ static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) | |||
1123 | static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { } | 1123 | static void pnv_pci_init_ioda_msis(struct pnv_phb *phb) { } |
1124 | #endif /* CONFIG_PCI_MSI */ | 1124 | #endif /* CONFIG_PCI_MSI */ |
1125 | 1125 | ||
1126 | /* This is the starting point of our IODA specific resource | ||
1127 | * allocation process | ||
1128 | */ | ||
1129 | static void __devinit pnv_pci_ioda_fixup_phb(struct pci_controller *hose) | ||
1130 | { | ||
1131 | resource_size_t size, align; | ||
1132 | struct pci_bus *child; | ||
1133 | |||
1134 | /* Associate PEs per functions */ | ||
1135 | pnv_ioda_setup_PEs(hose->bus); | ||
1136 | |||
1137 | /* Calculate all resources */ | ||
1138 | pnv_ioda_calc_bus(hose->bus, IORESOURCE_IO, &size, &align); | ||
1139 | pnv_ioda_calc_bus(hose->bus, IORESOURCE_MEM, &size, &align); | ||
1140 | |||
1141 | /* Apply then to HW */ | ||
1142 | pnv_ioda_update_resources(hose->bus); | ||
1143 | |||
1144 | /* Setup DMA */ | ||
1145 | pnv_ioda_setup_dma(hose->private_data); | ||
1146 | |||
1147 | /* Configure PCI Express settings */ | ||
1148 | list_for_each_entry(child, &hose->bus->children, node) { | ||
1149 | struct pci_dev *self = child->self; | ||
1150 | if (!self) | ||
1151 | continue; | ||
1152 | pcie_bus_configure_settings(child, self->pcie_mpss); | ||
1153 | } | ||
1154 | } | ||
1155 | |||
1156 | /* | 1126 | /* |
1157 | * This function is supposed to be called on basis of PE from top | 1127 | * This function is supposed to be called on basis of PE from top |
1158 | * to bottom style. So the the I/O or MMIO segment assigned to | 1128 | * to bottom style. So the the I/O or MMIO segment assigned to |
@@ -1473,16 +1443,17 @@ void __init pnv_pci_init_ioda1_phb(struct device_node *np) | |||
1473 | /* Setup MSI support */ | 1443 | /* Setup MSI support */ |
1474 | pnv_pci_init_ioda_msis(phb); | 1444 | pnv_pci_init_ioda_msis(phb); |
1475 | 1445 | ||
1476 | /* We set both PCI_PROBE_ONLY and PCI_REASSIGN_ALL_RSRC. This is an | 1446 | /* |
1477 | * odd combination which essentially means that we skip all resource | 1447 | * We pass the PCI probe flag PCI_REASSIGN_ALL_RSRC here |
1478 | * fixups and assignments in the generic code, and do it all | 1448 | * to let the PCI core do resource assignment. It's supposed |
1479 | * ourselves here | 1449 | * that the PCI core will do correct I/O and MMIO alignment |
1450 | * for the P2P bridge bars so that each PCI bus (excluding | ||
1451 | * the child P2P bridges) can form individual PE. | ||
1480 | */ | 1452 | */ |
1481 | ppc_md.pcibios_fixup_phb = pnv_pci_ioda_fixup_phb; | ||
1482 | ppc_md.pcibios_fixup = pnv_pci_ioda_fixup; | 1453 | ppc_md.pcibios_fixup = pnv_pci_ioda_fixup; |
1483 | ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook; | 1454 | ppc_md.pcibios_enable_device_hook = pnv_pci_enable_device_hook; |
1484 | ppc_md.pcibios_window_alignment = pnv_pci_window_alignment; | 1455 | ppc_md.pcibios_window_alignment = pnv_pci_window_alignment; |
1485 | pci_add_flags(PCI_PROBE_ONLY | PCI_REASSIGN_ALL_RSRC); | 1456 | pci_add_flags(PCI_REASSIGN_ALL_RSRC); |
1486 | 1457 | ||
1487 | /* Reset IODA tables to a clean state */ | 1458 | /* Reset IODA tables to a clean state */ |
1488 | rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET); | 1459 | rc = opal_pci_reset(phb_id, OPAL_PCI_IODA_TABLE_RESET, OPAL_ASSERT_RESET); |