Lines Matching refs:DMA
2 Dynamic DMA mapping using the generic device
7 This document describes the DMA API. For a more gentle introduction
16 Part I - DMA API
19 To get the DMA API, you must #include <linux/dma-mapping.h>. This
22 A dma_addr_t can hold any valid DMA address for the platform. It can be
23 given to a device to use as a DMA source or target. A CPU cannot reference
25 address space and the DMA address space.
27 Part Ia - Using large DMA-coherent buffers
48 same width as the bus and given to the device as the DMA address base of
74 Part Ib - Using small DMA-coherent buffers
77 To get this part of the DMA API, you must #include <linux/dmapool.h>
79 Many drivers need lots of small DMA-coherent memory regions for DMA
81 or more using dma_alloc_coherent(), you can use DMA pools. These work
82 much like a struct kmem_cache, except that they use the DMA-coherent allocator,
92 Part Ic - DMA addressing limitations
95 DMA mask is a bit mask of the addressable region for the device. In other words,
96 if applying the DMA mask (a bitwise AND operation) to the DMA address of a
98 perform DMA to that memory region.
100 All the below functions which set a DMA mask may fail if the requested mask
101 cannot be used with the device, or if the device is not capable of doing DMA.
108 Updates both streaming and coherent DMA masks.
117 Updates only the streaming DMA mask.
126 Updates only the coherent DMA mask.
166 limit total DMA streaming mappings length to the returned value.
181 Returns the DMA merge boundary. If the device cannot merge any DMA address
184 Part Id - Streaming DMA mappings
187 Streaming DMA allows to map an existing buffer for DMA transfers and then
194 device, e.g. if it is not within the DMA mask of the device and/or a
195 connecting bus bridge. Streaming DMA functions try to overcome such
197 I/O DMA addresses to physical memory addresses), or by copying the
204 located in physical memory, especially if the DMA mask is less than 32
214 device and returns the DMA address of the memory.
216 The DMA API uses a strongly typed enumerator for its direction:
315 the returned DMA address with dma_mapping_error(). A non-zero return value
317 action (e.g. reduce current DMA mapping usage or delay and try again later).
325 Maps a scatter/gather list for DMA. Returns the number of DMA address segments
370 DMA address entries returned.
405 - Before reading values that have been written by DMA from the device
407 - After writing values that will be written to the device using DMA
440 The interpretation of DMA attributes is architecture-specific, and
451 for DMA::
478 Part Ie - IOVA-based DMA mappings
483 where DMA mapping performance, or the space usage for storing the DMA addresses
493 DMA mapping API should be used. The ``struct dma_iova_state`` is allocated
511 to the DMA merge boundary returned by ``dma_get_merge_boundary()``, and
512 the size of all but the last range must be aligned to the DMA merge boundary
550 Part II - Non-coherent DMA allocations
553 These APIs allow to allocate pages that are guaranteed to be DMA addressable
572 same width as the bus and given to the device as the DMA address base of
584 dma_sync_single_for_cpu(), just like for streaming DMA mappings that are
637 and DMA mapped memory, or NULL if the allocation failed. The resulting memory
640 The return sg_table is guaranteed to have 1 single DMA mapped segment as
655 dma_sync_sgtable_for_cpu(), just like for streaming DMA mappings that are
723 Part III - Debug drivers use of the DMA API
726 The DMA API as described above has some constraints. DMA addresses must be
732 To debug drivers and find bugs in the usage of the DMA API checking code can
735 debugging of DMA API usage" option in your kernel configuration. Enabling this
739 about what DMA memory was allocated for which device. If this code detects an
746 forcedeth 0000:00:08.0: DMA-API: device driver frees DMA memory with wrong
774 of the DMA API call which caused this warning.
782 The debugfs directory for the DMA API debugging code is called dma-api/. In
797 dma-api/dump This read-only file contains current DMA
830 'dma_debug=off' as a boot parameter. This will disable DMA API debugging.
856 to check DMA mapping errors on addresses returned by dma_map_single() and
862 routines to enable DMA mapping error check debugging.