Commit f64fddbe authored by Kumar Gala's avatar Kumar Gala

[POWERPC] Provide ability to setup P2P bridge registers from struct resource

We need the ability to set P2P bridge registers to properly setup the virtual
P2P bridges that exist in PCIe controllers for some of the embedded setups.
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent f16dab98
...@@ -415,15 +415,13 @@ probe_resource(struct pci_bus *parent, struct resource *pr, ...@@ -415,15 +415,13 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
return 0; return 0;
} }
static void __init void __init
update_bridge_base(struct pci_bus *bus, int i) update_bridge_resource(struct pci_dev *dev, struct resource *res)
{ {
struct resource *res = bus->resource[i];
u8 io_base_lo, io_limit_lo; u8 io_base_lo, io_limit_lo;
u16 mem_base, mem_limit; u16 mem_base, mem_limit;
u16 cmd; u16 cmd;
unsigned long start, end, off; unsigned long start, end, off;
struct pci_dev *dev = bus->self;
struct pci_controller *hose = dev->sysdata; struct pci_controller *hose = dev->sysdata;
if (!hose) { if (!hose) {
...@@ -467,12 +465,20 @@ update_bridge_base(struct pci_bus *bus, int i) ...@@ -467,12 +465,20 @@ update_bridge_base(struct pci_bus *bus, int i)
pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit); pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
} else { } else {
DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n", DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
pci_name(dev), i, res->flags); pci_name(dev), res->flags);
} }
pci_write_config_word(dev, PCI_COMMAND, cmd); pci_write_config_word(dev, PCI_COMMAND, cmd);
} }
static void __init
update_bridge_base(struct pci_bus *bus, int i)
{
struct resource *res = bus->resource[i];
struct pci_dev *dev = bus->self;
update_bridge_resource(dev, res);
}
static inline void alloc_resource(struct pci_dev *dev, int idx) static inline void alloc_resource(struct pci_dev *dev, int idx)
{ {
struct resource *pr, *r = &dev->resource[idx]; struct resource *pr, *r = &dev->resource[idx];
......
...@@ -92,6 +92,8 @@ extern int early_find_capability(struct pci_controller *hose, int bus, ...@@ -92,6 +92,8 @@ extern int early_find_capability(struct pci_controller *hose, int bus,
extern void setup_indirect_pci(struct pci_controller* hose, extern void setup_indirect_pci(struct pci_controller* hose,
u32 cfg_addr, u32 cfg_data, u32 flags); u32 cfg_addr, u32 cfg_data, u32 flags);
extern void setup_grackle(struct pci_controller *hose); extern void setup_grackle(struct pci_controller *hose);
extern void __init update_bridge_resource(struct pci_dev *dev,
struct resource *res);
#else #else
......
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