aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-07-19 16:29:53 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-07-23 11:27:08 -0400
commit6c0a11c118471f79795202348fbd0e6580341794 (patch)
tree3fdd1b450e32203703ef56a3f1e6666c472312a1
parent66afe8780f297edb4c4716bc326e127ec2923422 (diff)
[POWERPC] Fixup resources on pci_bus for PCIe PHB when no device is connected
On the 85xx/86xx PCIe controllers if there is no device connected to the PHB we will still allocate a pci_bus for downstream bus of the virtual P2P bridge. However the resources allocated to the downstream bus are not correct and so we just mimic the resources from the upstream pci_bus. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c1
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c2
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c14
-rw-r--r--arch/powerpc/sysdev/fsl_pci.h1
4 files changed, 17 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 2539bb560694..9b559ebc66f8 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -272,4 +272,5 @@ define_machine(mpc85xx_cds) {
272 .restart = mpc85xx_restart, 272 .restart = mpc85xx_restart,
273 .calibrate_decr = generic_calibrate_decr, 273 .calibrate_decr = generic_calibrate_decr,
274 .progress = udbg_progress, 274 .progress = udbg_progress,
275 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
275}; 276};
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index e67e10d3272f..e9eaa0749ae6 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -431,7 +431,6 @@ mpc86xx_time_init(void)
431 return 0; 431 return 0;
432} 432}
433 433
434
435define_machine(mpc86xx_hpcn) { 434define_machine(mpc86xx_hpcn) {
436 .name = "MPC86xx HPCN", 435 .name = "MPC86xx HPCN",
437 .probe = mpc86xx_hpcn_probe, 436 .probe = mpc86xx_hpcn_probe,
@@ -443,4 +442,5 @@ define_machine(mpc86xx_hpcn) {
443 .time_init = mpc86xx_time_init, 442 .time_init = mpc86xx_time_init,
444 .calibrate_decr = generic_calibrate_decr, 443 .calibrate_decr = generic_calibrate_decr,
445 .progress = udbg_progress, 444 .progress = udbg_progress,
445 .pcibios_fixup_bus = fsl_pcibios_fixup_bus,
446}; 446};
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 2eefcde5b0da..faafae601a72 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -142,6 +142,20 @@ int __init fsl_pcie_check_link(struct pci_controller *hose)
142 return 0; 142 return 0;
143} 143}
144 144
145void fsl_pcibios_fixup_bus(struct pci_bus *bus)
146{
147 struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
148 int i;
149
150 /* deal with bogus pci_bus when we don't have anything connected on PCIe */
151 if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
152 if (bus->parent) {
153 for (i = 0; i < 4; ++i)
154 bus->resource[i] = bus->parent->resource[i];
155 }
156 }
157}
158
145int __init fsl_add_bridge(struct device_node *dev, int is_primary) 159int __init fsl_add_bridge(struct device_node *dev, int is_primary)
146{ 160{
147 int len; 161 int len;
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index 700d47827994..37b04ad26571 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -82,6 +82,7 @@ struct ccsr_pci {
82}; 82};
83 83
84extern int fsl_add_bridge(struct device_node *dev, int is_primary); 84extern int fsl_add_bridge(struct device_node *dev, int is_primary);
85extern void fsl_pcibios_fixup_bus(struct pci_bus *bus);
85 86
86#endif /* __POWERPC_FSL_PCI_H */ 87#endif /* __POWERPC_FSL_PCI_H */
87#endif /* __KERNEL__ */ 88#endif /* __KERNEL__ */