Lines Matching refs:DMA

1 		     Dynamic DMA mapping Guide
8 This is a guide to device driver writers on how to use the DMA API
10 DMA-API.txt.
13 addresses (DMA addresses) into physical addresses. This is similar to
16 access with a Single Address Cycle (32bit DMA address) any page in the
19 system, so that the virt_to_bus() static scheme works (the DMA address
23 So that Linux can use the dynamic DMA mapping, it needs some help from the
24 drivers, namely it has to take into account that DMA addresses should be
25 mapped only for the time they are actually used and unmapped after the DMA
31 Note that the DMA API works with any bus independent of the underlying
32 microprocessor architecture. You should use the DMA API rather than
33 the bus specific DMA API (e.g. pci_dma_*).
40 dma_addr_t (which can hold any valid DMA address for the platform)
41 type which should be used everywhere you hold a DMA (bus) address
42 returned from the DMA mapping functions.
44 What memory is DMA'able?
47 be used with the DMA mapping facilities. There has been an unwritten
53 (i.e. kmalloc() or kmem_cache_alloc()) then you may DMA to/from
57 returned from vmalloc() for DMA. It is possible to DMA to the
66 stack addresses for DMA. These could all be mapped somewhere entirely
68 memory could physically work with DMA, you'd need to ensure the I/O
70 sharing problems (data corruption) on CPUs with DMA-incoherent caches.
71 (The CPU could write to one word, DMA would write to a different one
75 call and DMA to/from that. This is similar to vmalloc().
79 for you to DMA from/to.
81 DMA addressing limitations
83 Does your device have any DMA addressing limitations? For example, is
98 probe routine to see if the DMA controller on the machine can properly
99 support the DMA addressing limitation your device has. It is good
115 supports. It returns zero if your card can perform DMA properly on
122 If it returns non-zero, your device cannot perform DMA properly on
124 behavior. You must either use a different mask, or not use DMA.
128 1) Use another DMA mask, if possible (see below).
129 2) Use some non-DMA mode for data transfer, if possible.
142 "mydev: No suitable DMA available.\n");
155 all 64-bits when accessing streaming DMA:
165 "mydev: No suitable DMA available.\n");
184 "mydev: No suitable DMA available.\n");
198 "mydev: 24-bit DMA addressing not available.\n");
204 information later when you make DMA mappings.
210 DMA addressing limitations, you may wish to probe each mask and
228 printk(KERN_WARNING "%s: Playback disabled due to DMA limitations.\n",
235 printk(KERN_WARNING "%s: Record disabled due to DMA limitations.\n",
241 and thus retaining the 16MB DMA addressing limitations of ISA.
243 Types of DMA mappings
245 There are two types of DMA mappings:
247 - Consistent DMA mappings which are usually mapped at driver
262 - Network card DMA ring descriptors.
271 IMPORTANT: Consistent DMA memory does not preclude the usage of
289 - Streaming DMA mappings which are usually mapped for one DMA
306 Neither type of DMA mapping has alignment restrictions that come from
308 Also, systems with caches that aren't DMA-coherent will work better
312 Using Consistent DMA mappings.
314 To allocate and map large (PAGE_SIZE or so) consistent DMA regions,
331 The consistent DMA mapping interfaces, for non-NULL dev, will by
332 default return a DMA address which is 32-bit addressable. Even if the
333 device indicates (via DMA mask) that it may address the upper 32-bits,
334 consistent allocation will only return > 32-bit addresses for DMA if
335 the consistent DMA mask has been explicitly changed via
343 The cpu return address and the DMA bus master address are both
350 To unmap and free such a DMA region, you call:
403 DMA Direction
406 take a DMA direction argument, which is an integer and takes on
414 One should provide the exact DMA direction if you know it.
418 It is the direction in which the data moves during the DMA
424 If you absolutely cannot know the direction of the DMA transfer,
425 specify DMA_BIDIRECTIONAL. It means that the DMA can go in
437 Some platforms actually have a write permission boolean which DMA
440 kernel logs when the DMA controller hardware detects violation of the
456 Using Streaming DMA mappings
458 The streaming DMA mapping routines can be called from interrupt
476 You should call dma_unmap_single when the DMA activity is finished, e.g.
477 from the interrupt which told you that the DMA transfer is done.
512 into one (e.g. if DMA mapping is done with PAGE_SIZE granularity, any
527 Again, make sure DMA activity has already finished.
540 If you need to use the same streaming DMA region multiple times and touch
541 the data in between the DMA transfers, the buffer needs to be synced
543 correct copy of the DMA buffer.
545 So, firstly, just map it with dma_map_{single,sg}, and after each DMA
556 Then, if you wish to let the device get at the DMA area again,
568 After the last DMA transfer call one of the DMA unmap routines
601 * the DMA transfer with the CPU first
631 dynamic DMA mapping scheme - you have to always store the DMA addresses
634 supports dynamic DMA mapping in hardware) in your driver structures and/or
644 DMA address space is limited on some architectures and an allocation
657 * reduce current DMA mapping usage,
664 and return NETDEV_TX_OK if the DMA mapping fails on the transmit hook
668 SCSI drivers must return SCSI_MLQUEUE_HOST_BUSY if the DMA mapping
744 DMA-safe. Drivers and subsystems depend on it. If an architecture
745 isn't fully DMA-coherent (i.e. hardware doesn't ensure that data in
751 Note that ARCH_DMA_MINALIGN is about DMA memory alignment
760 library to support the DMA API with multiple types of IOMMUs. Lots