Commit 0a3786c5 authored by Kumar Gala's avatar Kumar Gala

[POWERPC] Removed remnants of bus_offset

Removed the remants of bus_offset and use self_busno in the mv64x60 case
and use pci_assign_all_buses on 83xx/85xx.

83xx/85xx have multiple PHBs and the firmwares on these devices tend not
to handle topologies with P2P bridges well so we let Linux just reassign
the bus numbers to match.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent 5ab65ecd
...@@ -61,6 +61,7 @@ int __init mpc83xx_add_bridge(struct device_node *dev) ...@@ -61,6 +61,7 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
" bus 0\n", dev->full_name); " bus 0\n", dev->full_name);
} }
pci_assign_all_buses = 1;
hose = pcibios_alloc_controller(); hose = pcibios_alloc_controller();
if (!hose) if (!hose)
return -ENOMEM; return -ENOMEM;
...@@ -80,7 +81,6 @@ int __init mpc83xx_add_bridge(struct device_node *dev) ...@@ -80,7 +81,6 @@ int __init mpc83xx_add_bridge(struct device_node *dev)
if ((rsrc.start & 0xfffff) == 0x8600) { if ((rsrc.start & 0xfffff) == 0x8600) {
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;
} }
printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. " printk(KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. "
......
...@@ -55,6 +55,7 @@ int __init mpc85xx_add_bridge(struct device_node *dev) ...@@ -55,6 +55,7 @@ int __init mpc85xx_add_bridge(struct device_node *dev)
" bus 0\n", dev->full_name); " bus 0\n", dev->full_name);
} }
pci_assign_all_buses = 1;
hose = pcibios_alloc_controller(); hose = pcibios_alloc_controller();
if (!hose) if (!hose)
return -ENOMEM; return -ENOMEM;
...@@ -71,7 +72,6 @@ int __init mpc85xx_add_bridge(struct device_node *dev) ...@@ -71,7 +72,6 @@ int __init mpc85xx_add_bridge(struct device_node *dev)
if ((rsrc.start & 0xfffff) == 0x9000) { if ((rsrc.start & 0xfffff) == 0x9000) {
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;
} }
printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. " printk(KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. "
......
...@@ -44,7 +44,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset, ...@@ -44,7 +44,7 @@ indirect_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
cfg_type = 1; cfg_type = 1;
bus_no = (bus->number == hose->first_busno) ? bus_no = (bus->number == hose->first_busno) ?
hose->self_busno : bus->number - hose->bus_offset; hose->self_busno : bus->number;
PCI_CFG_OUT(hose->cfg_addr, PCI_CFG_OUT(hose->cfg_addr,
(0x80000000 | (bus_no << 16) (0x80000000 | (bus_no << 16)
...@@ -87,7 +87,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset, ...@@ -87,7 +87,7 @@ indirect_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
cfg_type = 1; cfg_type = 1;
bus_no = (bus->number == hose->first_busno) ? bus_no = (bus->number == hose->first_busno) ?
hose->self_busno : bus->number - hose->bus_offset; hose->self_busno : bus->number;
PCI_CFG_OUT(hose->cfg_addr, PCI_CFG_OUT(hose->cfg_addr,
(0x80000000 | (bus_no << 16) (0x80000000 | (bus_no << 16)
......
...@@ -147,7 +147,7 @@ static int __init mv64x60_add_bridge(struct device_node *dev) ...@@ -147,7 +147,7 @@ static int __init mv64x60_add_bridge(struct device_node *dev)
hose->last_busno = bus_range ? bus_range[1] : 0xff; hose->last_busno = bus_range ? bus_range[1] : 0xff;
setup_indirect_pci(hose, rsrc.start, rsrc.start + 4); setup_indirect_pci(hose, rsrc.start, rsrc.start + 4);
hose->bus_offset = hose->first_busno; hose->self_busno = hose->first_busno;
printk(KERN_INFO "Found MV64x60 PCI host bridge at 0x%016llx. " printk(KERN_INFO "Found MV64x60 PCI host bridge at 0x%016llx. "
"Firmware bus number: %d->%d\n", "Firmware bus number: %d->%d\n",
......
...@@ -48,6 +48,7 @@ struct pci_controller { ...@@ -48,6 +48,7 @@ struct pci_controller {
int first_busno; int first_busno;
int last_busno; int last_busno;
int self_busno; int self_busno;
/* bus_offset is only used by ARCH=ppc */
int bus_offset; int bus_offset;
void __iomem *io_base_virt; void __iomem *io_base_virt;
......
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