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... | |
Macros | |
#define | QNX_OS |
#define | BUILD_MPU1_0 |
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... | |
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... | |
This is UDMA driver init, deinit and common API.
#define QNX_OS |
#define BUILD_MPU1_0 |
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. |
uint32_t Udma_InitPrms::instId |
[IN] Udma_InstanceIdSoc
Udma_RmInitPrms Udma_InitPrms::rmInitPrms |
RM init parameters
uint32_t Udma_InitPrms::skipRmOverlapCheck |
Skips the resource overlap check - useful when running from pre-silicon environment as well as in production code when the resource overlap is already checked
uint32_t Udma_InitPrms::skipGlobalEventReg |
Skips the global event registeration for the handle. By default this is set to UFALSE and application can use this common handle to set the master event to limit the number of IA/IR registration per core This can be set to UTRUE to skip this registration as in the case of having multiple handles per core in usecases
Udma_VirtToPhyFxn Udma_InitPrms::virtToPhyFxn |
If not NULL, this function will be called to convert virtual address to physical address to be provided to UDMA. If NULL, the driver will assume a one-one mapping.
Note: The init fxn will initialize this to the default one-one map function Udma_defaultVirtToPhyFxn
Udma_PhyToVirtFxn Udma_InitPrms::phyToVirtFxn |
If not NULL, this function will be called to convert physical address to virtual address to access the pointer returned by the UDMA. If NULL, the driver will assume a one-one mapping.
Note: The init fxn will initialize this to the default one-one map function Udma_defaultPhyToVirtFxn
Udma_PrintFxn Udma_InitPrms::printFxn |
If not NULL, this function will be called to print debug/info message with appropriate string.
Udma_OsalPrms Udma_InitPrms::osalPrms |
OSAL callback parameters
uint32_t Udma_InitPrms::isQnxRMInstance |
If 1 this is passed in from the Qnx resource manager
uint32_t Udma_InitPrms::intrPriority |
Lets the app set a priority for the udma interrupt thread
uint32_t Udma_DrvHandle::instType |
Udma Instance Type
uint32_t Udma_DrvHandle::raType |
Udma Ring Accelerator Type RA register configuration
CSL_IntaggrCfg Udma_DrvHandle::iaRegs |
Interrupt Aggregator configuration
uint32_t Udma_DrvHandle::udmapSrcThreadOffset |
UDMAP Source/TX thread offset
uint32_t Udma_DrvHandle::udmapDestThreadOffset |
UDMAP Dest/RX thread offset
uint32_t Udma_DrvHandle::maxRings |
Maximun number of rings present in the NAVSS instance
uint32_t Udma_DrvHandle::maxProxy |
Maximun number of proxy present in the NAVSS instance
uint32_t Udma_DrvHandle::maxRingMon |
Maximun number of ring monitors present in the NAVSS instance
uint16_t Udma_DrvHandle::devIdRing |
Ring RM ID
uint16_t Udma_DrvHandle::devIdUdma |
UDMA RM ID
uint16_t Udma_DrvHandle::devIdPsil |
PSIL RM ID
uint16_t Udma_DrvHandle::devIdIa |
IA RM ID
uint16_t Udma_DrvHandle::devIdIr |
IR RM ID
uint16_t Udma_DrvHandle::devIdDummyEvtSrc |
RM ID of Event Source not having OES registers
uint16_t Udma_DrvHandle::devIdCore |
Core RM ID
uint16_t Udma_DrvHandle::srcIdRingIrq |
Ring completion event IRQ Source ID.
uint16_t Udma_DrvHandle::blkCopyRingIrqOffset |
Block Copy channel ring completion event IRQ offset.
uint16_t Udma_DrvHandle::txRingIrqOffset |
TX channel ring completion event IRQ offset.
uint16_t Udma_DrvHandle::rxRingIrqOffset |
RX channel ring completion event IRQ offset.
uint16_t Udma_DrvHandle::srcIdTrIrq |
TR event IRQ Source ID.
uint16_t Udma_DrvHandle::blkCopyTrIrqOffset |
Block Copy channel TR event IRQ offset.
uint16_t Udma_DrvHandle::txTrIrqOffset |
TX channel TR event IRQ offset.
uint16_t Udma_DrvHandle::rxTrIrqOffset |
RX channel TR event IRQ offset.
uint32_t Udma_DrvHandle::txChOffset |
TX channel offset.
uint32_t Udma_DrvHandle::extChOffset |
External channel offset.
uint32_t Udma_DrvHandle::rxChOffset |
RX channel offset.
uint32_t Udma_DrvHandle::iaGemOffset |
IA global event map offset to differentiate between main and MCU NAVSS
uint32_t Udma_DrvHandle::trigGemOffset |
UDMAP trigger global event map offset to differentiate between main and MCU NAVSS
struct Udma_EventObj Udma_DrvHandle::globalEventObj |
Object to store global event.
Udma_EventHandle Udma_DrvHandle::globalEventHandle |
Global event handle.
Udma_InitPrms Udma_DrvHandle::initPrms |
Object to store the init params.
uint32_t Udma_DrvHandle::drvInitDone |
Flag to check if the driver object is init properly or not.
uint32_t Udma_DrvHandle::blkCopyChFlag[UDMA_RM_BLK_COPY_CH_ARR_SIZE] |
UDMA Block copy channel allocation flag
uint32_t Udma_DrvHandle::blkCopyHcChFlag[UDMA_RM_BLK_COPY_HC_CH_ARR_SIZE] |
UDMA high capacity Block copy channel allocation flag
uint32_t Udma_DrvHandle::blkCopyUhcChFlag[UDMA_RM_BLK_COPY_UHC_CH_ARR_SIZE] |
UDMA ultra high capacity Block copy channel allocation flag
uint32_t Udma_DrvHandle::txChFlag[UDMA_RM_TX_CH_ARR_SIZE] |
UDMA TX channel allocation flag
uint32_t Udma_DrvHandle::txHcChFlag[UDMA_RM_TX_HC_CH_ARR_SIZE] |
UDMA high capacity TX channel allocation flag
uint32_t Udma_DrvHandle::txUhcChFlag[UDMA_RM_TX_UHC_CH_ARR_SIZE] |
UDMA ultra high capacity TX channel allocation flag
uint32_t Udma_DrvHandle::rxChFlag[UDMA_RM_RX_CH_ARR_SIZE] |
UDMA RX channel allocation flag
uint32_t Udma_DrvHandle::rxHcChFlag[UDMA_RM_RX_HC_CH_ARR_SIZE] |
UDMA high capacity RX channel allocation flag
uint32_t Udma_DrvHandle::rxUhcChFlag[UDMA_RM_RX_UHC_CH_ARR_SIZE] |
UDMA ultra high capacity RX channel allocation flag
uint32_t Udma_DrvHandle::freeRingFlag[UDMA_RM_FREE_RING_ARR_SIZE] |
UDMA free ring allocation flag
uint32_t Udma_DrvHandle::freeFlowFlag[UDMA_RM_FREE_FLOW_ARR_SIZE] |
UDMA free flow allocation flag
uint32_t Udma_DrvHandle::globalEventFlag[UDMA_RM_GLOBAL_EVENT_ARR_SIZE] |
IA global event allocation flag
uint32_t Udma_DrvHandle::vintrFlag[UDMA_RM_VINTR_ARR_SIZE] |
IA VINTR allocation flag
uint32_t Udma_DrvHandle::irIntrFlag[UDMA_RM_IR_INTR_ARR_SIZE] |
IR interrupt allocation flag
uint32_t Udma_DrvHandle::proxyFlag[UDMA_RM_PROXY_ARR_SIZE] |
pid_t Udma_DrvHandle::proxyPids[4] |
UDMA proxy allocation flag
uint32_t Udma_DrvHandle::ringMonFlag[UDMA_RM_RING_MON_ARR_SIZE] |
UDMA ring monitor allocation flag
void* Udma_DrvHandle::rmLock |
Mutex to protect RM allocation.
void* Udma_DrvHandle::printLock |
Mutex to protect print buffer.
char Udma_DrvHandle::printBuf[UDMA_CFG_PRINT_BUF_LEN] |
Print buffer
Udma_ringDequeueRawFxn Udma_DrvHandle::ringDequeueRaw |
UDMA Ring dequeue raw function pointer
Udma_ringQueueRawFxn Udma_DrvHandle::ringQueueRaw |
UDMA Ring queue raw function pointer
Udma_ringFlushRawFxn Udma_DrvHandle::ringFlushRaw |
UDMA Ring flush raw function pointer
Udma_ringGetElementCntFxn Udma_DrvHandle::ringGetElementCnt |
UDMA Ring get element count function pointer
Udma_ringGetMemPtrFxn Udma_DrvHandle::ringGetMemPtr |
UDMA Ring get mem pointer function pointer
Udma_ringGetModeFxn Udma_DrvHandle::ringGetMode |
UDMA Ring get ring mode function pointer
Udma_ringGetForwardRingOccFxn Udma_DrvHandle::ringGetForwardRingOcc |
UDMA Ring get forward ring occupancy function pointer
Udma_ringGetReverseRingOccFxn Udma_DrvHandle::ringGetReverseRingOcc |
UDMA Ring get reverse ring occupancy function pointer
Udma_ringGetWrIdxFxn Udma_DrvHandle::ringGetWrIdx |
UDMA Ring get write index value function pointer
Udma_ringGetRdIdxFxn Udma_DrvHandle::ringGetRdIdx |
UDMA Ring get read index value function pointer
Udma_ringPrimeFxn Udma_DrvHandle::ringPrime |
UDMA Ring prime function pointer
Udma_ringPrimeReadFxn Udma_DrvHandle::ringPrimeRead |
UDMA Ring prime read function pointer
Udma_ringSetDoorBellFxn Udma_DrvHandle::ringSetDoorBell |
UDMA Ring set doorbell function pointer
Udma_ringSetCfgFxn Udma_DrvHandle::ringSetCfg |
UDMA Ring set Cfg function pointer
Udma_ringHandleClearRegsFxn Udma_DrvHandle::ringHandleClearRegs |
UDMA Ring handle clear register function pointer