diff options
author | Becky Bruce <becky.bruce@freescale.com> | 2008-09-12 06:34:46 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-09-24 17:26:45 -0400 |
commit | 4fc665b88a79a45bae8bbf3a05563c27c7337c3d (patch) | |
tree | ca668c2fab7c3a4d62b92174f4a5fcae2625cdd1 /arch/powerpc/kernel/pci_64.c | |
parent | 8fae0353247530d2124b2419052fa6120462fa99 (diff) |
powerpc: Merge 32 and 64-bit dma code
We essentially adopt the 64-bit dma code, with some changes to support
32-bit systems, including HIGHMEM. dma functions on 32-bit are now
invoked via accessor functions which call the correct op for a device based
on archdata dma_ops. If there is no archdata dma_ops, this defaults
to dma_direct_ops.
In addition, the dma_map/unmap_page functions are added to dma_ops
because we can't just fall back on map/unmap_single when HIGHMEM is
enabled. In the case of dma_direct_*, we stop using map/unmap_single
and just use the page version - this saves a lot of ugly
ifdeffing. We leave map/unmap_single in the dma_ops definition,
though, because they are needed by the iommu code, which does not
implement map/unmap_page. Ideally, going forward, we will completely
eliminate map/unmap_single and just have map/unmap_page, if it's
workable for 64-bit.
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 1f75bf03446f..8247cff1cb3e 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -52,35 +52,6 @@ EXPORT_SYMBOL(pci_io_base); | |||
52 | 52 | ||
53 | LIST_HEAD(hose_list); | 53 | LIST_HEAD(hose_list); |
54 | 54 | ||
55 | static struct dma_mapping_ops *pci_dma_ops; | ||
56 | |||
57 | void set_pci_dma_ops(struct dma_mapping_ops *dma_ops) | ||
58 | { | ||
59 | pci_dma_ops = dma_ops; | ||
60 | } | ||
61 | |||
62 | struct dma_mapping_ops *get_pci_dma_ops(void) | ||
63 | { | ||
64 | return pci_dma_ops; | ||
65 | } | ||
66 | EXPORT_SYMBOL(get_pci_dma_ops); | ||
67 | |||
68 | |||
69 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask) | ||
70 | { | ||
71 | return dma_set_mask(&dev->dev, mask); | ||
72 | } | ||
73 | |||
74 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) | ||
75 | { | ||
76 | int rc; | ||
77 | |||
78 | rc = dma_set_mask(&dev->dev, mask); | ||
79 | dev->dev.coherent_dma_mask = dev->dma_mask; | ||
80 | |||
81 | return rc; | ||
82 | } | ||
83 | |||
84 | static void fixup_broken_pcnet32(struct pci_dev* dev) | 55 | static void fixup_broken_pcnet32(struct pci_dev* dev) |
85 | { | 56 | { |
86 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { | 57 | if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) { |
@@ -548,23 +519,6 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) | |||
548 | } | 519 | } |
549 | EXPORT_SYMBOL_GPL(pcibios_map_io_space); | 520 | EXPORT_SYMBOL_GPL(pcibios_map_io_space); |
550 | 521 | ||
551 | void __devinit pcibios_setup_new_device(struct pci_dev *dev) | ||
552 | { | ||
553 | struct dev_archdata *sd = &dev->dev.archdata; | ||
554 | |||
555 | sd->of_node = pci_device_to_OF_node(dev); | ||
556 | |||
557 | DBG("PCI: device %s OF node: %s\n", pci_name(dev), | ||
558 | sd->of_node ? sd->of_node->full_name : "<none>"); | ||
559 | |||
560 | sd->dma_ops = pci_dma_ops; | ||
561 | set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); | ||
562 | |||
563 | if (ppc_md.pci_dma_dev_setup) | ||
564 | ppc_md.pci_dma_dev_setup(dev); | ||
565 | } | ||
566 | EXPORT_SYMBOL(pcibios_setup_new_device); | ||
567 | |||
568 | void __devinit pcibios_do_bus_setup(struct pci_bus *bus) | 522 | void __devinit pcibios_do_bus_setup(struct pci_bus *bus) |
569 | { | 523 | { |
570 | struct pci_dev *dev; | 524 | struct pci_dev *dev; |