Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123013
b: refs/heads/master
c: 7eef440
h: refs/heads/master
i:
  123011: d957296
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Nov 5, 2008
1 parent 4703eab commit b1aca5d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd6852c8fa060bd45c82a2593e18f933f6c6204f
refs/heads/master: 7eef440a545c7f812ed10b49d4a10a351df9cad6
77 changes: 36 additions & 41 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,25 +203,6 @@ char __devinit *pcibios_setup(char *str)
return str;
}

static void __devinit pcibios_setup_new_device(struct pci_dev *dev)
{
struct dev_archdata *sd = &dev->dev.archdata;

sd->of_node = pci_device_to_OF_node(dev);

pr_debug("PCI: device %s OF node: %s\n", pci_name(dev),
sd->of_node ? sd->of_node->full_name : "<none>");

sd->dma_ops = pci_dma_ops;
#ifdef CONFIG_PPC32
sd->dma_data = (void *)PCI_DRAM_OFFSET;
#endif
set_dev_node(&dev->dev, pcibus_to_node(dev->bus));

if (ppc_md.pci_dma_dev_setup)
ppc_md.pci_dma_dev_setup(dev);
}

/*
* Reads the interrupt pin to determine if interrupt is use by card.
* If the interrupt is used, then gets the interrupt line from the
Expand Down Expand Up @@ -1074,33 +1055,14 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
}
}

void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
{
struct pci_dev *dev;

pr_debug("PCI: Fixup bus %d (%s)\n",
bus->number, bus->self ? pci_name(bus->self) : "PHB");

/* Setup DMA for all PCI devices on that bus */
list_for_each_entry(dev, &bus->devices, bus_list)
pcibios_setup_new_device(dev);

/* Read default IRQs and fixup if necessary */
list_for_each_entry(dev, &bus->devices, bus_list) {
pci_read_irq_line(dev);
if (ppc_md.pci_irq_fixup)
ppc_md.pci_irq_fixup(dev);
}
}

void __devinit pcibios_setup_bus_self(struct pci_bus *bus)
{
/* Fix up the bus resources */
/* Fix up the bus resources for P2P bridges */
if (bus->self != NULL)
pcibios_fixup_bridge(bus);

/* Platform specific bus fixups. This is currently only used
* by fsl_pci and I'm hoping getting rid of it at some point
* by fsl_pci and I'm hoping to get rid of it at some point
*/
if (ppc_md.pcibios_fixup_bus)
ppc_md.pcibios_fixup_bus(bus);
Expand All @@ -1110,10 +1072,43 @@ void __devinit pcibios_setup_bus_self(struct pci_bus *bus)
ppc_md.pci_dma_bus_setup(bus);
}

void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
{
struct pci_dev *dev;

pr_debug("PCI: Fixup bus devices %d (%s)\n",
bus->number, bus->self ? pci_name(bus->self) : "PHB");

list_for_each_entry(dev, &bus->devices, bus_list) {
struct dev_archdata *sd = &dev->dev.archdata;

/* Setup OF node pointer in archdata */
sd->of_node = pci_device_to_OF_node(dev);

/* Fixup NUMA node as it may not be setup yet by the generic
* code and is needed by the DMA init
*/
set_dev_node(&dev->dev, pcibus_to_node(dev->bus));

/* Hook up default DMA ops */
sd->dma_ops = pci_dma_ops;
sd->dma_data = (void *)PCI_DRAM_OFFSET;

/* Additional platform DMA/iommu setup */
if (ppc_md.pci_dma_dev_setup)
ppc_md.pci_dma_dev_setup(dev);

/* Read default IRQs and fixup if necessary */
pci_read_irq_line(dev);
if (ppc_md.pci_irq_fixup)
ppc_md.pci_irq_fixup(dev);
}
}

void __devinit pcibios_fixup_bus(struct pci_bus *bus)
{
/* When called from the generic PCI probe, read PCI<->PCI bridge
* bases. This isn't called when generating the PCI tree from
* bases. This is -not- called when generating the PCI tree from
* the OF device-tree.
*/
if (bus->self != NULL)
Expand Down

0 comments on commit b1aca5d

Please sign in to comment.