|
AM64x MCU+ SDK
08.02.00
|
|
The UDMA driver provides API to program the DMA module of the DMSS subsystem to setup and initiate DMA transfers.
Features Supported
- Supports both BCDMA and Packet DMA instances
- Supports all DMA operations from both instances from all the cores in the SOC except M4F core
- UDMA block copy for memory to memory transfer
- PDMA module to initiate transfers to/from PDMA peripherals like UART, McASP, McSPI, ADC, MCAN
- DMA transfer to/from from native PSIL peripherals like CPSW, SA2UL
- Event and interrupt management like DMA completion, channel chaining, interrupt sharing using Interrupt Aggregator (IA)
- Resources management across instances and cores for DMA channels, RX flow, Interrupt Aggregator (IA), Interrupt Routers (IR), Global events, Ring Accelerator (RA)
- Interaction with DMSC RM module via SCICLIENT for all non-RealTime (NRT) configuration
SysConfig Features
- Note
- It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
- Selection of UDMA instances - BCDMA, PKTDMA
- Option to skip default global event registration done as part of Udma_init API
- Option to provide user function for virtual to physical and physical to virtual address translation
- Ability of add and configure BCDMA block copy channels
- Ability to enable interrupt mode for the channel
- Ability to specify the number of ring entries for the channel
- Based on above parameters, the SysConfig generated code does below as part of Drivers_open and Drivers_close functions
- Channel open/close - the handle can be retrieved by the application using g<User_Config_Name>BlkCopyChHandle global variable
- Set default channel configuration
- Allocates required ring memories and pass them to channel configuration
- Register user specified callback when interrupt mode is enabled
Features NOT Supported
- UDMA driver is not supported for M4F core as the DMSS is present only in the main domain
Important Usage Guidelines
- UDMA driver doesn't manage/allocate the descriptor and RA memory. The caller need to allocate and provide the required memory.
- UDMA driver doesn't use any global variables. All the required object memory like channel, driver instance, event etc should be allocated by the caller
Additional Documentation
Example Usage
Include the below file to access the APIs
Channel Open Example
int32_t retVal;
uint32_t chType;
retVal =
Udma_chOpen(drvHandle, chHandle, chType, &chPrms);
{
printf("[Error] UDMA channel open failed!!\r\n");
}
{
printf("[Error] UDMA TX channel config failed!!\r\n");
}
{
printf("[Error] UDMA RX channel config failed!!\r\n");
}
{
printf("[Error] UDMA channel enable failed!!\r\n");
}
Channel Close Example
int32_t retVal;
{
printf("[Error] UDMA channel disable failed!!\r\n");
}
{
printf("[Error] UDMA channel close failed!!\r\n");
}
API
APIs for UDMA
UDMA TX channel parameters.
Definition: udma_ch.h:263
UDMA channel open parameters.
Definition: udma_ch.h:203
int32_t Udma_chOpen(Udma_DrvHandle drvHandle, Udma_ChHandle chHandle, uint32_t chType, const Udma_ChPrms *chPrms)
UDMA open channel.
int32_t Udma_chEnable(Udma_ChHandle chHandle)
UDMA channel enable API.
void * Udma_ChHandle
UDMA channel handle.
Definition: udma_types.h:67
UDMA RX channel parameters.
Definition: udma_ch.h:336
int32_t Udma_chDisable(Udma_ChHandle chHandle, uint32_t timeout)
UDMA channel teardown and disable API.
#define UDMA_DEFAULT_CH_DISABLE_TIMEOUT
Default UDMA channel disable timeout.
Definition: udma_types.h:82
Udma_RingPrms fqRingPrms
Definition: udma_ch.h:243
int32_t Udma_chConfigTx(Udma_ChHandle chHandle, const Udma_ChTxPrms *txPrms)
UDMA configure TX channel.
void UdmaChPrms_init(Udma_ChPrms *chPrms, uint32_t chType)
Udma_ChPrms structure init function.
#define UDMA_CH_TYPE_TR_BLK_COPY
TR block copy type - TX/RX pair.
Definition: udma_ch.h:125
uint32_t ringMemSize
Definition: udma_ring.h:132
void UdmaChTxPrms_init(Udma_ChTxPrms *txPrms, uint32_t chType)
Udma_ChTxPrms structure init function.
void UdmaChRxPrms_init(Udma_ChRxPrms *rxPrms, uint32_t chType)
Udma_ChRxPrms structure init function.
UDMA Driver API/interface file.
int32_t Udma_chClose(Udma_ChHandle chHandle)
UDMA close channel.
uint32_t elemCnt
Definition: udma_ring.h:143
void * ringMem
Definition: udma_ring.h:125
#define UDMA_SOK
API call successful.
Definition: udma_types.h:93
int32_t Udma_chConfigRx(Udma_ChHandle chHandle, const Udma_ChRxPrms *rxPrms)
UDMA configure RX channel.