AM65x MCU+ SDK  09.01.00
udma_event.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2021 Texas Instruments Incorporated
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 
147 #define UDMA_EVENT_TYPE_TEARDOWN_COMPLETION ((uint32_t) 0x0006U)
148 
158 #define UDMA_EVENT_TYPE_ERR_OUT_OF_RANGE_FLOW ((uint32_t) 0x0006U)
159 
174 #define UDMA_EVENT_TYPE_RING_MON ((uint32_t) 0x0007U)
175 
184 #define UDMA_EVENT_MODE_EXCLUSIVE ((uint32_t) 0x0001U)
185 
189 #define UDMA_EVENT_MODE_SHARED ((uint32_t) 0x0002U)
190 
199 typedef void (*Udma_EventCallback)(Udma_EventHandle eventHandle,
200  uint32_t eventType,
201  void *appData);
202 
203 /* ========================================================================== */
204 /* Structure Declarations */
205 /* ========================================================================== */
206 
213 typedef struct
214 {
215  uint32_t eventType;
217  uint32_t eventMode;
256  uint32_t intrPriority;
259  void *appData;
269 #if (UDMA_SOC_CFG_RING_MON_PRESENT == 1)
270  Udma_RingMonHandle monHandle;
274  /*
275  * Output parameters
276  */
277 #endif
278  volatile uint64_t *intrStatusReg;
281  volatile uint64_t *intrClearReg;
284  uint64_t intrMask;
286  uint32_t vintrNum;
288  uint32_t coreIntrNum;
310 
318 typedef struct
319 {
320  uint32_t isException;
323  uint32_t flowId;
325  uint32_t chNum;
328 
329 /* ========================================================================== */
330 /* Function Declarations */
331 /* ========================================================================== */
332 
364  Udma_EventHandle eventHandle,
365  Udma_EventPrms *eventPrms);
366 
399 
410 uint32_t Udma_eventGetId(Udma_EventHandle eventHandle);
411 
422 int32_t Udma_eventDisable(Udma_EventHandle eventHandle);
423 
438 int32_t Udma_eventEnable(Udma_EventHandle eventHandle);
439 
451 
452 /*
453  * Structure Init functions
454  */
462 
463 /* ========================================================================== */
464 /* Static Function Definitions */
465 /* ========================================================================== */
466 
467 /* None */
468 
469 /* ========================================================================== */
470 /* Internal/Private Structure Declarations */
471 /* ========================================================================== */
472 
476 typedef struct Udma_EventObject_t
477 {
478  uintptr_t rsv[40U];
481 
482 #ifdef __cplusplus
483 }
484 #endif
485 
486 #endif /* #ifndef UDMA_EVENT_H_ */
487 
Udma_EventPrms::vintrNum
uint32_t vintrNum
Definition: udma_event.h:286
Udma_eventGetId
uint32_t Udma_eventGetId(Udma_EventHandle eventHandle)
Returns the event ID allocated for this event.
Udma_EventPrms::intrPriority
uint32_t intrPriority
Definition: udma_event.h:256
Udma_EventRxFlowIdFwStatus::isException
uint32_t isException
Definition: udma_event.h:320
Udma_EventRxFlowIdFwStatus::chNum
uint32_t chNum
Definition: udma_event.h:325
UdmaEventPrms_init
void UdmaEventPrms_init(Udma_EventPrms *eventPrms)
Udma_EventPrms structure init function.
Udma_EventPrms::ringHandle
Udma_RingHandle ringHandle
Definition: udma_event.h:227
Udma_ChHandle
void * Udma_ChHandle
UDMA channel handle.
Definition: udma_types.h:67
Udma_EventRxFlowIdFwStatus::flowId
uint32_t flowId
Definition: udma_event.h:323
Udma_EventPrms::chHandle
Udma_ChHandle chHandle
Definition: udma_event.h:221
Udma_EventPrms
UDMA event related parameters.
Definition: udma_event.h:214
Udma_eventGetGlobalHandle
Udma_EventHandle Udma_eventGetGlobalHandle(Udma_DrvHandle drvHandle)
Get the global event handle of the driver handle.
Udma_eventDisable
int32_t Udma_eventDisable(Udma_EventHandle eventHandle)
Disable the event at interrupt aggregator.
Udma_RingHandle
void * Udma_RingHandle
UDMA ring handle.
Definition: udma_types.h:71
Udma_EventPrms::coreIntrNum
uint32_t coreIntrNum
Definition: udma_event.h:288
Udma_eventEnable
int32_t Udma_eventEnable(Udma_EventHandle eventHandle)
Enable the event at interrupt aggregator.
Udma_eventRegister
int32_t Udma_eventRegister(Udma_DrvHandle drvHandle, Udma_EventHandle eventHandle, Udma_EventPrms *eventPrms)
UDMA event registration.
Udma_EventPrms::preferredCoreIntrNum
uint32_t preferredCoreIntrNum
Definition: udma_event.h:264
Udma_EventPrms::intrStatusReg
volatile uint64_t * intrStatusReg
Definition: udma_event.h:278
Udma_EventPrms::appData
void * appData
Definition: udma_event.h:259
Udma_eventUnRegister
int32_t Udma_eventUnRegister(Udma_EventHandle eventHandle)
UDMA unregister event.
Udma_EventPrms::controllerEventHandle
Udma_EventHandle controllerEventHandle
Definition: udma_event.h:231
Udma_EventHandle
void * Udma_EventHandle
UDMA event handle.
Definition: udma_types.h:69
Udma_EventPrms::intrClearReg
volatile uint64_t * intrClearReg
Definition: udma_event.h:281
Udma_EventPrms::eventMode
uint32_t eventMode
Definition: udma_event.h:217
Udma_DrvHandle
void * Udma_DrvHandle
UDMA driver handle.
Definition: udma_types.h:65
Udma_EventPrms::eventType
uint32_t eventType
Definition: udma_event.h:215
Udma_EventCallback
void(* Udma_EventCallback)(Udma_EventHandle eventHandle, uint32_t eventType, void *appData)
UDMA event callback function.
Definition: udma_event.h:199
Udma_EventRxFlowIdFwStatus
UDMAP receive flow id firewall status.
Definition: udma_event.h:319
Udma_EventPrms::intrMask
uint64_t intrMask
Definition: udma_event.h:284
Udma_EventObject
Opaque UDMA event object.
Definition: udma_event.h:477
Udma_EventPrms::eventCb
Udma_EventCallback eventCb
Definition: udma_event.h:245