diff options
author | Colin Cross <ccross@android.com> | 2012-02-21 12:45:05 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2012-02-21 12:45:05 -0800 |
commit | fbd94b86e411e6ea0b4fa56682120b32af5c16c2 (patch) | |
tree | 59f59602de610bddfad66e294cb42ee1d1f29d31 /arch/powerpc/sysdev/fsl_pci.c | |
parent | 293f64abe6006f6ff1cc6f672e27729ff7b74ead (diff) | |
parent | b01543dfe67bb1d191998e90d20534dc354de059 (diff) |
Merge commit 'v3.3-rc4' into android-3.3
Conflicts:
drivers/mmc/core/sdio.c
drivers/staging/android/Kconfig
drivers/staging/android/lowmemorykiller.c
Change-Id: I39ef9b27bb9febaee811b200ccac0ed5d51147f3
Diffstat (limited to 'arch/powerpc/sysdev/fsl_pci.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_pci.c | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 30eb17ecad4..6073288fed2 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -385,26 +385,36 @@ static void __init setup_pci_cmd(struct pci_controller *hose) void fsl_pcibios_fixup_bus(struct pci_bus *bus) { struct pci_controller *hose = pci_bus_to_host(bus); - int i; - - if ((bus->parent == hose->bus) && - ((fsl_pcie_bus_fixup && - early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) || - (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK))) - { - for (i = 0; i < 4; ++i) { + int i, is_pcie = 0, no_link; + + /* The root complex bridge comes up with bogus resources, + * we copy the PHB ones in. + * + * With the current generic PCI code, the PHB bus no longer + * has bus->resource[0..4] set, so things are a bit more + * tricky. + */ + + if (fsl_pcie_bus_fixup) + is_pcie = early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP); + no_link = !!(hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK); + + if (bus->parent == hose->bus && (is_pcie || no_link)) { + for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; ++i) { struct resource *res = bus->resource[i]; - struct resource *par = bus->parent->resource[i]; - if (res) { - res->start = 0; - res->end = 0; - res->flags = 0; - } - if (res && par) { - res->start = par->start; - res->end = par->end; - res->flags = par->flags; - } + struct resource *par; + + if (!res) + continue; + if (i == 0) + par = &hose->io_resource; + else if (i < 4) + par = &hose->mem_resources[i-1]; + else par = NULL; + + res->start = par ? par->start : 0; + res->end = par ? par->end : 0; + res->flags = par ? par->flags : 0; } } } |