CC35xxDriverLibrary
xip.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Filename: xip.h
3  *
4  * Description: Defines and prototypes for the XIP peripheral.
5  *
6  * Copyright (c) 2024 Texas Instruments Incorporated
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1) Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * 2) Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3) Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ******************************************************************************/
35 
36 #ifndef __XIP_H__
37 #define __XIP_H__
38 
39 //*****************************************************************************
40 //
45 //
46 //*****************************************************************************
47 
48 #include <stdint.h>
49 #include "ospi.h"
50 #include "../inc/hw_types.h"
51 #include "../inc/hw_host_xip.h"
52 
53 //*****************************************************************************
54 //
55 // If building with a C++ compiler, make all of the definitions in this header
56 // have a C binding.
57 //
58 //*****************************************************************************
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
64 #define XIP_UDMA_BIT_SECURE_MASK 0x04000000
65 
66 // UDMA peripheral processing status enumerations for use with #XIPGetUDMAChannelProgressingStatus().
67 #define XIP_UDMA_CHANNEL_STATUS_IDLE 0
68 #define XIP_UDMA_CHANNEL_STATUS_PROGRESS 1
69 
70 // UDMA data movement direction
71 #define XIP_UDMA_DIRECTION_EXT_TO_INT 0
72 #define XIP_UDMA_DIRECTION_INT_TO_EXT 1
73 
74 // UDMA job status
75 #define XIP_UDMA_JOB_STARTED 0
76 #define XIP_UDMA_JOB_NOT_START (-1)
77 
78 //*****************************************************************************
79 //
80 // UDMA interrupt status values returned by XIPGetUDMAIrqStatus()
81 //
82 //*****************************************************************************
83 #define XIP_UDMA_JOB_IRQ_STATUS_DONE 0
84 #define XIP_UDMA_JOB_IRQ_STATUS_BUS_ERROR 1
85 #define XIP_UDMA_JOB_IRQ_STATUS_SEC_ERROR 2
86 
87 #define XIP_UDMA_NON_SECURE_CHANNEL 0
88 #define XIP_UDMA_SECURE_CHANNEL 1
89 
90 //*****************************************************************************
91 //
92 // Functions
93 //
94 //*****************************************************************************
95 
96 //*****************************************************************************
97 //
130 //
131 //*****************************************************************************
132 uint32_t XIPStartUDMATransaction(const uint32_t *srcAddr,
133  uint32_t *dstAddr,
134  uint32_t length,
135  uint8_t directionMode,
136  uint32_t channelSelect);
137 
138 //*****************************************************************************
139 //
152 //
153 //*****************************************************************************
154 uint32_t XIPGetUDMAChannelProgressingStatus(uint32_t channelSelect);
155 
156 //*****************************************************************************
157 //
165 //
166 //*****************************************************************************
167 uint32_t XIPGetUDMAChannelWordsLeft(uint32_t channelSelect);
168 
169 //*****************************************************************************
170 //
184 //
185 //*****************************************************************************
186 uint32_t XIPGetUDMAIrqStatus(uint32_t channelSelect);
187 
188 //*****************************************************************************
189 //
198 //
199 //*****************************************************************************
200 void XIPDisableOTFDE(void);
201 
202 //*****************************************************************************
203 //
209 //
210 //*****************************************************************************
211 void XIPEnableOTFDE(void);
212 
213 //*****************************************************************************
214 //
215 // Mark the end of the C bindings section for C++ compilers.
216 //
217 //*****************************************************************************
218 #ifdef __cplusplus
219 }
220 #endif
221 
222 //*****************************************************************************
223 //
227 //
228 //*****************************************************************************
229 
230 #endif // __XIP_H__
uint32_t XIPGetUDMAChannelWordsLeft(uint32_t channelSelect)
Return the channel remaining words left to transmit.
Definition: xip.c:133
void XIPDisableOTFDE(void)
Disable the OTFDE processing.
void XIPEnableOTFDE(void)
Enable the OTFDE processing.
uint32_t XIPGetUDMAChannelProgressingStatus(uint32_t channelSelect)
Return the channel progressing status.
Definition: xip.c:111
uint32_t XIPStartUDMATransaction(const uint32_t *srcAddr, uint32_t *dstAddr, uint32_t length, uint8_t directionMode, uint32_t channelSelect)
Configure the relevant channel and start a uDMA transaction.
Definition: xip.c:62
uint32_t XIPGetUDMAIrqStatus(uint32_t channelSelect)
Return the transactions status.
Definition: xip.c:155