Lines Matching +full:dma +full:- +full:controller

2 DMA with ISA and LPC devices
7 This document describes how to do DMA transfers using the old ISA DMA
8 controller. Even though ISA is more or less dead today the LPC bus
9 uses the same DMA system so it will be around for quite some time.
12 ------------------------
14 To do ISA style DMA you need to include two headers::
16 #include <linux/dma-mapping.h>
17 #include <asm/dma.h>
19 The first is the generic DMA API used to convert virtual addresses to
20 bus addresses (see Documentation/core-api/dma-api.rst for details).
22 The second contains the routines specific to ISA DMA transfers. Since
28 -----------------
30 The ISA DMA controller has some very strict requirements on which
34 (You usually need a special buffer for DMA transfers instead of
37 The DMA-able address space is the lowest 16 MB of _physical_ memory.
44 Unfortunately the memory available for ISA DMA is scarce so unless you
45 allocate the memory during boot-up it's a good idea to also pass
52 -------------------
54 To translate the virtual address to a bus address, use the normal DMA
58 is really all you need. Remember that even though the DMA controller
61 Note: x86_64 had a broken DMA API when it came to ISA but has since
62 been fixed. If your arch has problems then fix the DMA API instead of
66 --------
68 A normal ISA DMA controller has 8 channels. The lower four are for
69 8-bit transfers and the upper four are for 16-bit transfers.
71 (Actually the DMA controller is really two separate controllers where
72 channel 4 is used to give DMA access for the second controller (0-3).
73 This means that of the four 16-bits channels only three are usable.)
80 The ability to use 16-bit or 8-bit transfers is _not_ up to you as a
85 -------------
87 Now for the good stuff, the actual DMA transfer. :)
89 Before you use any ISA DMA routines you need to claim the DMA lock
90 using claim_dma_lock(). The reason is that some DMA operations are
94 The first time you use the DMA controller you should call
95 clear_dma_ff(). This clears an internal register in the DMA
96 controller that is used for the non-atomic operations. As long as you
100 Next, you tell the controller in which direction you intend to do the
105 be 16-bit aligned for 16-bit transfers) and how many bytes to
106 transfer. Note that it's _bytes_. The DMA routines will do all the
107 required translation to values that the DMA controller understands.
109 The final step is enabling the DMA channel and releasing the DMA
112 Once the DMA transfer is finished (or timed out) you should disable
140 printk(KERN_ERR "driver: Incomplete DMA transfer!"
146 --------------
149 suspended while a DMA transfer is in progress. Also, all DMA settings
150 are lost when the system suspends so if your driver relies on the DMA
151 controller being in a certain state then you have to restore these