diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2006-11-11 01:25:02 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:38:40 -0500 |
commit | 12d04eef927bf61328af2c7cbe756c96f98ac3bf (patch) | |
tree | 18865369100e9059c7e883dec93ea67f7b52a287 /arch/powerpc/kernel/pci_64.c | |
parent | 7c719871ff4d5f15b71f0138d08b758281b58631 (diff) |
[POWERPC] Refactor 64 bits DMA operations
This patch completely refactors DMA operations for 64 bits powerpc. 32 bits
is untouched for now.
We use the new dev_archdata structure to add the dma operations pointer
and associated data to struct device. While at it, we also add the OF node
pointer and numa node. In the future, we might want to look into merging
that with pci_dn as well.
The old vio, pci-iommu and pci-direct DMA ops are gone. They are now replaced
by a set of generic iommu and direct DMA ops (non PCI specific) that can be
used by bus types. The toplevel implementation is now inline.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 9a6bb80a8cd4..88b78484b944 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -61,7 +61,7 @@ void iSeries_pcibios_init(void); | |||
61 | 61 | ||
62 | LIST_HEAD(hose_list); | 62 | LIST_HEAD(hose_list); |
63 | 63 | ||
64 | struct dma_mapping_ops pci_dma_ops; | 64 | struct dma_mapping_ops *pci_dma_ops; |
65 | EXPORT_SYMBOL(pci_dma_ops); | 65 | EXPORT_SYMBOL(pci_dma_ops); |
66 | 66 | ||
67 | int global_phb_number; /* Global phb counter */ | 67 | int global_phb_number; /* Global phb counter */ |
@@ -1205,15 +1205,35 @@ void __devinit pcibios_fixup_device_resources(struct pci_dev *dev, | |||
1205 | } | 1205 | } |
1206 | EXPORT_SYMBOL(pcibios_fixup_device_resources); | 1206 | EXPORT_SYMBOL(pcibios_fixup_device_resources); |
1207 | 1207 | ||
1208 | void __devinit pcibios_setup_new_device(struct pci_dev *dev) | ||
1209 | { | ||
1210 | struct dev_archdata *sd = &dev->dev.archdata; | ||
1211 | |||
1212 | sd->of_node = pci_device_to_OF_node(dev); | ||
1213 | |||
1214 | DBG("PCI device %s OF node: %s\n", pci_name(dev), | ||
1215 | sd->of_node ? sd->of_node->full_name : "<none>"); | ||
1216 | |||
1217 | sd->dma_ops = pci_dma_ops; | ||
1218 | #ifdef CONFIG_NUMA | ||
1219 | sd->numa_node = pcibus_to_node(dev->bus); | ||
1220 | #else | ||
1221 | sd->numa_node = -1; | ||
1222 | #endif | ||
1223 | if (ppc_md.pci_dma_dev_setup) | ||
1224 | ppc_md.pci_dma_dev_setup(dev); | ||
1225 | } | ||
1226 | EXPORT_SYMBOL(pcibios_setup_new_device); | ||
1208 | 1227 | ||
1209 | static void __devinit do_bus_setup(struct pci_bus *bus) | 1228 | static void __devinit do_bus_setup(struct pci_bus *bus) |
1210 | { | 1229 | { |
1211 | struct pci_dev *dev; | 1230 | struct pci_dev *dev; |
1212 | 1231 | ||
1213 | ppc_md.iommu_bus_setup(bus); | 1232 | if (ppc_md.pci_dma_bus_setup) |
1233 | ppc_md.pci_dma_bus_setup(bus); | ||
1214 | 1234 | ||
1215 | list_for_each_entry(dev, &bus->devices, bus_list) | 1235 | list_for_each_entry(dev, &bus->devices, bus_list) |
1216 | ppc_md.iommu_dev_setup(dev); | 1236 | pcibios_setup_new_device(dev); |
1217 | 1237 | ||
1218 | /* Read default IRQs and fixup if necessary */ | 1238 | /* Read default IRQs and fixup if necessary */ |
1219 | list_for_each_entry(dev, &bus->devices, bus_list) { | 1239 | list_for_each_entry(dev, &bus->devices, bus_list) { |