AM65x MCU+ SDK  09.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  */
74 #if defined (SOC_AM65X)
75 #include <drivers/hw_include/csl_ringacc.h>
76 #include <drivers/udma/hw_include/csl_psilcfg.h>
77 #endif
78 #include <drivers/udma/soc/udma_soc.h>
85 #if defined (SOC_AM65X)
86 #include <drivers/udma/include/udma_proxy.h>
88 #endif
89 #include <drivers/udma/include/csl_udmap_cppi5.h>
90 #include <drivers/udma/include/csl_pktdma_cppi5.h>
92 #if (UDMA_SOC_CFG_PROXY_PRESENT == 1)
93 #include <drivers/udma/hw_include/csl_proxy.h>
94 #endif
95 
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 
100 /* ========================================================================== */
101 /* Macros & Typedefs */
102 /* ========================================================================== */
103 
116 typedef uint64_t (*Udma_VirtToPhyFxn)(const void *virtAddr,
117  uint32_t chNum,
118  void *appData);
131 typedef void *(*Udma_PhyToVirtFxn)(uint64_t phyAddr,
132  uint32_t chNum,
133  void *appData);
134 
135 /* ========================================================================== */
136 /* Structure Declarations */
137 /* ========================================================================== */
138 
144 typedef struct
145 {
146  uint32_t instId;
167 } Udma_InitPrms;
168 
169 /* ========================================================================== */
170 /* Function Declarations */
171 /* ========================================================================== */
172 
192 int32_t Udma_init(Udma_DrvHandle drvHandle, const Udma_InitPrms *initPrms);
193 
207 int32_t Udma_deinit(Udma_DrvHandle drvHandle);
208 
209 /*
210  * Structure Init functions
211  *
212  * Requirement: DOX_REQ_TAG(PDK-2600)
213  */
240 int32_t UdmaInitPrms_init(uint32_t instId, Udma_InitPrms *initPrms);
241 
257 uint64_t Udma_defaultVirtToPhyFxn(const void *virtAddr,
258  uint32_t chNum,
259  void *appData);
260 
276 void *Udma_defaultPhyToVirtFxn(uint64_t phyAddr,
277  uint32_t chNum,
278  void *appData);
279 
280 /* ========================================================================== */
281 /* Static Function Definitions */
282 /* ========================================================================== */
283 
284 /* None */
285 
286 /* ========================================================================== */
287 /* Internal/Private Structure Declarations */
288 /* ========================================================================== */
289 
293 typedef struct Udma_DrvObject_t
294 {
295  uintptr_t rsv[635U];
298 
299 #ifdef __cplusplus
300 }
301 #endif
302 
303 #endif /* #ifndef UDMA_H_ */
304 
Udma_InitPrms::instId
uint32_t instId
Definition: udma.h:146
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:145
udma_rm.h
UDMA RM related parameters and API.
Udma_InitPrms::phyToVirtFxn
Udma_PhyToVirtFxn phyToVirtFxn
Definition: udma.h:159
Udma_InitPrms::virtToPhyFxn
Udma_VirtToPhyFxn virtToPhyFxn
Definition: udma.h:154
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:116
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:131
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:294
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_cfg.h
UDMA configuration parameters.
Udma_InitPrms::skipGlobalEventReg
uint32_t skipGlobalEventReg
Definition: udma.h:148