AM263Px MCU+ SDK: sdl_r5_utils.h Source File

| AM263Px MCU+ SDK 26.00.00 |

sdl_r5_utils.h
Go to the documentation of this file.
1 /*
2 * SDL UTILS
3 *
4 * Software Diagnostics Library utilities
5 *
6 * Copyright (c) Texas Instruments Incorporated 2020-2024
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the
18 * distribution.
19 *
20 * Neither the name of Texas Instruments Incorporated nor the names of
21 * its contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 *
36 */
37
55 #ifndef INCLUDE_SDL_UTILS_H_
56 #define INCLUDE_SDL_UTILS_H_
57
58 /* ========================================================================== */
59 /* Include Files */
60 /* ========================================================================== */
61
62 #include <stdint.h>
63 #include <sdl/include/sdl_types.h>
64
65
76 /* ========================================================================== */
77 /* Structures */
78 /* ========================================================================== */
79
92 typedef struct {
93 uint32_t SCTLR;
94 /* SCTLR register */
95 uint32_t ACTLR;
96 /* ACTLR register */
97 uint32_t SecondaryACTLR;
98 /* SecondaryACTLR register */
99 uint32_t CPACR;
100 /* CPACR register */
101 uint32_t BTCMRegionR;
102 /* BTCMRegionR register */
103 uint32_t ATCMRegionR;
104 /* ATCMRegionR register */
105 uint32_t SlavePortControlR;
106 /* SlavePortControlR register */
107 uint32_t CONTEXTIDR;
108 /* CONTEXTIDR register */
109 uint32_t nVALIRQSET;
110 /* nVALIRQSET register */
111 uint32_t nVALFIQSET;
112 /* nVALFIQSET register */
113 uint32_t nVALRESETSET;
114 /* nVALRESETSET register */
115 uint32_t nVALDEBUGSET;
116 /* nVALDEBUGSET register */
117 uint32_t nVALIRQCLEAR;
118 /* nVALIRQCLEAR register */
119 uint32_t nVALFIQCLEAR;
120 /* nVALFIQCLEAR register */
121 uint32_t nVALRESETCLEAR;
122 /* nVALRESETCLEAR register */
123 uint32_t nVALDEBUGCLEAR;
124 /* nVALDEBUGCLEAR register */
125 uint32_t BuildOption1R;
126 /* BuildOption1R register */
127 uint32_t BuildOption2R;
128 /* BuildOption2R register */
129 uint32_t PinOptionR;
130 /* PinOptionR register */
131 uint32_t LLPPnormalAXIRR;
132 /* LLPPnormalAXIRR register */
133 uint32_t LLPPvirtualAXIRR;
134 /* LLPPvirtualAXIRR register */
135 uint32_t AHBRR;
136 /* AHBRR register */
137 uint32_t PMCR;
138 /* PMCR Register */
139 uint32_t PMCNTENSET;
140 /* PMCNTENSET Register */
141 uint32_t PMUSERENR;
142 /* PMUSERENR Register */
143 uint32_t PMINTENSET;
144 /* PMINTENSET Register */
145 uint32_t PMINTENCLR;
146 /* PMINTENCLR Register */
147
148 }SDL_R5FCPU_StaticRegs;
149
156 typedef struct SDL_MPU_staticReg_read
157 {
158 uint32_t sysControlReg;
160 uint32_t mpuTypeReg;
162 uint32_t regionId;
165 uint32_t baseAddr;
167 uint32_t size;
169 uint32_t accessPermission;
172 }SDL_R5MPU_staticRegs;
173
176 /* ========================================================================== */
177 /* Function Declarations */
178 /* ========================================================================== */
179
191 extern int32_t SDL_CPU_staticRegisterRead(SDL_R5FCPU_StaticRegs *pCPUStaticRegs);
192
204 extern void SDL_R5MPU_readStaticRegisters(SDL_R5MPU_staticRegs *pMPUStaticRegs,uint32_t regionNum);
205
209 /* ========================================================================== */
210 /* Local Function Declarations */
211 /* ========================================================================== */
212
213 uint32_t SDL_UTILS_getSCTLR(void);
214 uint32_t SDL_UTILS_getACTLR(void);
215 uint32_t SDL_UTILS_getSecondaryACTLR(void);
216 uint32_t SDL_UTILS_getCPACR(void);
217 uint32_t SDL_UTILS_getBTCMRegionR(void);
218 uint32_t SDL_UTILS_getATCMRegionR(void);
219 uint32_t SDL_UTILS_getSlavePortControlR(void);
220 uint32_t SDL_UTILS_getCONTEXTIDR(void);
221 uint32_t SDL_UTILS_getnVALIRQSET(void);
222 uint32_t SDL_UTILS_getnVALFIQSET(void);
223 uint32_t SDL_UTILS_getnVALRESETSET(void);
224 uint32_t SDL_UTILS_getnVALDEBUGSET(void);
225 uint32_t SDL_UTILS_getnVALIRQCLEAR(void);
226 uint32_t SDL_UTILS_getnVALFIQCLEAR(void);
227 uint32_t SDL_UTILS_getnVALRESETCLEAR(void);
228 uint32_t SDL_UTILS_getnVALDEBUGCLEAR(void);
229 uint32_t SDL_UTILS_getBuildOption1R(void);
230 uint32_t SDL_UTILS_getBuildOption2R(void);
231 uint32_t SDL_UTILS_getPinOptionR(void);
232 uint32_t SDL_UTILS_getLLPPnormalAXIRR(void);
233 uint32_t SDL_UTILS_getLLPPvirtualAXIRR(void);
234 uint32_t SDL_UTILS_getAHBRR(void);
235 uint32_t SDL_UTILS_getCFLR(void);
236 uint32_t SDL_UTILS_getPMOVSR(void);
237 uint32_t SDL_UTILS_getDFSR(void);
238 uint32_t SDL_UTILS_getADFSR(void);
239 uint32_t SDL_UTILS_getDFAR(void);
240 uint32_t SDL_UTILS_getIFSR(void);
241 uint32_t SDL_UTILS_getIFAR(void);
242 uint32_t SDL_UTILS_getAIFSR(void);
243 uint32_t SDL_UTILS_getPMCR(void);
244 uint32_t SDL_UTILS_getPMCNTENSET(void);
245 uint32_t SDL_UTILS_getPMUSERENR (void);
246 uint32_t SDL_UTILS_getPMINTENSET(void);
247 uint32_t SDL_UTILS_getPMINTENCLR(void);
248
249 /* Some other function not related to CPU Static register*/
250 void SDL_UTILS_enable_event_bus(void);
251 void SDL_UTILS_enable_cache_event_bus(void);
252
253 #endif /* INCLUDE_SDL_UTILS_H_ */
SDL_R5MPU_staticRegs::accessPermission
uint32_t accessPermission
Definition: sdl_r5_utils.h:169
SDL_R5FCPU_StaticRegs::CONTEXTIDR
uint32_t CONTEXTIDR
Definition: sdl_r5_utils.h:107
SDL_R5MPU_staticRegs
MPU Static Registers structure.
Definition: sdl_r5_utils.h:157
SDL_UTILS_getCONTEXTIDR
uint32_t SDL_UTILS_getCONTEXTIDR(void)
SDL_R5FCPU_StaticRegs::nVALIRQSET
uint32_t nVALIRQSET
Definition: sdl_r5_utils.h:109
SDL_R5FCPU_StaticRegs::PMCR
uint32_t PMCR
Definition: sdl_r5_utils.h:137
SDL_R5MPU_readStaticRegisters
void SDL_R5MPU_readStaticRegisters(SDL_R5MPU_staticRegs *pMPUStaticRegs, uint32_t regionNum)
MPU API to Read the Static Registers. This function reads the values of the static registers such as ...
SDL_UTILS_getPMCR
uint32_t SDL_UTILS_getPMCR(void)
SDL_R5MPU_staticRegs::size
uint32_t size
Definition: sdl_r5_utils.h:167
SDL_UTILS_getnVALIRQSET
uint32_t SDL_UTILS_getnVALIRQSET(void)
SDL_R5FCPU_StaticRegs::BTCMRegionR
uint32_t BTCMRegionR
Definition: sdl_r5_utils.h:101
SDL_R5MPU_staticRegs::mpuTypeReg
uint32_t mpuTypeReg
Definition: sdl_r5_utils.h:160
SDL_UTILS_getnVALDEBUGCLEAR
uint32_t SDL_UTILS_getnVALDEBUGCLEAR(void)
SDL_UTILS_getPinOptionR
uint32_t SDL_UTILS_getPinOptionR(void)
SDL_R5FCPU_StaticRegs::nVALDEBUGSET
uint32_t nVALDEBUGSET
Definition: sdl_r5_utils.h:115
SDL_R5FCPU_StaticRegs::PinOptionR
uint32_t PinOptionR
Definition: sdl_r5_utils.h:129
SDL_R5FCPU_StaticRegs::ACTLR
uint32_t ACTLR
Definition: sdl_r5_utils.h:95
SDL_UTILS_getBuildOption1R
uint32_t SDL_UTILS_getBuildOption1R(void)
SDL_UTILS_getSlavePortControlR
uint32_t SDL_UTILS_getSlavePortControlR(void)
SDL_R5FCPU_StaticRegs::AHBRR
uint32_t AHBRR
Definition: sdl_r5_utils.h:135
SDL_R5FCPU_StaticRegs
Structure containing R5F CPU Static Registers.
Definition: sdl_r5_utils.h:92
SDL_R5FCPU_StaticRegs::nVALIRQCLEAR
uint32_t nVALIRQCLEAR
Definition: sdl_r5_utils.h:117
SDL_R5FCPU_StaticRegs::nVALRESETSET
uint32_t nVALRESETSET
Definition: sdl_r5_utils.h:113
SDL_UTILS_getnVALRESETSET
uint32_t SDL_UTILS_getnVALRESETSET(void)
SDL_UTILS_getADFSR
uint32_t SDL_UTILS_getADFSR(void)
SDL_UTILS_getnVALFIQSET
uint32_t SDL_UTILS_getnVALFIQSET(void)
SDL_R5FCPU_StaticRegs::SlavePortControlR
uint32_t SlavePortControlR
Definition: sdl_r5_utils.h:105
SDL_UTILS_getLLPPvirtualAXIRR
uint32_t SDL_UTILS_getLLPPvirtualAXIRR(void)
SDL_UTILS_enable_cache_event_bus
void SDL_UTILS_enable_cache_event_bus(void)
SDL_UTILS_getnVALFIQCLEAR
uint32_t SDL_UTILS_getnVALFIQCLEAR(void)
SDL_R5MPU_staticRegs::baseAddr
uint32_t baseAddr
Definition: sdl_r5_utils.h:165
SDL_UTILS_getnVALIRQCLEAR
uint32_t SDL_UTILS_getnVALIRQCLEAR(void)
SDL_R5FCPU_StaticRegs::PMCNTENSET
uint32_t PMCNTENSET
Definition: sdl_r5_utils.h:139
SDL_CPU_staticRegisterRead
int32_t SDL_CPU_staticRegisterRead(SDL_R5FCPU_StaticRegs *pCPUStaticRegs)
This API is used to get the value of static registers for R5F CPU.
SDL_UTILS_getIFAR
uint32_t SDL_UTILS_getIFAR(void)
SDL_UTILS_getBuildOption2R
uint32_t SDL_UTILS_getBuildOption2R(void)
SDL_UTILS_getSCTLR
uint32_t SDL_UTILS_getSCTLR(void)
SDL_R5MPU_staticRegs::sysControlReg
uint32_t sysControlReg
Definition: sdl_r5_utils.h:158
SDL_UTILS_getCFLR
uint32_t SDL_UTILS_getCFLR(void)
SDL_R5FCPU_StaticRegs::ATCMRegionR
uint32_t ATCMRegionR
Definition: sdl_r5_utils.h:103
SDL_R5FCPU_StaticRegs::nVALRESETCLEAR
uint32_t nVALRESETCLEAR
Definition: sdl_r5_utils.h:121
SDL_UTILS_getSecondaryACTLR
uint32_t SDL_UTILS_getSecondaryACTLR(void)
SDL_R5FCPU_StaticRegs::PMINTENCLR
uint32_t PMINTENCLR
Definition: sdl_r5_utils.h:145
SDL_UTILS_getAIFSR
uint32_t SDL_UTILS_getAIFSR(void)
SDL_R5FCPU_StaticRegs::nVALFIQCLEAR
uint32_t nVALFIQCLEAR
Definition: sdl_r5_utils.h:119
SDL_UTILS_getAHBRR
uint32_t SDL_UTILS_getAHBRR(void)
SDL_UTILS_getDFAR
uint32_t SDL_UTILS_getDFAR(void)
SDL_R5FCPU_StaticRegs::PMUSERENR
uint32_t PMUSERENR
Definition: sdl_r5_utils.h:141
SDL_UTILS_getPMINTENCLR
uint32_t SDL_UTILS_getPMINTENCLR(void)
SDL_UTILS_enable_event_bus
void SDL_UTILS_enable_event_bus(void)
SDL_UTILS_getATCMRegionR
uint32_t SDL_UTILS_getATCMRegionR(void)
SDL_UTILS_getIFSR
uint32_t SDL_UTILS_getIFSR(void)
SDL_UTILS_getnVALDEBUGSET
uint32_t SDL_UTILS_getnVALDEBUGSET(void)
SDL_UTILS_getLLPPnormalAXIRR
uint32_t SDL_UTILS_getLLPPnormalAXIRR(void)
SDL_R5FCPU_StaticRegs::nVALDEBUGCLEAR
uint32_t nVALDEBUGCLEAR
Definition: sdl_r5_utils.h:123
SDL_R5MPU_staticRegs::regionId
uint32_t regionId
Definition: sdl_r5_utils.h:162
SDL_UTILS_getPMINTENSET
uint32_t SDL_UTILS_getPMINTENSET(void)
SDL_UTILS_getnVALRESETCLEAR
uint32_t SDL_UTILS_getnVALRESETCLEAR(void)
SDL_R5FCPU_StaticRegs::LLPPnormalAXIRR
uint32_t LLPPnormalAXIRR
Definition: sdl_r5_utils.h:131
SDL_UTILS_getACTLR
uint32_t SDL_UTILS_getACTLR(void)
SDL_UTILS_getDFSR
uint32_t SDL_UTILS_getDFSR(void)
SDL_UTILS_getPMUSERENR
uint32_t SDL_UTILS_getPMUSERENR(void)
SDL_R5FCPU_StaticRegs::nVALFIQSET
uint32_t nVALFIQSET
Definition: sdl_r5_utils.h:111
SDL_UTILS_getPMOVSR
uint32_t SDL_UTILS_getPMOVSR(void)
SDL_R5FCPU_StaticRegs::BuildOption2R
uint32_t BuildOption2R
Definition: sdl_r5_utils.h:127
SDL_R5FCPU_StaticRegs::CPACR
uint32_t CPACR
Definition: sdl_r5_utils.h:99
SDL_UTILS_getBTCMRegionR
uint32_t SDL_UTILS_getBTCMRegionR(void)
SDL_UTILS_getCPACR
uint32_t SDL_UTILS_getCPACR(void)
SDL_R5FCPU_StaticRegs::LLPPvirtualAXIRR
uint32_t LLPPvirtualAXIRR
Definition: sdl_r5_utils.h:133
SDL_R5FCPU_StaticRegs::BuildOption1R
uint32_t BuildOption1R
Definition: sdl_r5_utils.h:125
SDL_UTILS_getPMCNTENSET
uint32_t SDL_UTILS_getPMCNTENSET(void)
SDL_R5FCPU_StaticRegs::SecondaryACTLR
uint32_t SecondaryACTLR
Definition: sdl_r5_utils.h:97
SDL_R5FCPU_StaticRegs::SCTLR
uint32_t SCTLR
Definition: sdl_r5_utils.h:93
SDL_R5FCPU_StaticRegs::PMINTENSET
uint32_t PMINTENSET
Definition: sdl_r5_utils.h:143