![]() |
RTEMS 7.0-rc1
|
Raspberry Pi specific DMA definitions. More...
#include <bsp/raspberrypi-dma.h>Data Structures | |
| struct | rpi_dma_control_block |
| struct | rpi_dma_lite_control_block |
| struct | rpi_dma4_control_block |
Functions | |
| rtems_status_code | rpi_dma_start_transfer (rpi_dma_channel channel) |
| Start a previously initialized DMA transfer on channel. | |
| rtems_status_code | rpi_dma_wait (rpi_dma_channel channel) |
| Block until the current DMA transfer on channel completes. | |
| rtems_status_code | rpi_dma_mem_to_mem_init (rpi_dma_channel channel, void *source_address, void *destination_address, uint32_t transfer_length) |
| Initialize a memcpy-style DMA transfer from source_address to destination_address of transfer_length bytes on channel. | |
Raspberry Pi specific DMA definitions.
| rtems_status_code rpi_dma_mem_to_mem_init | ( | rpi_dma_channel | channel, |
| void * | source_address, | ||
| void * | destination_address, | ||
| uint32_t | transfer_length | ||
| ) |
Initialize a memcpy-style DMA transfer from source_address to destination_address of transfer_length bytes on channel.
Allocates and prepares the channel-specific control block, performs required cache maintenance (flush control block and source; invalidate destination), issues CS reset/abort, and writes CONBLK_AD (with DMA4 address packing via DMA4_AD_SHIFT). This function does not start the transfer; call rpi_dma_start_transfer() and then rpi_dma_wait().
| channel | DMA channel to use (0–6 noarmal DMA, 7–10 lite, 11–14 DMA4). |
| source_address | Source buffer (must be CPU_CACHE_LINE_BYTES aligned). |
| destination_address | Destination buffer (must be CPU_CACHE_LINE_BYTES aligned). |
| transfer_length | Number of bytes to copy. |
| RTEMS_SUCCESSFUL | on success. |
| RTEMS_INVALID_NUMBER | if channel is invalid/unsupported or has no base address. |
| RTEMS_INVALID_ADDRESS | if source_address or destination_address are misaligned. |
| RTEMS_NO_MEMORY | if control block allocation failed. |
| rtems_status_code rpi_dma_start_transfer | ( | rpi_dma_channel | channel | ) |
Start a previously initialized DMA transfer on channel.
Expects the channel's CONBLK_AD to point to a valid control block. Sets ACTIVE and required priorities.
| channel | DMA channel to start. |
| RTEMS_SUCCESSFUL | on success. |
| RTEMS_INVALID_NUMBER | if channel is invalid. |
| rtems_status_code rpi_dma_wait | ( | rpi_dma_channel | channel | ) |
Block until the current DMA transfer on channel completes.
Busy-waits for ACTIVE to clear and frees the control block previously programmed into CONBLK_AD (including DMA4 address unshifting). Does not invalidate/flush user buffers beyond setup done by the init helpers.
| channel | DMA channel to wait on. |
| RTEMS_SUCCESSFUL | on success. |
| RTEMS_INVALID_NUMBER | if channel is invalid. |
| RTEMS_UNSATISFIED | if the channel reports an error. |