AM64x MCU+ SDK  11.00.00
ospi_lld_dma.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 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 
39 #ifndef OSPI_LLD_DMA_H_
40 #define OSPI_LLD_DMA_H_
41 
42 #include <stdint.h>
43 #include <kernel/dpl/SystemP.h>
44 
45 #ifdef __cplusplus
46 extern "C"
47 {
48 #endif
49 
62 typedef void* OSPI_DmaHandle;
63 
74 typedef int32_t (*OSPI_dmaOpenFxn)(void *ospiDmaArgs);
75 
86 typedef int32_t (*OSPI_dmaCloseFxn)(void *ospiDmaArgs);
87 
102 typedef int32_t (*OSPI_dmaCopyFxn)(void *ospiDmaArgs, void *dst, void *src, uint32_t length, uint32_t timeout);
103 
115 typedef int32_t (*OSPI_dmaItrFxn)(void *ospiDmaArgs);
116 
120 typedef struct OSPI_DmaFxns_s
121 {
126 
127 } OSPI_DmaFxns;
128 
132 typedef struct OSPI_DmaConfig_s
133 {
135  /* Registered callbacks for a particular DMA driver. This will be set by Sysconfig depending on the DMA driver selected*/
136  void *ospiDmaArgs;
137  /* Arguments specific to a DMA driver. This will be typecasted to the specific DMA driver args struct
138  * when used by the appropriate callback. This struct will be defined in the specific DMA driver header file.
139  * Allocation of this struct will be done statically using Sysconfig code generation in the example code
140  */
142  /* Contains the OSPI Driver Handle*/
143 
145 
155 int32_t OSPI_dmaOpen(int32_t index);
156 
167 
181 int32_t OSPI_dmaCopy(OSPI_DmaHandle handle, void* dst, void* src, uint32_t length,uint32_t timeout);
182 
193 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* OSPI_LLD_DMA_H_ */
OSPI_DmaConfig::ospiDrvHandle
void * ospiDrvHandle
Definition: ospi_lld_dma.h:141
OSPI_dmaItrFxn
int32_t(* OSPI_dmaItrFxn)(void *ospiDmaArgs)
Driver implementation to get the interrupt enable status for DMA driver channel.
Definition: ospi_lld_dma.h:115
OSPI_DmaFxns::dmaItrStatusFxn
OSPI_dmaItrFxn dmaItrStatusFxn
Definition: ospi_lld_dma.h:125
OSPI_dmaOpenFxn
int32_t(* OSPI_dmaOpenFxn)(void *ospiDmaArgs)
Driver implementation to open a specific DMA driver channel - UDMA, EDMA etc.
Definition: ospi_lld_dma.h:74
index
uint16_t index
Definition: tisci_rm_proxy.h:3
SystemP.h
OSPI_DmaFxns::dmaCloseFxn
OSPI_dmaCloseFxn dmaCloseFxn
Definition: ospi_lld_dma.h:123
OSPI_dmaCloseFxn
int32_t(* OSPI_dmaCloseFxn)(void *ospiDmaArgs)
Driver implementation to close a specific DMA driver channel - UDMA, EDMA etc.
Definition: ospi_lld_dma.h:86
OSPI_DmaFxns::dmaCopyFxn
OSPI_dmaCopyFxn dmaCopyFxn
Definition: ospi_lld_dma.h:124
OSPI_DmaHandle
void * OSPI_DmaHandle
Handle to the OSPI DMA Config Object returned by OSPI_dmaOpen.
Definition: ospi_lld_dma.h:62
OSPI_dmaOpen
int32_t OSPI_dmaOpen(int32_t index)
API to open an OSPI DMA channel.
OSPI_dmaCopy
int32_t OSPI_dmaCopy(OSPI_DmaHandle handle, void *dst, void *src, uint32_t length, uint32_t timeout)
API to do a DMA Copy using appropriate DMA Channel opened.
OSPI_DmaFxns
Driver implementation callbacks.
Definition: ospi_lld_dma.h:121
OSPI_dmaClose
int32_t OSPI_dmaClose(OSPI_DmaHandle handle)
API to close an OSPI DMA channel.
OSPI_DmaConfig::fxns
OSPI_DmaFxns * fxns
Definition: ospi_lld_dma.h:134
OSPI_DmaFxns::dmaOpenFxn
OSPI_dmaOpenFxn dmaOpenFxn
Definition: ospi_lld_dma.h:122
OSPI_dmaCopyFxn
int32_t(* OSPI_dmaCopyFxn)(void *ospiDmaArgs, void *dst, void *src, uint32_t length, uint32_t timeout)
Driver implementation to do a DMA copy using a specific DMA driver - UDMA, EDMA etc.
Definition: ospi_lld_dma.h:102
OSPI_DmaHandle
void * OSPI_DmaHandle
The handle for DMA instance used with OSPI.
Definition: ospi_lld.h:72
OSPI_DmaConfig
OSPI DMA Configuration, these are filled by SysCfg based on the DMA driver that is selected.
Definition: ospi_lld_dma.h:133
OSPI_DmaConfig::ospiDmaArgs
void * ospiDmaArgs
Definition: ospi_lld_dma.h:136
OSPI_isDmaInterruptEnabled
int32_t OSPI_isDmaInterruptEnabled(OSPI_DmaHandle handle)
API to get the DMA Interrupt status.