Commit eecba334 authored by Stephen Rothwell's avatar Stephen Rothwell

[POWERPC] modify PCI code for a merged kernel

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
parent de0138da
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/ppc-pci.h> #include <asm/ppc-pci.h>
#include <asm/firmware.h>
#ifdef DEBUG #ifdef DEBUG
#include <asm/udbg.h> #include <asm/udbg.h>
...@@ -209,7 +210,6 @@ void pcibios_free_controller(struct pci_controller *phb) ...@@ -209,7 +210,6 @@ void pcibios_free_controller(struct pci_controller *phb)
kfree(phb); kfree(phb);
} }
#ifndef CONFIG_PPC_ISERIES
void __devinit pcibios_claim_one_bus(struct pci_bus *b) void __devinit pcibios_claim_one_bus(struct pci_bus *b)
{ {
struct pci_dev *dev; struct pci_dev *dev;
...@@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setup(void) ...@@ -238,10 +238,12 @@ static void __init pcibios_claim_of_setup(void)
{ {
struct pci_bus *b; struct pci_bus *b;
if (firmware_has_feature(FW_FEATURE_ISERIES))
return;
list_for_each_entry(b, &pci_root_buses, node) list_for_each_entry(b, &pci_root_buses, node)
pcibios_claim_one_bus(b); pcibios_claim_one_bus(b);
} }
#endif
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_MULTIPLATFORM
static u32 get_int_prop(struct device_node *np, const char *name, u32 def) static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
...@@ -554,9 +556,8 @@ static int __init pcibios_init(void) ...@@ -554,9 +556,8 @@ static int __init pcibios_init(void)
*/ */
ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot; ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
#ifdef CONFIG_PPC_ISERIES if (firmware_has_feature(FW_FEATURE_ISERIES))
iSeries_pcibios_init(); iSeries_pcibios_init();
#endif
printk(KERN_DEBUG "PCI: Probing PCI hardware\n"); printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
...@@ -566,15 +567,15 @@ static int __init pcibios_init(void) ...@@ -566,15 +567,15 @@ static int __init pcibios_init(void)
pci_bus_add_devices(hose->bus); pci_bus_add_devices(hose->bus);
} }
#ifndef CONFIG_PPC_ISERIES if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
if (pci_probe_only) if (pci_probe_only)
pcibios_claim_of_setup(); pcibios_claim_of_setup();
else else
/* FIXME: `else' will be removed when /* FIXME: `else' will be removed when
pci_assign_unassigned_resources() is able to work pci_assign_unassigned_resources() is able to work
correctly with [partially] allocated PCI tree. */ correctly with [partially] allocated PCI tree. */
pci_assign_unassigned_resources(); pci_assign_unassigned_resources();
#endif /* !CONFIG_PPC_ISERIES */ }
/* Call machine dependent final fixup */ /* Call machine dependent final fixup */
if (ppc_md.pcibios_fixup) if (ppc_md.pcibios_fixup)
...@@ -586,8 +587,9 @@ static int __init pcibios_init(void) ...@@ -586,8 +587,9 @@ static int __init pcibios_init(void)
printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev)); printk(KERN_DEBUG "ISA bridge at %s\n", pci_name(ppc64_isabridge_dev));
#ifdef CONFIG_PPC_MULTIPLATFORM #ifdef CONFIG_PPC_MULTIPLATFORM
/* map in PCI I/O space */ if (!firmware_has_feature(FW_FEATURE_ISERIES))
phbs_remap_io(); /* map in PCI I/O space */
phbs_remap_io();
#endif #endif
printk(KERN_DEBUG "PCI: Probing PCI hardware done\n"); printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
...@@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) ...@@ -637,13 +639,13 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
*/ */
int pci_domain_nr(struct pci_bus *bus) int pci_domain_nr(struct pci_bus *bus)
{ {
#ifdef CONFIG_PPC_ISERIES if (firmware_has_feature(FW_FEATURE_ISERIES))
return 0; return 0;
#else else {
struct pci_controller *hose = pci_bus_to_host(bus); struct pci_controller *hose = pci_bus_to_host(bus);
return hose->global_number; return hose->global_number;
#endif }
} }
EXPORT_SYMBOL(pci_domain_nr); EXPORT_SYMBOL(pci_domain_nr);
...@@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr); ...@@ -651,12 +653,12 @@ EXPORT_SYMBOL(pci_domain_nr);
/* Decide whether to display the domain number in /proc */ /* Decide whether to display the domain number in /proc */
int pci_proc_domain(struct pci_bus *bus) int pci_proc_domain(struct pci_bus *bus)
{ {
#ifdef CONFIG_PPC_ISERIES if (firmware_has_feature(FW_FEATURE_ISERIES))
return 0; return 0;
#else else {
struct pci_controller *hose = pci_bus_to_host(bus); struct pci_controller *hose = pci_bus_to_host(bus);
return hose->buid; return hose->buid;
#endif }
} }
/* /*
......
...@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void) ...@@ -262,10 +262,6 @@ void __init iSeries_pci_final_fixup(void)
mf_display_src(0xC9000200); mf_display_src(0xC9000200);
} }
void pcibios_fixup_bus(struct pci_bus *PciBus)
{
}
void pcibios_fixup_resources(struct pci_dev *pdev) void pcibios_fixup_resources(struct pci_dev *pdev)
{ {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment