[RFC/PATCH 9/12] powerpc: Make find_and_init_phbs() work in a combined kernel
Michael Ellerman
michael at ellerman.id.au
Tue Jan 17 14:22:41 EST 2006
We currently build two version of find_and_init_pubs(), that won't work in
a combined kernel. This is a bit ugly at present, we could make it a ppc_md
function if necessary.
arch/powerpc/kernel/pci_64.c | 8 ++++++++
arch/powerpc/kernel/rtas_pci.c | 2 +-
arch/powerpc/platforms/iseries/pci.c | 13 +++++--------
include/asm-powerpc/ppc-pci.h | 2 ++
4 files changed, 16 insertions(+), 9 deletions(-)
Index: linux/arch/powerpc/kernel/pci_64.c
===================================================================
--- linux.orig/arch/powerpc/kernel/pci_64.c
+++ linux/arch/powerpc/kernel/pci_64.c
@@ -1444,3 +1444,11 @@ long sys_pciconfig_iobase(long which, un
return -EOPNOTSUPP;
}
+
+unsigned long find_and_init_phbs(void)
+{
+ if (firmware_has_feature(FW_FEATURE_ISERIES))
+ return iseries_find_and_init_phbs();
+ else
+ return rtas_find_and_init_phbs();
+}
Index: linux/arch/powerpc/kernel/rtas_pci.c
===================================================================
--- linux.orig/arch/powerpc/kernel/rtas_pci.c
+++ linux/arch/powerpc/kernel/rtas_pci.c
@@ -295,7 +295,7 @@ static int __devinit setup_phb(struct de
return 0;
}
-unsigned long __init find_and_init_phbs(void)
+unsigned long __init rtas_find_and_init_phbs(void)
{
struct device_node *node;
struct pci_controller *phb;
Index: linux/arch/powerpc/platforms/iseries/pci.c
===================================================================
--- linux.orig/arch/powerpc/platforms/iseries/pci.c
+++ linux/arch/powerpc/platforms/iseries/pci.c
@@ -226,15 +226,12 @@ static struct device_node *build_device_
}
/*
- * unsigned long __init find_and_init_phbs(void)
- *
- * Description:
- * This function checks for all possible system PCI host bridges that connect
- * PCI buses. The system hypervisor is queried as to the guest partition
- * ownership status. A pci_controller is built for any bus which is partially
- * owned or fully owned by this guest partition.
+ * This function checks for all possible system PCI host bridges that connect
+ * PCI buses. The system hypervisor is queried as to the guest partition
+ * ownership status. A pci_controller is built for any bus which is partially
+ * owned or fully owned by this guest partition.
*/
-unsigned long __init find_and_init_phbs(void)
+unsigned long __init iseries_find_and_init_phbs(void)
{
struct pci_controller *phb;
HvBusNumber bus;
Index: linux/include/asm-powerpc/ppc-pci.h
===================================================================
--- linux.orig/include/asm-powerpc/ppc-pci.h
+++ linux/include/asm-powerpc/ppc-pci.h
@@ -23,6 +23,8 @@ extern struct list_head hose_list;
extern int global_phb_number;
extern unsigned long find_and_init_phbs(void);
+extern unsigned long iseries_find_and_init_phbs(void);
+extern unsigned long rtas_find_and_init_phbs(void);
extern struct pci_dev *ppc64_isabridge_dev; /* may be NULL if no ISA bus */
More information about the Linuxppc64-dev
mailing list