aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_32.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2007-07-20 14:35:34 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-07-23 23:30:08 -0400
commitf64fddbeac737bfc8d966423f067a9af9eeec887 (patch)
tree539a70d8bc30fd6f30a0aee9d6f63a5f1a8b4fc4 /arch/powerpc/kernel/pci_32.c
parentf16dab981aa9d423bdfe096e3422acd33d905c1e (diff)
[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: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r--arch/powerpc/kernel/pci_32.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index bfcfa14e831f..721a69400d65 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -415,15 +415,13 @@ probe_resource(struct pci_bus *parent, struct resource *pr,
415 return 0; 415 return 0;
416} 416}
417 417
418static void __init 418void __init
419update_bridge_base(struct pci_bus *bus, int i) 419update_bridge_resource(struct pci_dev *dev, struct resource *res)
420{ 420{
421 struct resource *res = bus->resource[i];
422 u8 io_base_lo, io_limit_lo; 421 u8 io_base_lo, io_limit_lo;
423 u16 mem_base, mem_limit; 422 u16 mem_base, mem_limit;
424 u16 cmd; 423 u16 cmd;
425 unsigned long start, end, off; 424 unsigned long start, end, off;
426 struct pci_dev *dev = bus->self;
427 struct pci_controller *hose = dev->sysdata; 425 struct pci_controller *hose = dev->sysdata;
428 426
429 if (!hose) { 427 if (!hose) {
@@ -467,12 +465,20 @@ update_bridge_base(struct pci_bus *bus, int i)
467 pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit); 465 pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
468 466
469 } else { 467 } else {
470 DBG(KERN_ERR "PCI: ugh, bridge %s res %d has flags=%lx\n", 468 DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
471 pci_name(dev), i, res->flags); 469 pci_name(dev), res->flags);
472 } 470 }
473 pci_write_config_word(dev, PCI_COMMAND, cmd); 471 pci_write_config_word(dev, PCI_COMMAND, cmd);
474} 472}
475 473
474static void __init
475update_bridge_base(struct pci_bus *bus, int i)
476{
477 struct resource *res = bus->resource[i];
478 struct pci_dev *dev = bus->self;
479 update_bridge_resource(dev, res);
480}
481
476static inline void alloc_resource(struct pci_dev *dev, int idx) 482static inline void alloc_resource(struct pci_dev *dev, int idx)
477{ 483{
478 struct resource *pr, *r = &dev->resource[idx]; 484 struct resource *pr, *r = &dev->resource[idx];