aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorBecky Bruce <beckyb@kernel.crashing.org>2009-05-14 08:42:28 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-09 02:49:18 -0400
commitec3cf2ece22a8ede7478bf38e2a818986322662b (patch)
tree76654ac60da3d2ac27f49769f825215d55b03276 /arch/powerpc/include/asm/dma-mapping.h
parent1babddbc2e83ab98fc4dd0a3e9bd7b2d30be7e32 (diff)
powerpc: Add support for swiotlb on 32-bit
This patch includes the basic infrastructure to use swiotlb bounce buffering on 32-bit powerpc. It is not yet enabled on any platforms. Probably the most interesting bit is the addition of addr_needs_map to dma_ops - we need this as a dma_op because the decision of whether or not an addr can be mapped by a device is device-specific. Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/dma-mapping.h')
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index cb448d68452..3d9e887c3c0 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -15,9 +15,18 @@
15#include <linux/scatterlist.h> 15#include <linux/scatterlist.h>
16#include <linux/dma-attrs.h> 16#include <linux/dma-attrs.h>
17#include <asm/io.h> 17#include <asm/io.h>
18#include <asm/swiotlb.h>
18 19
19#define DMA_ERROR_CODE (~(dma_addr_t)0x0) 20#define DMA_ERROR_CODE (~(dma_addr_t)0x0)
20 21
22/* Some dma direct funcs must be visible for use in other dma_ops */
23extern void *dma_direct_alloc_coherent(struct device *dev, size_t size,
24 dma_addr_t *dma_handle, gfp_t flag);
25extern void dma_direct_free_coherent(struct device *dev, size_t size,
26 void *vaddr, dma_addr_t dma_handle);
27
28extern unsigned long get_dma_direct_offset(struct device *dev);
29
21#ifdef CONFIG_NOT_COHERENT_CACHE 30#ifdef CONFIG_NOT_COHERENT_CACHE
22/* 31/*
23 * DMA-consistent mapping functions for PowerPCs that don't support 32 * DMA-consistent mapping functions for PowerPCs that don't support
@@ -78,6 +87,8 @@ struct dma_mapping_ops {
78 dma_addr_t dma_address, size_t size, 87 dma_addr_t dma_address, size_t size,
79 enum dma_data_direction direction, 88 enum dma_data_direction direction,
80 struct dma_attrs *attrs); 89 struct dma_attrs *attrs);
90 int (*addr_needs_map)(struct device *dev, dma_addr_t addr,
91 size_t size);
81#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS 92#ifdef CONFIG_PPC_NEED_DMA_SYNC_OPS
82 void (*sync_single_range_for_cpu)(struct device *hwdev, 93 void (*sync_single_range_for_cpu)(struct device *hwdev,
83 dma_addr_t dma_handle, unsigned long offset, 94 dma_addr_t dma_handle, unsigned long offset,