aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/dma.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-02-13 08:01:30 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2019-02-18 22:41:04 +1100
commit68005b67d15a1ee5b5ddff965175728e65fa73e7 (patch)
tree7b8a2db46169d2e178cf8f0000592fa8fabfcfaf /arch/powerpc/kernel/dma.c
parentpowerpc/dma: use the dma_direct mapping routines (diff)
downloadlinux-dev-68005b67d15a1ee5b5ddff965175728e65fa73e7.tar.xz
linux-dev-68005b67d15a1ee5b5ddff965175728e65fa73e7.zip
powerpc/dma: use the generic direct mapping bypass
Now that we've switched all the powerpc nommu and swiotlb methods to use the generic dma_direct_* calls we can remove these ops vectors entirely and rely on the common direct mapping bypass that avoids indirect function calls entirely. This also allows to remove a whole lot of boilerplate code related to setting up these operations. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/dma.c')
-rw-r--r--arch/powerpc/kernel/dma.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
deleted file mode 100644
index b9f7283e7224..000000000000
--- a/arch/powerpc/kernel/dma.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corporation
- *
- * Provide default implementations of the DMA mapping callbacks for
- * directly mapped busses.
- */
-
-#include <linux/device.h>
-#include <linux/dma-direct.h>
-#include <linux/dma-debug.h>
-#include <linux/gfp.h>
-#include <linux/memblock.h>
-#include <linux/export.h>
-#include <linux/pci.h>
-#include <asm/vio.h>
-#include <asm/bug.h>
-#include <asm/machdep.h>
-#include <asm/swiotlb.h>
-#include <asm/iommu.h>
-
-/*
- * Generic direct DMA implementation
- *
- * This implementation supports a per-device offset that can be applied if
- * the address at which memory is visible to devices is not 0. Platform code
- * can set archdata.dma_data to an unsigned long holding the offset. By
- * default the offset is PCI_DRAM_OFFSET.
- */
-
-const struct dma_map_ops dma_nommu_ops = {
-#ifdef CONFIG_NOT_COHERENT_CACHE
- .alloc = __dma_nommu_alloc_coherent,
- .free = __dma_nommu_free_coherent,
-#else
- .alloc = dma_direct_alloc,
- .free = dma_direct_free,
-#endif
- .map_sg = dma_direct_map_sg,
- .dma_supported = dma_direct_supported,
- .map_page = dma_direct_map_page,
- .get_required_mask = dma_direct_get_required_mask,
-#ifdef CONFIG_NOT_COHERENT_CACHE
- .unmap_sg = dma_direct_unmap_sg,
- .unmap_page = dma_direct_unmap_page,
- .sync_single_for_cpu = dma_direct_sync_single_for_cpu,
- .sync_single_for_device = dma_direct_sync_single_for_device,
- .sync_sg_for_cpu = dma_direct_sync_sg_for_cpu,
- .sync_sg_for_device = dma_direct_sync_sg_for_device,
-#endif
-};
-EXPORT_SYMBOL(dma_nommu_ops);
-
-static int __init dma_init(void)
-{
-#ifdef CONFIG_IBMVIO
- dma_debug_add_bus(&vio_bus_type);
-#endif
-
- return 0;
-}
-fs_initcall(dma_init);
-