AM62x MCU+ SDK  11.01.00
udma.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2025 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 
75 #if defined (DRV_VERSION_UDMA_V0)
78 #include <drivers/udma/v0/include/csl_udmap_cppi5.h>
79 #include <drivers/udma/v0/include/csl_pktdma_cppi5.h>
80 #if (UDMA_NUM_UTC_INSTANCE > 0)
81 #include <drivers/hw_include/cslr_dru.h>
82 #endif
90 #include <drivers/udma/v0/hw_include/csl_bcdma.h>
91 #include <drivers/udma/v0/hw_include/csl_intaggr.h>
92 #include <drivers/udma/v0/hw_include/csl_lcdma_ringacc.h>
93 #include <drivers/udma/v0/hw_include/csl_pktdma.h>
94 
95 #endif
96 
97 #if defined (DRV_VERSION_UDMA_V1)
98 #include <drivers/udma/v1/soc/udma_soc.h>
99 #include <drivers/udma/v1/include/udma_types.h>
100 #include <drivers/udma/v1/include/udma_ring.h>
101 #include <drivers/udma/v1/include/udma_flow.h>
102 #include <drivers/udma/v1/include/udma_event.h>
103 #include <drivers/udma/v1/include/udma_rm.h>
104 #include <drivers/udma/v1/include/udma_ch.h>
105 #include <drivers/udma/v1/include/csl_udmap_tr.h>
106 #include <drivers/udma/v1/include/csl_udmap_cppi5.h>
107 #include <drivers/udma/v1/include/csl_pktdma_cppi5.h>
108 #include <drivers/udma/v1/include/udma_utils.h>
109 #include <drivers/udma/v1/hw_include/csl_bcdma.h>
110 #include <drivers/udma/v1/hw_include/csl_lcdma_ringacc.h>
111 #include <drivers/udma/v1/hw_include/csl_pktdma.h>
112 #endif
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 
118 /* ========================================================================== */
119 /* Macros & Typedefs */
120 /* ========================================================================== */
121 
134 typedef uint64_t (*Udma_VirtToPhyFxn)(const void *virtAddr,
135  uint32_t chNum,
136  void *appData);
149 typedef void *(*Udma_PhyToVirtFxn)(uint64_t phyAddr,
150  uint32_t chNum,
151  void *appData);
152 
153 /* ========================================================================== */
154 /* Structure Declarations */
155 /* ========================================================================== */
156 
162 typedef struct
163 {
164  uint32_t instId;
168  uint8_t enableUtc;
189 } Udma_InitPrms;
190 
191 /* ========================================================================== */
192 /* Function Declarations */
193 /* ========================================================================== */
194 
214 int32_t Udma_init(Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms);
215 
229 int32_t Udma_deinit(Udma_DrvHandle drvHandle);
230 
231 /*
232  * Structure Init functions
233  *
234  * Requirement: DOX_REQ_TAG(PDK-2600)
235  */
264 int32_t UdmaInitPrms_init(uint32_t instId, Udma_InitPrms *initPrms);
265 
281 uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr,
282  uint32_t chNum,
283  void *appData);
284 
300 void *Udma_defaultPhyToVirtFxn(uint64_t phyAddr,
301  uint32_t chNum,
302  void *appData);
303 
304 /* ========================================================================== */
305 /* Static Function Definitions */
306 /* ========================================================================== */
307 
308 /* None */
309 
310 /* ========================================================================== */
311 /* Internal/Private Structure Declarations */
312 /* ========================================================================== */
313 
317 typedef struct Udma_DrvObject_t
318 {
319  uintptr_t rsv[635U];
322 
323 #ifdef __cplusplus
324 }
325 #endif
326 
327 #endif /* #ifndef UDMA_H_ */
328 
Udma_InitPrms::instId
uint32_t instId
Definition: udma.h:164
udma_soc.h
UDMA Low Level Driver SOC specific file.
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:163
udma_rm.h
UDMA RM related parameters and API.
Udma_InitPrms::enableUtc
uint8_t enableUtc
Definition: udma.h:168
Udma_RmInitPrms
UDMA resource manager init parameters.
Definition: udma_rm.h:172
Udma_InitPrms::phyToVirtFxn
Udma_PhyToVirtFxn phyToVirtFxn
Definition: udma.h:181
Udma_InitPrms::virtToPhyFxn
Udma_VirtToPhyFxn virtToPhyFxn
Definition: udma.h:176
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:134
csl_udmap_tr.h
This file provides support for the UDMAP Transfer Request (TR) functionality.
Udma_InitPrms::rmInitPrms
Udma_RmInitPrms rmInitPrms
Definition: udma.h:166
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:149
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:318
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:170