![]() |
RTEMS 7.0-rc1
|
Raspberry Pi specific DMA definitions. More...
#include <bsp/raspberrypi.h>#include <bsp/rpi-gpio.h>#include <bsp/utility.h>#include <rtems/malloc.h>#include <rtems/rtems/cache.h>#include <rtems/score/basedefs.h>#include <rtems/score/cpu.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Enumerations | |
| enum | rpi_dma_channel { DMA_CHANNEL_0 , DMA_CHANNEL_1 , DMA_CHANNEL_2 , DMA_CHANNEL_3 , DMA_CHANNEL_4 , DMA_CHANNEL_5 , DMA_CHANNEL_6 , DMA_LITE_CHANNEL_7 , DMA_LITE_CHANNEL_8 , DMA_LITE_CHANNEL_9 , DMA_LITE_CHANNEL_10 , DMA4_CHANNEL_11 , DMA4_CHANNEL_12 , DMA4_CHANNEL_13 , DMA4_CHANNEL_14 } |
| DMA channel identifiers for BCM2711 (0–6 full, 7–10 lite, 11–14 DMA4). | |
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. |