sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget1/translations/zh_CN/driver-api/dmaengine/providermodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/zh_TW/driver-api/dmaengine/providermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/it_IT/driver-api/dmaengine/providermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ja_JP/driver-api/dmaengine/providermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ko_KR/driver-api/dmaengine/providermodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/sp_SP/driver-api/dmaengine/providermodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h"DMAengine controller documentationh]h"DMAengine controller documentation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhK/var/lib/git/docbuild/linux/Documentation/driver-api/dmaengine/provider.rsthKubh)}(hhh](h)}(hHardware Introductionh]hHardware Introduction}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hQMost of the Slave DMA controllers have the same general principles of operations.h]hQMost of the Slave DMA controllers have the same general principles of operations.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhThey have a given number of channels to use for the DMA transfers, and a given number of requests lines.h]hhThey have a given number of channels to use for the DMA transfers, and a given number of requests lines.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hRequests and channels are pretty much orthogonal. Channels can be used to serve several to any requests. To simplify, channels are the entities that will be doing the copy, and requests what endpoints are involved.h]hRequests and channels are pretty much orthogonal. Channels can be used to serve several to any requests. To simplify, channels are the entities that will be doing the copy, and requests what endpoints are involved.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe request lines actually correspond to physical lines going from the DMA-eligible devices to the controller itself. Whenever the device will want to start a transfer, it will assert a DMA request (DRQ) by asserting that request line.h]hThe request lines actually correspond to physical lines going from the DMA-eligible devices to the controller itself. Whenever the device will want to start a transfer, it will assert a DMA request (DRQ) by asserting that request line.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hA very simple DMA controller would only take into account a single parameter: the transfer size. At each clock cycle, it would transfer a byte of data from one buffer to another, until the transfer size has been reached.h]hA very simple DMA controller would only take into account a single parameter: the transfer size. At each clock cycle, it would transfer a byte of data from one buffer to another, until the transfer size has been reached.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThat wouldn't work well in the real world, since slave devices might require a specific number of bits to be transferred in a single cycle. For example, we may want to transfer as much data as the physical bus allows to maximize performances when doing a simple memory copy operation, but our audio device could have a narrower FIFO that requires data to be written exactly 16 or 24 bits at a time. This is why most if not all of the DMA controllers can adjust this, using a parameter called the transfer width.h]hXThat wouldn’t work well in the real world, since slave devices might require a specific number of bits to be transferred in a single cycle. For example, we may want to transfer as much data as the physical bus allows to maximize performances when doing a simple memory copy operation, but our audio device could have a narrower FIFO that requires data to be written exactly 16 or 24 bits at a time. This is why most if not all of the DMA controllers can adjust this, using a parameter called the transfer width.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXMoreover, some DMA controllers, whenever the RAM is used as a source or destination, can group the reads or writes in memory into a buffer, so instead of having a lot of small memory accesses, which is not really efficient, you'll get several bigger transfers. This is done using a parameter called the burst size, that defines how many single reads/writes it's allowed to do without the controller splitting the transfer into smaller sub-transfers.h]hXMoreover, some DMA controllers, whenever the RAM is used as a source or destination, can group the reads or writes in memory into a buffer, so instead of having a lot of small memory accesses, which is not really efficient, you’ll get several bigger transfers. This is done using a parameter called the burst size, that defines how many single reads/writes it’s allowed to do without the controller splitting the transfer into smaller sub-transfers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh)}(hXOur theoretical DMA controller would then only be able to do transfers that involve a single contiguous block of data. However, some of the transfers we usually have are not, and want to copy data from non-contiguous buffers to a contiguous buffer, which is called scatter-gather.h]hXOur theoretical DMA controller would then only be able to do transfers that involve a single contiguous block of data. However, some of the transfers we usually have are not, and want to copy data from non-contiguous buffers to a contiguous buffer, which is called scatter-gather.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hhhhubh)}(hX:DMAEngine, at least for mem2dev transfers, require support for scatter-gather. So we're left with two cases here: either we have a quite simple DMA controller that doesn't support it, and we'll have to implement it in software, or we have a more advanced DMA controller, that implements in hardware scatter-gather.h]hX@DMAEngine, at least for mem2dev transfers, require support for scatter-gather. So we’re left with two cases here: either we have a quite simple DMA controller that doesn’t support it, and we’ll have to implement it in software, or we have a more advanced DMA controller, that implements in hardware scatter-gather.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hhhhubh)}(hThe latter are usually programmed using a collection of chunks to transfer, and whenever the transfer is started, the controller will go over that collection, doing whatever we programmed there.h]hThe latter are usually programmed using a collection of chunks to transfer, and whenever the transfer is started, the controller will go over that collection, doing whatever we programmed there.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hhhhubh)}(hX;This collection is usually either a table or a linked list. You will then push either the address of the table and its number of elements, or the first item of the list to one channel of the DMA controller, and whenever a DRQ will be asserted, it will go through the collection to know where to fetch the data from.h]hX;This collection is usually either a table or a linked list. You will then push either the address of the table and its number of elements, or the first item of the list to one channel of the DMA controller, and whenever a DRQ will be asserted, it will go through the collection to know where to fetch the data from.}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hhhhubh)}(hXEither way, the format of this collection is completely dependent on your hardware. Each DMA controller will require a different structure, but all of them will require, for every chunk, at least the source and destination addresses, whether it should increment these addresses or not and the three parameters we saw earlier: the burst size, the transfer width and the transfer size.h]hXEither way, the format of this collection is completely dependent on your hardware. Each DMA controller will require a different structure, but all of them will require, for every chunk, at least the source and destination addresses, whether it should increment these addresses or not and the three parameters we saw earlier: the burst size, the transfer width and the transfer size.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhhhhubh)}(hThe one last thing is that usually, slave devices won't issue DRQ by default, and you have to enable this in your slave device driver first whenever you're willing to use DMA.h]hThe one last thing is that usually, slave devices won’t issue DRQ by default, and you have to enable this in your slave device driver first whenever you’re willing to use DMA.}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKKhhhhubh)}(hThese were just the general memory-to-memory (also called mem2mem) or memory-to-device (mem2dev) kind of transfers. Most devices often support other kind of transfers or memory operations that dmaengine support and will be detailed later in this document.h]hThese were just the general memory-to-memory (also called mem2mem) or memory-to-device (mem2dev) kind of transfers. Most devices often support other kind of transfers or memory operations that dmaengine support and will be detailed later in this document.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKOhhhhubeh}(h]hardware-introductionah ]h"]hardware introductionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hDMA Support in Linuxh]hDMA Support in Linux}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKUubh)}(hHistorically, DMA controller drivers have been implemented using the async TX API, to offload operations such as memory copy, XOR, cryptography, etc., basically any memory to memory operation.h]hHistorically, DMA controller drivers have been implemented using the async TX API, to offload operations such as memory copy, XOR, cryptography, etc., basically any memory to memory operation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubh)}(hX)Over time, the need for memory to device transfers arose, and dmaengine was extended. Nowadays, the async TX API is written as a layer on top of dmaengine, and acts as a client. Still, dmaengine accommodates that API in some cases, and made some design choices to ensure that it stayed compatible.h]hX)Over time, the need for memory to device transfers arose, and dmaengine was extended. Nowadays, the async TX API is written as a layer on top of dmaengine, and acts as a client. Still, dmaengine accommodates that API in some cases, and made some design choices to ensure that it stayed compatible.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjhhubh)}(hFor more information on the Async TX API, please look the relevant documentation file in Documentation/crypto/async-tx-api.rst.h]hFor more information on the Async TX API, please look the relevant documentation file in Documentation/crypto/async-tx-api.rst.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjhhubeh}(h]dma-support-in-linuxah ]h"]dma support in linuxah$]h&]uh1hhhhhhhhKUubh)}(hhh](h)}(hDMAEngine APIsh]hDMAEngine APIs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKeubh)}(hhh](h)}(h$``struct dma_device`` Initializationh](hliteral)}(h``struct dma_device``h]hstruct dma_device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh Initialization}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhhhhhKhubh)}(hJust like any other kernel framework, the whole DMAEngine registration relies on the driver filling a structure and registering against the framework. In our case, that structure is dma_device.h]hJust like any other kernel framework, the whole DMAEngine registration relies on the driver filling a structure and registering against the framework. In our case, that structure is dma_device.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjhhubh)}(hThe first thing you need to do in your driver is to allocate this structure. Any of the usual memory allocators will do, but you'll also need to initialize a few fields in there:h]hThe first thing you need to do in your driver is to allocate this structure. Any of the usual memory allocators will do, but you’ll also need to initialize a few fields in there:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKnhjhhubh bullet_list)}(hhh](h list_item)}(hY``channels``: should be initialized as a list using the INIT_LIST_HEAD macro for example h]h)}(hX``channels``: should be initialized as a list using the INIT_LIST_HEAD macro for exampleh](j)}(h ``channels``h]hchannels}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj2ubhL: should be initialized as a list using the INIT_LIST_HEAD macro for example}(hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKrhj.ubah}(h]h ]h"]h$]h&]uh1j,hj)hhhhhNubj-)}(hU``src_addr_widths``: should contain a bitmask of the supported source transfer width h]h)}(hT``src_addr_widths``: should contain a bitmask of the supported source transfer widthh](j)}(h``src_addr_widths``h]hsrc_addr_widths}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjXubhA: should contain a bitmask of the supported source transfer width}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKuhjTubah}(h]h ]h"]h$]h&]uh1j,hj)hhhhhNubj-)}(hZ``dst_addr_widths``: should contain a bitmask of the supported destination transfer width h]h)}(hY``dst_addr_widths``: should contain a bitmask of the supported destination transfer widthh](j)}(h``dst_addr_widths``h]hdst_addr_widths}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj~ubhF: should contain a bitmask of the supported destination transfer width}(hj~hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKxhjzubah}(h]h ]h"]h$]h&]uh1j,hj)hhhhhNubj-)}(hn``directions``: should contain a bitmask of the supported slave directions (i.e. excluding mem2mem transfers) h]h)}(hm``directions``: should contain a bitmask of the supported slave directions (i.e. excluding mem2mem transfers)h](j)}(h``directions``h]h directions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh_: should contain a bitmask of the supported slave directions (i.e. excluding mem2mem transfers)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK{hjubah}(h]h ]h"]h$]h&]uh1j,hj)hhhhhNubj-)}(hX``residue_granularity``: granularity of the transfer residue reported to dma_set_residue. This can be either: - Descriptor: your device doesn't support any kind of residue reporting. The framework will only know that a particular transaction descriptor is done. - Segment: your device is able to report which chunks have been transferred - Burst: your device is able to report which burst have been transferred h](h)}(hm``residue_granularity``: granularity of the transfer residue reported to dma_set_residue. This can be either:h](j)}(h``residue_granularity``h]hresidue_granularity}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhV: granularity of the transfer residue reported to dma_set_residue. This can be either:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubj()}(hhh](j-)}(hDescriptor: your device doesn't support any kind of residue reporting. The framework will only know that a particular transaction descriptor is done. h]h)}(hDescriptor: your device doesn't support any kind of residue reporting. The framework will only know that a particular transaction descriptor is done.h]hDescriptor: your device doesn’t support any kind of residue reporting. The framework will only know that a particular transaction descriptor is done.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hJSegment: your device is able to report which chunks have been transferred h]h)}(hISegment: your device is able to report which chunks have been transferredh]hISegment: your device is able to report which chunks have been transferred}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hGBurst: your device is able to report which burst have been transferred h]h)}(hFBurst: your device is able to report which burst have been transferredh]hFBurst: your device is able to report which burst have been transferred}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]bullet-uh1j'hhhKhjubeh}(h]h ]h"]h$]h&]uh1j,hj)hhhNhNubj-)}(hf``dev``: should hold the pointer to the ``struct device`` associated to your current driver instance. h]h)}(he``dev``: should hold the pointer to the ``struct device`` associated to your current driver instance.h](j)}(h``dev``h]hdev}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh!: should hold the pointer to the }(hjChhhNhNubj)}(h``struct device``h]h struct device}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubh, associated to your current driver instance.}(hjChhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj?ubah}(h]h ]h"]h$]h&]uh1j,hj)hhhhhNubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhKrhjhhubeh}(h] struct-dma-device-initializationah ]h"] struct dma_device initializationah$]h&]uh1hhjhhhhhKhubh)}(hhh](h)}(hSupported transaction typesh]hSupported transaction types}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h\The next thing you need is to set which transaction types your device (and driver) supports.h]h\The next thing you need is to set which transaction types your device (and driver) supports.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hOur ``dma_device structure`` has a field called cap_mask that holds the various types of transaction supported, and you need to modify this mask using the dma_cap_set function, with various flags depending on transaction types you support as an argument.h](hOur }(hjhhhNhNubj)}(h``dma_device structure``h]hdma_device structure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh has a field called cap_mask that holds the various types of transaction supported, and you need to modify this mask using the dma_cap_set function, with various flags depending on transaction types you support as an argument.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hiAll those capabilities are defined in the ``dma_transaction_type enum``, in ``include/linux/dmaengine.h``h](h*All those capabilities are defined in the }(hjhhhNhNubj)}(h``dma_transaction_type enum``h]hdma_transaction_type enum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh, in }(hjhhhNhNubj)}(h``include/linux/dmaengine.h``h]hinclude/linux/dmaengine.h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h#Currently, the types available are:h]h#Currently, the types available are:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj()}(hhh](j-)}(hX:DMA_MEMCPY - The device is able to do memory to memory copies - No matter what the overall size of the combined chunks for source and destination is, only as many bytes as the smallest of the two will be transmitted. That means the number and size of the scatter-gather buffers in both lists need not be the same, and that the operation functionally is equivalent to a ``strncpy`` where the ``count`` argument equals the smallest total size of the two scatter-gather list buffers. - It's usually used for copying pixel data between host memory and memory-mapped GPU device memory, such as found on modern PCI video graphics cards. The most immediate example is the OpenGL API function ``glReadPielx()``, which might require a verbatim copy of a huge framebuffer from local device memory onto host memory. h](h)}(h DMA_MEMCPYh]h DMA_MEMCPY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj()}(hhh](j-)}(h1The device is able to do memory to memory copies h]h)}(h0The device is able to do memory to memory copiesh]h0The device is able to do memory to memory copies}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hXNo matter what the overall size of the combined chunks for source and destination is, only as many bytes as the smallest of the two will be transmitted. That means the number and size of the scatter-gather buffers in both lists need not be the same, and that the operation functionally is equivalent to a ``strncpy`` where the ``count`` argument equals the smallest total size of the two scatter-gather list buffers. h]h)}(hXNo matter what the overall size of the combined chunks for source and destination is, only as many bytes as the smallest of the two will be transmitted. That means the number and size of the scatter-gather buffers in both lists need not be the same, and that the operation functionally is equivalent to a ``strncpy`` where the ``count`` argument equals the smallest total size of the two scatter-gather list buffers.h](hX1No matter what the overall size of the combined chunks for source and destination is, only as many bytes as the smallest of the two will be transmitted. That means the number and size of the scatter-gather buffers in both lists need not be the same, and that the operation functionally is equivalent to a }(hj4hhhNhNubj)}(h ``strncpy``h]hstrncpy}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubh where the }(hj4hhhNhNubj)}(h ``count``h]hcount}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj4ubhP argument equals the smallest total size of the two scatter-gather list buffers.}(hj4hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj0ubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hXBIt's usually used for copying pixel data between host memory and memory-mapped GPU device memory, such as found on modern PCI video graphics cards. The most immediate example is the OpenGL API function ``glReadPielx()``, which might require a verbatim copy of a huge framebuffer from local device memory onto host memory. h]h)}(hXAIt's usually used for copying pixel data between host memory and memory-mapped GPU device memory, such as found on modern PCI video graphics cards. The most immediate example is the OpenGL API function ``glReadPielx()``, which might require a verbatim copy of a huge framebuffer from local device memory onto host memory.h](hIt’s usually used for copying pixel data between host memory and memory-mapped GPU device memory, such as found on modern PCI video graphics cards. The most immediate example is the OpenGL API function }(hjphhhNhNubj)}(h``glReadPielx()``h]h glReadPielx()}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjpubhf, which might require a verbatim copy of a huge framebuffer from local device memory onto host memory.}(hjphhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjlubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhjubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hDMA_XOR - The device is able to perform XOR operations on memory areas - Used to accelerate XOR intensive tasks, such as RAID5 h](h)}(hDMA_XORh]hDMA_XOR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj()}(hhh](j-)}(h=The device is able to perform XOR operations on memory areas h]h)}(hubah}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhj,ubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hnDMA_PQ_VAL - The device is able to perform parity check using RAID6 P+Q algorithm against a memory buffer. h](h)}(h DMA_PQ_VALh]h DMA_PQ_VAL}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjeubj()}(hhh]j-)}(h^The device is able to perform parity check using RAID6 P+Q algorithm against a memory buffer. h]h)}(h]The device is able to perform parity check using RAID6 P+Q algorithm against a memory buffer.h]h]The device is able to perform parity check using RAID6 P+Q algorithm against a memory buffer.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjzubah}(h]h ]h"]h$]h&]uh1j,hjwubah}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhjeubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hDMA_MEMSET - The device is able to fill memory with the provided pattern - The pattern is treated as a single byte signed value. h](h)}(h DMA_MEMSETh]h DMA_MEMSET}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj()}(hhh](j-)}(hDMA_CYCLIC - The device can handle cyclic transfers. - A cyclic transfer is a transfer where the chunk collection will loop over itself, with the last item pointing to the first. - It's usually used for audio transfers, where you want to operate on a single ring buffer that you will fill with your audio data. h](h)}(h DMA_CYCLICh]h DMA_CYCLIC}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3ubj()}(hhh](j-)}(h(The device can handle cyclic transfers. h]h)}(h'The device can handle cyclic transfers.h]h'The device can handle cyclic transfers.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjHubah}(h]h ]h"]h$]h&]uh1j,hjEubj-)}(h|A cyclic transfer is a transfer where the chunk collection will loop over itself, with the last item pointing to the first. h]h)}(h{A cyclic transfer is a transfer where the chunk collection will loop over itself, with the last item pointing to the first.h]h{A cyclic transfer is a transfer where the chunk collection will loop over itself, with the last item pointing to the first.}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`ubah}(h]h ]h"]h$]h&]uh1j,hjEubj-)}(hIt's usually used for audio transfers, where you want to operate on a single ring buffer that you will fill with your audio data. h]h)}(hIt's usually used for audio transfers, where you want to operate on a single ring buffer that you will fill with your audio data.h]hIt’s usually used for audio transfers, where you want to operate on a single ring buffer that you will fill with your audio data.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjxubah}(h]h ]h"]h$]h&]uh1j,hjEubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhj3ubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hXDMA_INTERLEAVE - The device supports interleaved transfer. - These transfers can transfer data from a non-contiguous buffer to a non-contiguous buffer, opposed to DMA_SLAVE that can transfer data from a non-contiguous data set to a continuous destination buffer. - It's usually used for 2d content transfers, in which case you want to transfer a portion of uncompressed data directly to the display to print it h](h)}(hDMA_INTERLEAVEh]hDMA_INTERLEAVE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj()}(hhh](j-)}(h*The device supports interleaved transfer. h]h)}(h)The device supports interleaved transfer.h]h)The device supports interleaved transfer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hThese transfers can transfer data from a non-contiguous buffer to a non-contiguous buffer, opposed to DMA_SLAVE that can transfer data from a non-contiguous data set to a continuous destination buffer. h]h)}(hThese transfers can transfer data from a non-contiguous buffer to a non-contiguous buffer, opposed to DMA_SLAVE that can transfer data from a non-contiguous data set to a continuous destination buffer.h]hThese transfers can transfer data from a non-contiguous buffer to a non-contiguous buffer, opposed to DMA_SLAVE that can transfer data from a non-contiguous data set to a continuous destination buffer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hIt's usually used for 2d content transfers, in which case you want to transfer a portion of uncompressed data directly to the display to print it h]h)}(hIt's usually used for 2d content transfers, in which case you want to transfer a portion of uncompressed data directly to the display to print ith]hIt’s usually used for 2d content transfers, in which case you want to transfer a portion of uncompressed data directly to the display to print it}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhjubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hXDMA_COMPLETION_NO_ORDER - The device does not support in order completion. - The driver should return DMA_OUT_OF_ORDER for device_tx_status if the device is setting this capability. - All cookie tracking and checking API should be treated as invalid if the device exports this capability. - At this point, this is incompatible with polling option for dmatest. - If this cap is set, the user is recommended to provide an unique identifier for each descriptor sent to the DMA device in order to properly track the completion. h](h)}(hDMA_COMPLETION_NO_ORDERh]hDMA_COMPLETION_NO_ORDER}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj()}(hhh](j-)}(h1The device does not support in order completion. h]h)}(h0The device does not support in order completion.h]h0The device does not support in order completion.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hiThe driver should return DMA_OUT_OF_ORDER for device_tx_status if the device is setting this capability. h]h)}(hhThe driver should return DMA_OUT_OF_ORDER for device_tx_status if the device is setting this capability.h]hhThe driver should return DMA_OUT_OF_ORDER for device_tx_status if the device is setting this capability.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj2ubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hiAll cookie tracking and checking API should be treated as invalid if the device exports this capability. h]h)}(hhAll cookie tracking and checking API should be treated as invalid if the device exports this capability.h]hhAll cookie tracking and checking API should be treated as invalid if the device exports this capability.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjJubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hEAt this point, this is incompatible with polling option for dmatest. h]h)}(hDAt this point, this is incompatible with polling option for dmatest.h]hDAt this point, this is incompatible with polling option for dmatest.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjbubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hIf this cap is set, the user is recommended to provide an unique identifier for each descriptor sent to the DMA device in order to properly track the completion. h]h)}(hIf this cap is set, the user is recommended to provide an unique identifier for each descriptor sent to the DMA device in order to properly track the completion.h]hIf this cap is set, the user is recommended to provide an unique identifier for each descriptor sent to the DMA device in order to properly track the completion.}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjzubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhMhjubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hX'DMA_REPEAT - The device supports repeated transfers. A repeated transfer, indicated by the DMA_PREP_REPEAT transfer flag, is similar to a cyclic transfer in that it gets automatically repeated when it ends, but can additionally be replaced by the client. - This feature is limited to interleaved transfers, this flag should thus not be set if the DMA_INTERLEAVE flag isn't set. This limitation is based on the current needs of DMA clients, support for additional transfer types should be added in the future if and when the need arises. h](h)}(h DMA_REPEATh]h DMA_REPEAT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj()}(hhh](j-)}(hThe device supports repeated transfers. A repeated transfer, indicated by the DMA_PREP_REPEAT transfer flag, is similar to a cyclic transfer in that it gets automatically repeated when it ends, but can additionally be replaced by the client. h]h)}(hThe device supports repeated transfers. A repeated transfer, indicated by the DMA_PREP_REPEAT transfer flag, is similar to a cyclic transfer in that it gets automatically repeated when it ends, but can additionally be replaced by the client.h]hThe device supports repeated transfers. A repeated transfer, indicated by the DMA_PREP_REPEAT transfer flag, is similar to a cyclic transfer in that it gets automatically repeated when it ends, but can additionally be replaced by the client.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubj-)}(hXThis feature is limited to interleaved transfers, this flag should thus not be set if the DMA_INTERLEAVE flag isn't set. This limitation is based on the current needs of DMA clients, support for additional transfer types should be added in the future if and when the need arises. h]h)}(hXThis feature is limited to interleaved transfers, this flag should thus not be set if the DMA_INTERLEAVE flag isn't set. This limitation is based on the current needs of DMA clients, support for additional transfer types should be added in the future if and when the need arises.h]hXThis feature is limited to interleaved transfers, this flag should thus not be set if the DMA_INTERLEAVE flag isn’t set. This limitation is based on the current needs of DMA clients, support for additional transfer types should be added in the future if and when the need arises.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j,hjubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhMhjubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubj-)}(hXmDMA_LOAD_EOT - The device supports replacing repeated transfers at end of transfer (EOT) by queuing a new transfer with the DMA_PREP_LOAD_EOT flag set. - Support for replacing a currently running transfer at another point (such as end of burst instead of end of transfer) will be added in the future based on DMA clients needs, if and when the need arises. h](h)}(h DMA_LOAD_EOTh]h DMA_LOAD_EOT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM!hjubj()}(hhh](j-)}(hThe device supports replacing repeated transfers at end of transfer (EOT) by queuing a new transfer with the DMA_PREP_LOAD_EOT flag set. h]h)}(hThe device supports replacing repeated transfers at end of transfer (EOT) by queuing a new transfer with the DMA_PREP_LOAD_EOT flag set.h]hThe device supports replacing repeated transfers at end of transfer (EOT) by queuing a new transfer with the DMA_PREP_LOAD_EOT flag set.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM#hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubj-)}(hSupport for replacing a currently running transfer at another point (such as end of burst instead of end of transfer) will be added in the future based on DMA clients needs, if and when the need arises. h]h)}(hSupport for replacing a currently running transfer at another point (such as end of burst instead of end of transfer) will be added in the future based on DMA clients needs, if and when the need arises.h]hSupport for replacing a currently running transfer at another point (such as end of burst instead of end of transfer) will be added in the future based on DMA clients needs, if and when the need arises.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hj ubah}(h]h ]h"]h$]h&]uh1j,hj ubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhM#hjubeh}(h]h ]h"]h$]h&]uh1j,hjhhhNhNubeh}(h]h ]h"]h$]h&]j7j8uh1j'hhhKhjhhubh)}(h_These various types will also affect how the source and destination addresses change over time.h]h_These various types will also affect how the source and destination addresses change over time.}(hjF hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM*hjhhubh)}(hAddresses pointing to RAM are typically incremented (or decremented) after each transfer. In case of a ring buffer, they may loop (DMA_CYCLIC). Addresses pointing to a device's register (e.g. a FIFO) are typically fixed.h]hAddresses pointing to RAM are typically incremented (or decremented) after each transfer. In case of a ring buffer, they may loop (DMA_CYCLIC). Addresses pointing to a device’s register (e.g. a FIFO) are typically fixed.}(hjT hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjhhubeh}(h]supported-transaction-typesah ]h"]supported transaction typesah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hPer descriptor metadata supporth]hPer descriptor metadata support}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjj hhhhhM3ubh)}(hXLSome data movement architecture (DMA controller and peripherals) uses metadata associated with a transaction. The DMA controller role is to transfer the payload and the metadata alongside. The metadata itself is not used by the DMA engine itself, but it contains parameters, keys, vectors, etc for peripheral or from the peripheral.h]hXLSome data movement architecture (DMA controller and peripherals) uses metadata associated with a transaction. The DMA controller role is to transfer the payload and the metadata alongside. The metadata itself is not used by the DMA engine itself, but it contains parameters, keys, vectors, etc for peripheral or from the peripheral.}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hjj hhubh)}(hThe DMAengine framework provides a generic ways to facilitate the metadata for descriptors. Depending on the architecture the DMA driver can implement either or both of the methods and it is up to the client driver to choose which one to use.h]hThe DMAengine framework provides a generic ways to facilitate the metadata for descriptors. Depending on the architecture the DMA driver can implement either or both of the methods and it is up to the client driver to choose which one to use.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM:hjj hhubj()}(hhh](j-)}(hXDESC_METADATA_CLIENT The metadata buffer is allocated/provided by the client driver and it is attached (via the dmaengine_desc_attach_metadata() helper to the descriptor. From the DMA driver the following is expected for this mode: - DMA_MEM_TO_DEV / DEV_MEM_TO_MEM The data from the provided metadata buffer should be prepared for the DMA controller to be sent alongside of the payload data. Either by copying to a hardware descriptor, or highly coupled packet. - DMA_DEV_TO_MEM On transfer completion the DMA driver must copy the metadata to the client provided metadata buffer before notifying the client about the completion. After the transfer completion, DMA drivers must not touch the metadata buffer provided by the client. h](h)}(hDESC_METADATA_CLIENTh]hDESC_METADATA_CLIENT}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM?hj ubh)}(hThe metadata buffer is allocated/provided by the client driver and it is attached (via the dmaengine_desc_attach_metadata() helper to the descriptor.h]hThe metadata buffer is allocated/provided by the client driver and it is attached (via the dmaengine_desc_attach_metadata() helper to the descriptor.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMAhj ubh)}(h