linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] powerpc/pci: Add a platform hook after probe and before resource survey
@ 2011-11-07  4:55 Benjamin Herrenschmidt
  2011-11-07  4:55 ` [PATCH 2/5] powerpc/pci: Change how re-assigning resouces work Benjamin Herrenschmidt
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2011-11-07  4:55 UTC (permalink / raw)
  To: linuxppc-dev

Some platforms need to perform resource allocation using a custom algorithm
due to HW constraints, or may want to tweak things globally below a host
bridge. For example OPAL support for IODA will need to perform a
resource allocation pass that applies IODA specific segmentation
constraints to MMIO which cannot be done simply using the kernel generic
resource management code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/include/asm/machdep.h |    3 +++
 arch/powerpc/kernel/pci-common.c   |    6 ++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 58fc216..505bc21 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -212,6 +212,9 @@ struct machdep_calls {
 	 * allow assignment/enabling of the device. */
 	int  (*pcibios_enable_device_hook)(struct pci_dev *);
 
+	/* Called after scan and before resource survey */
+	void (*pcibios_fixup_phb)(struct pci_controller *hose);
+
 	/* Called to shutdown machine specific hardware not already controlled
 	 * by other drivers.
 	 */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 677eccc..855969f 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1731,6 +1731,12 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
 	if (mode == PCI_PROBE_NORMAL)
 		hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
 
+	/* Platform gets a chance to do some global fixups before
+	 * we proceed to resource allocation
+	 */
+	if (ppc_md.pcibios_fixup_phb)
+		ppc_md.pcibios_fixup_phb(hose);
+
 	/* Configure PCI Express settings */
 	if (bus && !pci_has_flag(PCI_PROBE_ONLY)) {
 		struct pci_bus *child;
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-11-07  5:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07  4:55 [PATCH 1/5] powerpc/pci: Add a platform hook after probe and before resource survey Benjamin Herrenschmidt
2011-11-07  4:55 ` [PATCH 2/5] powerpc/pci: Change how re-assigning resouces work Benjamin Herrenschmidt
2011-11-07  5:01   ` Benjamin Herrenschmidt
2011-11-07  4:55 ` [PATCH 3/5] powerpc/powernv: Add TCE SW invalidation support Benjamin Herrenschmidt
2011-11-07  4:56 ` [PATCH 4/5] powerpc/powernv: Fixup p7ioc PCIe root complex class code Benjamin Herrenschmidt
2011-11-07  4:56 ` [PATCH 5/5] powerpc/powernv: PCI support for p7IOC under OPAL v2 Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).