[PATCH 2/3] move init_phb_dynamic() to pseries

John Rose johnrose at austin.ibm.com
Tue Mar 7 12:03:58 EST 2006


Since init_phb_dynamic() only comes into play during dynamic
partitioning on POWER systems, move it to pseries-specific file.  This
is also necessary for the addition of some pseries-specific fixups
during PHB creation.

Thanks-
John

Signed-off-by: John Rose <johnrose at austin.ibm.com>

diff -puN arch/powerpc/kernel/rtas_pci.c~move_init_phb_dyn arch/powerpc/kernel/rtas_pci.c
--- 2_6_p5/arch/powerpc/kernel/rtas_pci.c~move_init_phb_dyn	2006-03-03 15:43:03.000000000 -0600
+++ 2_6_p5-johnrose/arch/powerpc/kernel/rtas_pci.c	2006-03-03 15:43:03.000000000 -0600
@@ -280,8 +280,7 @@ static int phb_set_bus_ranges(struct dev
 	return 0;
 }
 
-static int __devinit setup_phb(struct device_node *dev,
-			       struct pci_controller *phb)
+int __devinit setup_phb(struct device_node *dev, struct pci_controller *phb)
 {
 	if (is_python(dev))
 		python_countermeasures(dev);
@@ -360,26 +359,6 @@ unsigned long __init find_and_init_phbs(
 	return 0;
 }
 
-struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
-{
-	struct pci_controller *phb;
-	int primary;
-
-	primary = list_empty(&hose_list);
-	phb = pcibios_alloc_controller(dn);
-	if (!phb)
-		return NULL;
-	setup_phb(dn, phb);
-
-	pci_setup_phb_io_dynamic(phb, primary);
-
-	pci_devs_phb_init_dynamic(phb);
-	scan_phb(phb);
-
-	return phb;
-}
-EXPORT_SYMBOL(init_phb_dynamic);
-
 /* RPA-specific bits for removing PHBs */
 int pcibios_remove_root_bus(struct pci_controller *phb)
 {
diff -puN arch/powerpc/kernel/pci_64.c~move_init_phb_dyn arch/powerpc/kernel/pci_64.c
diff -puN include/asm-powerpc/ppc-pci.h~move_init_phb_dyn include/asm-powerpc/ppc-pci.h
--- 2_6_p5/include/asm-powerpc/ppc-pci.h~move_init_phb_dyn	2006-03-03 15:43:03.000000000 -0600
+++ 2_6_p5-johnrose/include/asm-powerpc/ppc-pci.h	2006-03-03 15:43:03.000000000 -0600
@@ -38,6 +38,7 @@ void *traverse_pci_devices(struct device
 
 void pci_devs_phb_init(void);
 void pci_devs_phb_init_dynamic(struct pci_controller *phb);
+int setup_phb(struct device_node *dev, struct pci_controller *phb);
 void __devinit scan_phb(struct pci_controller *hose);
 
 /* From rtas_pci.h */
diff -puN arch/powerpc/platforms/pseries/pci_dlpar.c~move_init_phb_dyn arch/powerpc/platforms/pseries/pci_dlpar.c
--- 2_6_p5/arch/powerpc/platforms/pseries/pci_dlpar.c~move_init_phb_dyn	2006-03-03 15:43:03.000000000 -0600
+++ 2_6_p5-johnrose/arch/powerpc/platforms/pseries/pci_dlpar.c	2006-03-06 17:23:46.000000000 -0600
@@ -27,6 +27,7 @@
 
 #include <linux/pci.h>
 #include <asm/pci-bridge.h>
+#include <asm/ppc-pci.h>
 
 static struct pci_bus *
 find_bus_among_children(struct pci_bus *bus,
@@ -179,3 +180,23 @@ pcibios_add_pci_devices(struct pci_bus *
 	}
 }
 EXPORT_SYMBOL_GPL(pcibios_add_pci_devices);
+
+struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn)
+{
+	struct pci_controller *phb;
+	int primary;
+
+	primary = list_empty(&hose_list);
+	phb = pcibios_alloc_controller(dn);
+	if (!phb)
+		return NULL;
+	setup_phb(dn, phb);
+
+	pci_setup_phb_io_dynamic(phb, primary);
+
+	pci_devs_phb_init_dynamic(phb);
+	scan_phb(phb);
+
+	return phb;
+}
+EXPORT_SYMBOL_GPL(init_phb_dynamic);

_




More information about the Linuxppc64-dev mailing list