From 923b553aaf737afdefd902429e219c612dad567f Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 11 Feb 2005 00:53:38 -0800 Subject: [PATCH] [PATCH] ppc32: Fix PCI2 support on MPC8555/41 CDS systems This fixes an issue related to the second PCI host controller working on MPC8555/41 systems. We track the last PCI bus number on PCI1 so that the PCI2 host controller can properly exclude itself at the right time, exclusion should occur after initial setup so that the early pci config cycles in setting PCI2 actually get to the controller. Signed-off-by: Kumar Gala Signed-off-by: Linus Torvalds --- arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 9 +++++---- arch/ppc/syslib/ppc85xx_setup.c | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index ebc4390a1926..a65eb0225d56 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c @@ -281,16 +281,17 @@ mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin) #define ARCADIA_HOST_BRIDGE_IDSEL 17 #define ARCADIA_2ND_BRIDGE_IDSEL 3 +extern int mpc85xx_pci1_last_busno; + int mpc85xx_exclude_device(u_char bus, u_char devfn) { if (bus == 0 && PCI_SLOT(devfn) == 0) return PCIBIOS_DEVICE_NOT_FOUND; #ifdef CONFIG_85xx_PCI2 - /* With the current code we know PCI2 will be bus 2, however this may - * not be guarnteed */ - if (bus == 2 && PCI_SLOT(devfn) == 0) - return PCIBIOS_DEVICE_NOT_FOUND; + if (mpc85xx_pci1_last_busno) + if (bus == (mpc85xx_pci1_last_busno + 1) && PCI_SLOT(devfn) == 0) + return PCIBIOS_DEVICE_NOT_FOUND; #endif /* We explicitly do not go past the Tundra 320 Bridge */ if (bus == 1) diff --git a/arch/ppc/syslib/ppc85xx_setup.c b/arch/ppc/syslib/ppc85xx_setup.c index 21243b8d9cac..81f1968c3269 100644 --- a/arch/ppc/syslib/ppc85xx_setup.c +++ b/arch/ppc/syslib/ppc85xx_setup.c @@ -243,6 +243,8 @@ mpc85xx_setup_pci2(struct pci_controller *hose) } #endif /* CONFIG_85xx_PCI2 */ +int mpc85xx_pci1_last_busno = 0; + void __init mpc85xx_setup_hose(void) { @@ -341,6 +343,9 @@ mpc85xx_setup_hose(void) IORESOURCE_IO, "PCI2 host bridge"); hose_b->last_busno = pciauto_bus_scan(hose_b, hose_b->first_busno); + + /* let board code know what the last bus number was on PCI1 */ + mpc85xx_pci1_last_busno = hose_a->last_busno; #endif return; } -- 2.39.5