Commit 5229ee18 authored by Kumar Gala's avatar Kumar Gala

[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: default avatarKumar Gala <galak@kernel.crashing.org>
parent 7d52c7b0
...@@ -33,14 +33,9 @@ ...@@ -33,14 +33,9 @@
#define DBG(x...) #define DBG(x...)
#endif #endif
int mpc83xx_pci2_busno;
int mpc83xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn) int mpc83xx_exclude_device(struct pci_controller *hose, u_char bus, u_char devfn)
{ {
if (bus == 0 && PCI_SLOT(devfn) == 0) if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
return PCIBIOS_DEVICE_NOT_FOUND;
if (mpc83xx_pci2_busno)
if (bus == (mpc83xx_pci2_busno) && PCI_SLOT(devfn) == 0)
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
return PCIBIOS_SUCCESSFUL; return PCIBIOS_SUCCESSFUL;
} }
...@@ -86,7 +81,6 @@ int __init mpc83xx_add_bridge(struct device_node *dev) ...@@ -86,7 +81,6 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384); setup_indirect_pci(hose, immr + 0x8380, immr + 0x8384);
primary = 0; primary = 0;
hose->bus_offset = hose->first_busno; hose->bus_offset = hose->first_busno;
mpc83xx_pci2_busno = hose->first_busno;
} }
printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. " printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. "
......
...@@ -55,15 +55,10 @@ static volatile u8 *cadmus; ...@@ -55,15 +55,10 @@ static volatile u8 *cadmus;
#define ARCADIA_HOST_BRIDGE_IDSEL 17 #define ARCADIA_HOST_BRIDGE_IDSEL 17
#define ARCADIA_2ND_BRIDGE_IDSEL 3 #define ARCADIA_2ND_BRIDGE_IDSEL 3
extern int mpc85xx_pci2_busno;
static int mpc85xx_exclude_device(struct pci_controller *hose, static int mpc85xx_exclude_device(struct pci_controller *hose,
u_char bus, u_char devfn) u_char bus, u_char devfn)
{ {
if (bus == 0 && PCI_SLOT(devfn) == 0) if ((bus == hose->first_busno) && PCI_SLOT(devfn) == 0)
return PCIBIOS_DEVICE_NOT_FOUND;
if (mpc85xx_pci2_busno)
if (bus == (mpc85xx_pci2_busno) && PCI_SLOT(devfn) == 0)
return PCIBIOS_DEVICE_NOT_FOUND; return PCIBIOS_DEVICE_NOT_FOUND;
/* We explicitly do not go past the Tundra 320 Bridge */ /* We explicitly do not go past the Tundra 320 Bridge */
if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL)) if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#define DBG(x...) #define DBG(x...)
#endif #endif
int mpc85xx_pci2_busno = 0;
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
int __init mpc85xx_add_bridge(struct device_node *dev) int __init mpc85xx_add_bridge(struct device_node *dev)
{ {
...@@ -74,7 +72,6 @@ int __init mpc85xx_add_bridge(struct device_node *dev) ...@@ -74,7 +72,6 @@ int __init mpc85xx_add_bridge(struct device_node *dev)
setup_indirect_pci(hose, immr + 0x9000, immr + 0x9004); setup_indirect_pci(hose, immr + 0x9000, immr + 0x9004);
primary = 0; primary = 0;
hose->bus_offset = hose->first_busno; hose->bus_offset = hose->first_busno;
mpc85xx_pci2_busno = hose->first_busno;
} }
printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. " printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. "
......
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