AM62x MCU+ SDK  10.01.00
udma.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 
61 #ifndef UDMA_H_
62 #define UDMA_H_
63 
64 /* ========================================================================== */
65 /* Include Files */
66 /* ========================================================================== */
67 
68 #include <stdint.h>
69 
70 /* UDMA_SOC_CFG_* macros are defined udma_soc.h.
71  * So including this first
72  */
73 #include <drivers/hw_include/soc_config.h>
74 #include <drivers/udma/soc/udma_soc.h>
76 #if (UDMA_NUM_UTC_INSTANCE > 0)
77 #include <drivers/hw_include/dru/v2/csl_dru.h>
78 #endif
85 #include <drivers/udma/include/csl_udmap_cppi5.h>
86 #include <drivers/udma/include/csl_pktdma_cppi5.h>
88 
89 #ifdef __cplusplus
90 extern "C" {
91 #endif
92 
93 /* ========================================================================== */
94 /* Macros & Typedefs */
95 /* ========================================================================== */
96 
109 typedef uint64_t (*Udma_VirtToPhyFxn)(const void *virtAddr,
110  uint32_t chNum,
111  void *appData);
124 typedef void *(*Udma_PhyToVirtFxn)(uint64_t phyAddr,
125  uint32_t chNum,
126  void *appData);
127 
128 /* ========================================================================== */
129 /* Structure Declarations */
130 /* ========================================================================== */
131 
137 typedef struct
138 {
139  uint32_t instId;
143  uint8_t enableUtc;
164 } Udma_InitPrms;
165 
166 /* ========================================================================== */
167 /* Function Declarations */
168 /* ========================================================================== */
169 
189 int32_t Udma_init(Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms);
190 
204 int32_t Udma_deinit(Udma_DrvHandle drvHandle);
205 
206 /*
207  * Structure Init functions
208  *
209  * Requirement: DOX_REQ_TAG(PDK-2600)
210  */
237 int32_t UdmaInitPrms_init(uint32_t instId, Udma_InitPrms *initPrms);
238 
254 uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr,
255  uint32_t chNum,
256  void *appData);
257 
273 void *Udma_defaultPhyToVirtFxn(uint64_t phyAddr,
274  uint32_t chNum,
275  void *appData);
276 
277 /* ========================================================================== */
278 /* Static Function Definitions */
279 /* ========================================================================== */
280 
281 /* None */
282 
283 /* ========================================================================== */
284 /* Internal/Private Structure Declarations */
285 /* ========================================================================== */
286 
290 typedef struct Udma_DrvObject_t
291 {
292  uintptr_t rsv[635U];
295 
296 #ifdef __cplusplus
297 }
298 #endif
299 
300 #endif /* #ifndef UDMA_H_ */
301 
Udma_InitPrms::instId
uint32_t instId
Definition: udma.h:139
Udma_deinit
int32_t Udma_deinit(Udma_DrvHandle drvHandle)
UDMA deinit function.
udma_ring.h
UDMA ring related parameters and API.
udma_utils.h
UDMA utility API to make TR, get TR descriptor memory requirement.
Udma_InitPrms
UDMA initialization parameters.
Definition: udma.h:138
udma_rm.h
UDMA RM related parameters and API.
Udma_InitPrms::enableUtc
uint8_t enableUtc
Definition: udma.h:143
Udma_RmInitPrms
UDMA resource manager init parameters.
Definition: udma_rm.h:172
Udma_InitPrms::phyToVirtFxn
Udma_PhyToVirtFxn phyToVirtFxn
Definition: udma.h:156
Udma_InitPrms::virtToPhyFxn
Udma_VirtToPhyFxn virtToPhyFxn
Definition: udma.h:151
udma_event.h
UDMA event related parameters and API.
udma_types.h
UDMA Low Level Driver API/interface data types file.
Udma_defaultVirtToPhyFxn
uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr, uint32_t chNum, void *appData)
Default virtual to physical translation function.
Udma_VirtToPhyFxn
uint64_t(* Udma_VirtToPhyFxn)(const void *virtAddr, uint32_t chNum, void *appData)
UDMA Virtual to Physical address translation callback function.
Definition: udma.h:109
csl_udmap_tr.h
This file provides support for the UDMAP Transfer Request (TR) functionality.
Udma_InitPrms::rmInitPrms
Udma_RmInitPrms rmInitPrms
Definition: udma.h:141
Udma_init
int32_t Udma_init(Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms)
UDMA init function.
Udma_DrvHandle
void * Udma_DrvHandle
UDMA driver handle.
Definition: udma_types.h:65
Udma_PhyToVirtFxn
void *(* Udma_PhyToVirtFxn)(uint64_t phyAddr, uint32_t chNum, void *appData)
UDMA Physical to Virtual address translation callback function.
Definition: udma.h:124
udma_ch.h
UDMA Channel related parameters and API.
UdmaInitPrms_init
int32_t UdmaInitPrms_init(uint32_t instId, Udma_InitPrms *initPrms)
Udma_InitPrms structure init function.
Udma_DrvObject
Opaque UDMA driver object.
Definition: udma.h:291
udma_flow.h
UDMA flow related parameters and API.
Udma_defaultPhyToVirtFxn
void * Udma_defaultPhyToVirtFxn(uint64_t phyAddr, uint32_t chNum, void *appData)
Default physical to virtual translation function.
Udma_InitPrms::skipGlobalEventReg
uint32_t skipGlobalEventReg
Definition: udma.h:145