AM64x MCU+ SDK  08.02.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/udma/soc/udma_soc.h>
81 #include <drivers/udma/include/csl_udmap_cppi5.h>
82 #include <drivers/udma/include/csl_pktdma_cppi5.h>
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 /* ========================================================================== */
90 /* Macros & Typedefs */
91 /* ========================================================================== */
92 
105 typedef uint64_t (*Udma_VirtToPhyFxn)(const void *virtAddr,
106  uint32_t chNum,
107  void *appData);
120 typedef void *(*Udma_PhyToVirtFxn)(uint64_t phyAddr,
121  uint32_t chNum,
122  void *appData);
123 
124 /* ========================================================================== */
125 /* Structure Declarations */
126 /* ========================================================================== */
127 
133 typedef struct
134 {
135  uint32_t instId;
156 } Udma_InitPrms;
157 
158 /* ========================================================================== */
159 /* Function Declarations */
160 /* ========================================================================== */
161 
181 int32_t Udma_init(Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms);
182 
196 int32_t Udma_deinit(Udma_DrvHandle drvHandle);
197 
198 /*
199  * Structure Init functions
200  *
201  * Requirement: DOX_REQ_TAG(PDK-2600)
202  */
229 int32_t UdmaInitPrms_init(uint32_t instId, Udma_InitPrms *initPrms);
230 
246 uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr,
247  uint32_t chNum,
248  void *appData);
249 
265 void *Udma_defaultPhyToVirtFxn(uint64_t phyAddr,
266  uint32_t chNum,
267  void *appData);
268 
269 /* ========================================================================== */
270 /* Static Function Definitions */
271 /* ========================================================================== */
272 
273 /* None */
274 
275 /* ========================================================================== */
276 /* Internal/Private Structure Declarations */
277 /* ========================================================================== */
278 
282 typedef struct Udma_DrvObject_t
283 {
284  uintptr_t rsv[635U];
287 
288 #ifdef __cplusplus
289 }
290 #endif
291 
292 #endif /* #ifndef UDMA_H_ */
293 
Udma_InitPrms::instId
uint32_t instId
Definition: udma.h:135
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:134
udma_rm.h
UDMA RM related parameters and API.
Udma_InitPrms::phyToVirtFxn
Udma_PhyToVirtFxn phyToVirtFxn
Definition: udma.h:148
Udma_InitPrms::virtToPhyFxn
Udma_VirtToPhyFxn virtToPhyFxn
Definition: udma.h:143
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:105
csl_udmap_tr.h
This file provides support for the UDMAP Transfer Request (TR) functionality.
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:120
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:283
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:137