aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-06-22 01:29:46 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-06-29 02:57:29 -0400
commit5229ee185287f4fd0d7809e6554b40ec83a4ba6c (patch)
treed256a3ede9fad13c47bdb7f04e1c005b83186c5b
parent7d52c7b0cd46f42ae2c9df37f1a385d9aaf95842 (diff)
[POWERPC] Remove hack to determine the 2nd PHBs bus number
Now that we have the pci_controller in the exclude function we can easy figure out if the bus number is the PHB or not. The old style of using a variable setup at init time was actually broken and would only work in specific cases. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--arch/powerpc/platforms/83xx/pci.c8
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c7
-rw-r--r--arch/powerpc/platforms/85xx/pci.c3
3 files changed, 2 insertions, 16 deletions
diff --git a/arch/powerpc/platforms/83xx/pci.c b/arch/powerpc/platforms/83xx/pci.c
index f92e71f2ed6b..8da935c6e269 100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
@@ -33,15 +33,10 @@
33#define DBG(x...) 33#define DBG(x...)
34#endif 34#endif
35 35
36int mpc83xx_pci2_busno;
37
38int mpc83xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) 36int mpc83xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn)
39{ 37{
40 if (bus == 0 && PCI_SLOT(devfn) == 0) 38 if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
41 return PCIBIOS_DEVICE_NOT_FOUND; 39 return PCIBIOS_DEVICE_NOT_FOUND;
42 if (mpc83xx_pci2_busno)
43 if (bus == (mpc83xx_pci2_busno) && PCI_SLOT(devfn) == 0)
44 return PCIBIOS_DEVICE_NOT_FOUND;
45 return PCIBIOS_SUCCESSFUL; 40 return PCIBIOS_SUCCESSFUL;
46} 41}
47 42
@@ -86,7 +81,6 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
86 setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384); 81 setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
87 primary = 0; 82 primary = 0;
88 hose->bus_offset = hose->first_busno; 83 hose->bus_offset = hose->first_busno;
89 mpc83xx_pci2_busno = hose->first_busno;
90 } 84 }
91 85
92 printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. " 86 printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. "
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index fcea5ab5eb77..04a1eaa81bbe 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -55,16 +55,11 @@ static volatile u8 *cadmus;
55#define ARCADIA_HOST_BRIDGE_IDSEL 17 55#define ARCADIA_HOST_BRIDGE_IDSEL 17
56#define ARCADIA_2ND_BRIDGE_IDSEL 3 56#define ARCADIA_2ND_BRIDGE_IDSEL 3
57 57
58extern int mpc85xx_pci2_busno;
59
60static int mpc85xx_exclude_device(struct pci_controller *hose, 58static int mpc85xx_exclude_device(struct pci_controller *hose,
61 u_char bus, u_char devfn) 59 u_char bus, u_char devfn)
62{ 60{
63 if (bus == 0 && PCI_SLOT(devfn) == 0) 61 if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
64 return PCIBIOS_DEVICE_NOT_FOUND; 62 return PCIBIOS_DEVICE_NOT_FOUND;
65 if (mpc85xx_pci2_busno)
66 if (bus == (mpc85xx_pci2_busno) && PCI_SLOT(devfn) == 0)
67 return PCIBIOS_DEVICE_NOT_FOUND;
68 /* We explicitly do not go past the Tundra 320 Bridge */ 63 /* We explicitly do not go past the Tundra 320 Bridge */
69 if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL)) 64 if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
70 return PCIBIOS_DEVICE_NOT_FOUND; 65 return PCIBIOS_DEVICE_NOT_FOUND;
diff --git a/arch/powerpc/platforms/85xx/pci.c b/arch/powerpc/platforms/85xx/pci.c
index 72a1bc5e0c2d..be67f67ee6f4 100644
--- a/arch/powerpc/platforms/85xx/pci.c
+++ b/arch/powerpc/platforms/85xx/pci.c
@@ -33,8 +33,6 @@
33#define DBG(x...) 33#define DBG(x...)
34#endif 34#endif
35 35
36int mpc85xx_pci2_busno = 0;
37
38#ifdef CONFIG_PCI 36#ifdef CONFIG_PCI
39int __init mpc85xx_add_bridge(struct device_node *dev) 37int __init mpc85xx_add_bridge(struct device_node *dev)
40{ 38{
@@ -74,7 +72,6 @@ int __init mpc85xx_add_bridge(struct device_node *dev)
74 setup_indirect_pci(hose, immr + 0x9000, immr + 0x9004); 72 setup_indirect_pci(hose, immr + 0x9000, immr + 0x9004);
75 primary = 0; 73 primary = 0;
76 hose->bus_offset = hose->first_busno; 74 hose->bus_offset = hose->first_busno;
77 mpc85xx_pci2_busno = hose->first_busno;
78 } 75 }
79 76
80 printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. " 77 printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. "