PDK API Guide for J721E
udma_event.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
48 #ifndef UDMA_EVENT_H_
49 #define UDMA_EVENT_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 /* None */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
66 #define UDMA_EVENT_INVALID ((uint32_t) 0xFFFFU)
67 
68 #define UDMA_INTR_INVALID ((uint32_t) 0xFFFF0000U)
69 
73 #define UDMA_CORE_INTR_ANY ((uint32_t) 0xFFFF0001U)
74 
76 #define UDMA_MAX_EVENTS_PER_VINTR (64U)
77 
92 #define UDMA_EVENT_TYPE_DMA_COMPLETION ((uint32_t) 0x0001U)
93 
99 #define UDMA_EVENT_TYPE_TEARDOWN_PACKET ((uint32_t) 0x0002U)
100 
114 #define UDMA_EVENT_TYPE_TR ((uint32_t) 0x0003U)
115 
132 #define UDMA_EVENT_TYPE_RING ((uint32_t) 0x0004U)
133 
141 #define UDMA_EVENT_TYPE_MASTER ((uint32_t) 0x0005U)
142 
151 #define UDMA_EVENT_TYPE_ERR_OUT_OF_RANGE_FLOW ((uint32_t) 0x0006U)
152 
167 #define UDMA_EVENT_TYPE_RING_MON ((uint32_t) 0x0007U)
168 /* @} */
169 
179 #define UDMA_EVENT_MODE_EXCLUSIVE ((uint32_t) 0x0001U)
180 
184 #define UDMA_EVENT_MODE_SHARED ((uint32_t) 0x0002U)
185 /* @} */
186 
194 typedef void (*Udma_EventCallback)(Udma_EventHandle eventHandle,
195  uint32_t eventType,
196  void *appData);
197 
198 /* ========================================================================== */
199 /* Structure Declarations */
200 /* ========================================================================== */
201 
208 typedef struct
209 {
210  uint32_t eventType;
212  uint32_t eventMode;
216  Udma_ChHandle chHandle;
222  Udma_RingHandle ringHandle;
226  Udma_EventHandle masterEventHandle;
251  uint32_t intrPriority;
254  void *appData;
280  Udma_RingMonHandle monHandle;
285  /*
286  * Output parameters
287  */
288  volatile uint64_t *intrStatusReg;
291  volatile uint64_t *intrClearReg;
294  uint64_t intrMask;
296  uint32_t vintrNum;
298  uint32_t coreIntrNum;
320 
328 typedef struct
329 {
330  uint32_t isException;
333  uint32_t flowId;
335  uint32_t chNum;
338 
339 /* ========================================================================== */
340 /* Function Declarations */
341 /* ========================================================================== */
342 
373 int32_t Udma_eventRegister(Udma_DrvHandle drvHandle,
374  Udma_EventHandle eventHandle,
375  Udma_EventPrms *eventPrms);
376 
408 int32_t Udma_eventUnRegister(Udma_EventHandle eventHandle);
409 
420 uint32_t Udma_eventGetId(Udma_EventHandle eventHandle);
421 
432 int32_t Udma_eventDisable(Udma_EventHandle eventHandle);
433 
448 int32_t Udma_eventEnable(Udma_EventHandle eventHandle);
449 
460 Udma_EventHandle Udma_eventGetGlobalHandle(Udma_DrvHandle drvHandle);
461 
475 int32_t Udma_eventGetRxFlowIdFwStatus(Udma_EventHandle eventHandle,
477 
478 /*
479  * Structure Init functions
480  */
487 void UdmaEventPrms_init(Udma_EventPrms *eventPrms);
488 
489 /* ========================================================================== */
490 /* Static Function Definitions */
491 /* ========================================================================== */
492 
493 /* None */
494 
495 /* ========================================================================== */
496 /* Internal/Private Structure Declarations */
497 /* ========================================================================== */
498 
506 {
507  Udma_DrvHandle drvHandle;
512  uint32_t globalEvent;
514  uint32_t vintrNum;
516  uint32_t vintrBitNum;
518  uint32_t irIntrNum;
522  uint32_t coreIntrNum;
525  Udma_EventHandle nextEvent;
527  Udma_EventHandle prevEvent;
538  /* Below register overlay pointers provided for debug purpose to
539  * readily view the registers */
540  volatile CSL_intaggr_imapRegs_gevi *pIaGeviRegs;
542  volatile CSL_intaggr_intrRegs_vint *pIaVintrRegs;
545  uint32_t eventInitDone;
547 };
548 
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 #endif /* #ifndef UDMA_EVENT_H_ */
554 
555 /* @} */
Udma_DrvHandle drvHandle
Definition: udma_flow.h:467
uint32_t preferredCoreIntrNum
Definition: udma_event.h:275
volatile uint64_t * intrStatusReg
Definition: udma_event.h:288
void * appData
Definition: udma_event.h:254
uint32_t irIntrNum
Definition: udma_event.h:518
void(* Udma_EventCallback)(Udma_EventHandle eventHandle, uint32_t eventType, void *appData)
UDMA event callback function.
Definition: udma_event.h:194
volatile uint64_t * intrClearReg
Definition: udma_event.h:291
volatile CSL_intaggr_imapRegs_gevi * pIaGeviRegs
Definition: udma_event.h:540
uint32_t eventMode
Definition: udma_event.h:212
uint32_t flowId
Definition: udma_event.h:333
uint32_t isException
Definition: udma_event.h:330
uint32_t coreIntrNum
Definition: udma_event.h:522
uint32_t eventType
Definition: udma_event.h:210
Udma_DrvHandle drvHandle
Definition: udma_event.h:507
int32_t Udma_eventRegister(Udma_DrvHandle drvHandle, Udma_EventHandle eventHandle, Udma_EventPrms *eventPrms)
UDMA event registration.
Udma_EventHandle Udma_eventGetGlobalHandle(Udma_DrvHandle drvHandle)
Get the global event handle of the driver handle.
void * HwiP_Handle
Opaque client reference to an instance of a HwiP.
Definition: HwiP.h:81
uint64_t intrMask
Definition: udma_event.h:294
int32_t Udma_eventUnRegister(Udma_EventHandle eventHandle)
UDMA unregister event.
volatile CSL_intaggr_intrRegs_vint * pIaVintrRegs
Definition: udma_event.h:542
uint32_t vintrNum
Definition: udma_event.h:296
UDMAP receive flow id firewall status.
Definition: udma_event.h:328
uint64_t vintrBitAllocFlag
Definition: udma_event.h:533
Udma_EventCallback eventCb
Definition: udma_event.h:240
Udma_RingMonHandle monHandle
Definition: udma_event.h:280
uint32_t intrPriority
Definition: udma_event.h:251
UDMA event related parameters.
Definition: udma_event.h:208
Udma_RingHandle ringHandle
Definition: udma_event.h:222
int32_t Udma_eventDisable(Udma_EventHandle eventHandle)
Disable the event at interrupt aggregator.
int32_t Udma_eventGetRxFlowIdFwStatus(Udma_EventHandle eventHandle, Udma_EventRxFlowIdFwStatus *status)
Get the UDMA flow ID firewall status. This API will clear the status bit (RFLOWFWSTAT) by calling TIS...
Udma_EventHandle prevEvent
Definition: udma_event.h:527
uint32_t vintrNum
Definition: udma_event.h:514
uint32_t chNum
Definition: udma_event.h:335
Udma_ChHandle chHandle
Definition: udma_event.h:216
uint32_t globalEvent
Definition: udma_event.h:512
Udma_EventHandle nextEvent
Definition: udma_event.h:525
int32_t Udma_eventEnable(Udma_EventHandle eventHandle)
Enable the event at interrupt aggregator.
uint32_t Udma_eventGetId(Udma_EventHandle eventHandle)
Returns the event ID allocated for this event.
uint32_t coreIntrNum
Definition: udma_event.h:298
UDMA event object.
Definition: udma_event.h:505
uint32_t osalRegisterDisable
Definition: udma_event.h:259
uint32_t vintrBitNum
Definition: udma_event.h:516
uint32_t eventInitDone
Definition: udma_event.h:545
void UdmaEventPrms_init(Udma_EventPrms *eventPrms)
Udma_EventPrms structure init function.
HwiP_Handle hwiHandle
Definition: udma_event.h:531
Udma_EventPrms eventPrms
Definition: udma_event.h:509
Udma_EventHandle masterEventHandle
Definition: udma_event.h:226