![]() |
PDK API Guide for J721E
|
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_DrvHandle |
| 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... | |
| static uint64_t | Udma_defaultVirtToPhyFxn (const void *virtAddr, uint32_t chNum, void *appData) |
| Default virtual to physical translation function. More... | |
| static 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 void(* | Udma_PrintFxn) (const char *str) |
| UDMA info/debug print function prototype. More... | |
UDMA Ring Local API's function prototypes | |
|
Function prototypes for various local UDMA Ring API's. For Normal RA / LCDMA RA, function pointers will be used to call the appropriate function. | |
| typedef void(* | Udma_ringHandleClearRegsFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring handle clear register function prototype. More... | |
| typedef void(* | Udma_ringSetDoorBellFxn) (Udma_RingHandle ringHandle, int32_t count) |
| UDMA Ring set doorbell function prototype. More... | |
| typedef void(* | Udma_ringPrimeFxn) (Udma_RingHandle ringHandle, uint64_t phyDescMem) |
| UDMA Ring prime function prototype. More... | |
| typedef void(* | Udma_ringPrimeReadFxn) (Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
| UDMA Ring prime read function prototype. More... | |
| typedef void *(* | Udma_ringGetMemPtrFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get mem pointer function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetModeFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get ring mode function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetElementCntFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get element count function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetForwardRingOccFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get forward ring occupancy function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetReverseRingOccFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get reverse ring occupancy function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetWrIdxFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get write index value function prototype. More... | |
| typedef uint32_t(* | Udma_ringGetRdIdxFxn) (Udma_RingHandle ringHandle) |
| UDMA Ring get read index value function prototype. More... | |
| typedef int32_t(* | Udma_ringDequeueRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
| UDMA Ring dequeue raw function prototype. More... | |
| typedef int32_t(* | Udma_ringQueueRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t phyDescMem) |
| UDMA Ring queue raw function prototype. More... | |
| typedef int32_t(* | Udma_ringFlushRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
| UDMA Ring flush raw function prototype. More... | |
| typedef void(* | Udma_ringSetCfgFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, const Udma_RingPrms *ringPrms) |
| UDMA Ring set Cfg function prototype. More... | |
| 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.
| virtAddr | [IN] Virtual address |
| chNum | [IN] Channel number passed during channel open |
| appData | [IN] Callback pointer passed during channel open |
| 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.
| phyAddr | [IN] Physical address |
| chNum | [IN] Channel number passed during channel open |
| appData | [IN] Callback pointer passed during channel open |
| typedef void(* Udma_PrintFxn) (const char *str) |
UDMA info/debug print function prototype.
This function is used by the driver to print info/debug messages.
| str | [OUT] Info string to print. |
| typedef void(* Udma_ringHandleClearRegsFxn) (Udma_RingHandle ringHandle) |
UDMA Ring handle clear register function prototype.
| typedef void(* Udma_ringSetDoorBellFxn) (Udma_RingHandle ringHandle, int32_t count) |
UDMA Ring set doorbell function prototype.
| typedef void(* Udma_ringPrimeFxn) (Udma_RingHandle ringHandle, uint64_t phyDescMem) |
UDMA Ring prime function prototype.
| typedef void(* Udma_ringPrimeReadFxn) (Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
UDMA Ring prime read function prototype.
| typedef void*(* Udma_ringGetMemPtrFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get mem pointer function prototype.
| typedef uint32_t(* Udma_ringGetModeFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get ring mode function prototype.
| typedef uint32_t(* Udma_ringGetElementCntFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get element count function prototype.
| typedef uint32_t(* Udma_ringGetForwardRingOccFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get forward ring occupancy function prototype.
| typedef uint32_t(* Udma_ringGetReverseRingOccFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get reverse ring occupancy function prototype.
| typedef uint32_t(* Udma_ringGetWrIdxFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get write index value function prototype.
| typedef uint32_t(* Udma_ringGetRdIdxFxn) (Udma_RingHandle ringHandle) |
UDMA Ring get read index value function prototype.
| typedef int32_t(* Udma_ringDequeueRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
UDMA Ring dequeue raw function prototype.
| typedef int32_t(* Udma_ringQueueRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t phyDescMem) |
UDMA Ring queue raw function prototype.
| typedef int32_t(* Udma_ringFlushRawFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, uint64_t *phyDescMem) |
UDMA Ring flush raw function prototype.
| typedef void(* Udma_ringSetCfgFxn) (Udma_DrvHandle drvHandle, Udma_RingHandle ringHandle, const Udma_RingPrms *ringPrms) |
UDMA Ring set Cfg function prototype.
| 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)
| 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. |
| 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)
| drvHandle | [IN] UDMA driver handle pointer passed during Udma_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 Udma_RmInitPrms. This can be due to the following reasons:
| instId | [IN] Udma_InstanceIdSoc |
| initPrms | [IN] Pointer to Udma_InitPrms structure. |
|
inlinestatic |
Default virtual to physical translation function.
| 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. |
|
inlinestatic |
Default physical to virtual translation function.
| 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. |