AM64x MCU+ SDK  08.02.00

Introduction

This is UDMA driver init, deinit and common API.

Files

file  udma.h
 UDMA Driver API/interface file.
 

Data Structures

struct  Udma_InitPrms
 UDMA initialization parameters. More...
 
struct  Udma_DrvObject
 Opaque UDMA driver object. More...
 

Functions

int32_t Udma_init (Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms)
 UDMA init function. More...
 
int32_t Udma_deinit (Udma_DrvHandle drvHandle)
 UDMA deinit function. More...
 
int32_t UdmaInitPrms_init (uint32_t instId, Udma_InitPrms *initPrms)
 Udma_InitPrms structure init function. More...
 
uint64_t Udma_defaultVirtToPhyFxn (const void *virtAddr, uint32_t chNum, void *appData)
 Default virtual to physical translation function. More...
 
void * Udma_defaultPhyToVirtFxn (uint64_t phyAddr, uint32_t chNum, void *appData)
 Default physical to virtual translation function. More...
 

Typedefs

typedef uint64_t(* Udma_VirtToPhyFxn) (const void *virtAddr, uint32_t chNum, void *appData)
 UDMA Virtual to Physical address translation callback function. More...
 
typedef void *(* Udma_PhyToVirtFxn) (uint64_t phyAddr, uint32_t chNum, void *appData)
 UDMA Physical to Virtual address translation callback function. More...
 

Typedef Documentation

◆ Udma_VirtToPhyFxn

typedef uint64_t(* Udma_VirtToPhyFxn) (const void *virtAddr, uint32_t chNum, void *appData)

UDMA Virtual to Physical address translation callback function.

This function is used by the driver to convert virtual address to physical address.

Parameters
virtAddr[IN] Virtual address
chNum[IN] Channel number passed during channel open
appData[IN] Callback pointer passed during channel open
Returns
Corresponding physical address

◆ Udma_PhyToVirtFxn

typedef void*(* Udma_PhyToVirtFxn) (uint64_t phyAddr, uint32_t chNum, void *appData)

UDMA Physical to Virtual address translation callback function.

This function is used by the driver to convert physical address to virtual address.

Parameters
phyAddr[IN] Physical address
chNum[IN] Channel number passed during channel open
appData[IN] Callback pointer passed during channel open
Returns
Corresponding virtual address

Function Documentation

◆ Udma_init()

int32_t Udma_init ( Udma_DrvHandle  drvHandle,
const Udma_InitPrms initPrms 
)

UDMA init function.

Initializes the UDMA drivers. This function should be called before calling any of driver API's and should be called only once.

Requirement: DOX_REQ_TAG(PDK-2576)

Parameters
drvHandle[IN] UDMA driver handle - static memory needs to allocated by caller. This is used by the driver to maintain the driver states. This cannot be NULL.
initPrms[IN] UDMA Initialization parameters. If NULL is passed, the default parameters will be assumed - address translation disabled.
Returns
Udma_ErrorCodes

◆ Udma_deinit()

int32_t Udma_deinit ( Udma_DrvHandle  drvHandle)

UDMA deinit function.

Uninitializes the drivers and the hardware and should be called during system shutdown. Should not be called if Udma_init() is not called.

Requirement: DOX_REQ_TAG(PDK-2577)

Parameters
drvHandle[IN] UDMA driver handle pointer passed during Udma_init
Returns
Udma_ErrorCodes

◆ UdmaInitPrms_init()

int32_t UdmaInitPrms_init ( uint32_t  instId,
Udma_InitPrms initPrms 
)

Udma_InitPrms structure init function.

Note: API returns error when there is a failure in intilaizing RM parameters. This can be due to the following reasons:

  • Wrong entry for resources in Default Board Cfg (Sciclient_defaultBoardCfg_rm.c)
  • Number of resources reserved in Default Board Cfg is less than the 'minumum requirement' specified as per UDMA RM Shared resource parameters Udma_RmSharedResPrms. In this case, user should reserve more resources in Default Board Cfg OR override the default UDMA RM Shared resource parameters. (Use Udma_rmGetSharedResPrms API to get default UDMA RM Shared resource parameters)
  • Total number of resources requested for each instance as per UDMA RM Shared resource parameters is greater than the number of resorurces reserved in Default Board Cfg. In this case, user should reduce the requested share for each instance in UDMA RM Shared resource parameters.
Parameters
instId[IN] Udma_InstanceIdSoc
initPrms[IN] Pointer to Udma_InitPrms structure.
Returns
Udma_ErrorCodes

◆ Udma_defaultVirtToPhyFxn()

uint64_t Udma_defaultVirtToPhyFxn ( const void *  virtAddr,
uint32_t  chNum,
void *  appData 
)

Default virtual to physical translation function.

Parameters
virtAddr[IN] Virtual address
chNum[IN] Channel number passed during channel open. Note: When called for functions which is not channel dependent (like ring alloc), this parameter will be set to UDMA_DMA_CH_INVALID.
appData[IN] Callback pointer passed during channel open. Note: When called for functions which is not channel dependent (like ring alloc), this parameter will be set to NULL.
Returns
Corresponding physical address

◆ Udma_defaultPhyToVirtFxn()

void* Udma_defaultPhyToVirtFxn ( uint64_t  phyAddr,
uint32_t  chNum,
void *  appData 
)

Default physical to virtual translation function.

Parameters
phyAddr[IN] Physical address
chNum[IN] Channel number passed during channel open. Note: When called for functions which is not channel dependent (like ring alloc), this parameter will be set to UDMA_DMA_CH_INVALID.
appData[IN] Callback pointer passed during channel open. Note: When called for functions which is not channel dependent (like ring alloc), this parameter will be set to NULL.
Returns
Corresponding virtual address