AM263x MCU+ SDK  09.02.00
sdl_ip_ccm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-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  */
50 #ifndef SDL_IP_CCM_H_
51 #define SDL_IP_CCM_H_
52 
53 #include <stddef.h>
54 #include <stdbool.h>
55 #include "sdl/sdl_ccm.h"
56 #include "sdl/r5/v0/sdlr_vim.h"
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /* ========================================================================== */
63 /* Macros */
64 /* ========================================================================== */
66 #define SDL_VIM_MAX_INTR_GROUPS (32U)
67 
68 #define SDL_VIM_NUM_INTRS_PER_GROUP (32U)
69 /* ========================================================================== */
70 /* Enums & Typedefs */
71 /* ========================================================================== */
72 
77 typedef enum {
84 #ifdef SOC_AM263PX
85  SDL_CCM_MONITOR_TYPE_TMU = 3,
87  SDL_CCM_MONITOR_TYPE_RL2 = 4,
93 #else
98 #endif
100 
105 typedef enum {
115 
116 
123 typedef struct {
124  volatile uint32_t CCMKEYR1; /* MKEY1 value */
125  volatile uint32_t CCMKEYR2; /* MKEY2 value */
126  volatile uint32_t CCMKEYR3; /* MKEY3 value */
127  volatile uint32_t CCMPOLCNTRL; /* POL_INV value */
128 #ifdef SOC_AM263PX
129  volatile uint32_t CCMKEYR5; /* MKEY5 value */
130  volatile uint32_t CCMKEYR6; /* MKEY6 value */
131 #endif
133 
138 typedef struct SDL_CCM_ErrorStatus_s
139 {
148 
156 typedef uint32_t SDL_VimIntrMap;
157 
159 #define SDL_VIM_INTR_MAP_IRQ ((uint32_t)0U)
160 
162 #define SDL_VIM_INTR_MAP_FIQ ((uint32_t)1U)
163 
165 #define SDL_VIM_INTR_MAP_ALL ((uint32_t)2U)
166 
173 typedef uint32_t SDL_VimIntrType;
174 
176 #define SDL_VIM_INTR_TYPE_LEVEL ((uint32_t)0U)
177 
179 #define SDL_VIM_INTR_TYPE_PULSE ((uint32_t)1U)
180 
187 typedef struct {
188  volatile uint32_t INTR_EN_SET;
189  volatile uint32_t INTR_EN_CLR;
190  volatile uint32_t INTMAP;
191  volatile uint32_t INTTYPE;
198 typedef struct {
202  volatile uint32_t PID;
203  volatile uint32_t INFO;
204  volatile uint32_t IRQVEC;
205  volatile uint32_t FIQVEC;
206  volatile uint32_t DEDVEC;
208 
209 /* ========================================================================== */
210 /* Function Declarations */
211 /* ========================================================================== */
212 
224 int32_t SDL_CCM_init(SDL_CCM_Inst instance, uint32_t index);
225 
237 
262  int32_t SDL_CCM_selfTest(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType, SDL_CCM_SelfTestType testType, \
263  uint32_t polarityInversionMask, uint32_t timeoutCnt);
264 
280  int32_t SDL_CCM_injectError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType);
281 
300 
317  int32_t SDL_CCM_getErrorType(SDL_CCM_Inst instance, uint32_t intSrc, SDL_CCM_MonitorType *monitorType);
318 
332  int32_t SDL_CCM_clearError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType);
333 
350 int32_t SDL_VIM_cfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap,
351  SDL_VimIntrType intrType, uint32_t vecAddr );
369 int32_t SDL_VIM_verifyCfgIntr(SDL_vimRegs *pRegs,
370  uint32_t intrNum, uint32_t pri,
371  SDL_VimIntrMap intrMap,
372  SDL_VimIntrType intrType,
373  uint32_t vecAddr);
389 int32_t SDL_VIM_getStaticRegs( SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs);
390 #ifdef __cplusplus
391 }
392 #endif /*extern "C" */
393 #endif
394 
SDL_VIM_getStaticRegs
int32_t SDL_VIM_getStaticRegs(SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs)
Read back of static registers for VIM.
SDL_CCM_ErrorStatus_t::selfTestErrorFlag
bool selfTestErrorFlag
Definition: sdl_ip_ccm.h:142
SDL_VIM_verifyCfgIntr
int32_t SDL_VIM_verifyCfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap, SDL_VimIntrType intrType, uint32_t vecAddr)
Read back Verify Configure a source interrupt.
SDL_CCM_MONITOR_TYPE_OUTPUT_COMPARE_BLOCK
@ SDL_CCM_MONITOR_TYPE_OUTPUT_COMPARE_BLOCK
Definition: sdl_ip_ccm.h:80
SDL_VimIntrType
uint32_t SDL_VimIntrType
This enumerator defines the possible interrupt types. Each source interrupt is either an active high ...
Definition: sdl_ip_ccm.h:173
SDL_CCM_SELFTEST_TYPE_INVALID
@ SDL_CCM_SELFTEST_TYPE_INVALID
Definition: sdl_ip_ccm.h:112
SDL_CCM_staticRegs
CCM Static Register.
Definition: sdl_ip_ccm.h:123
SDL_VIM_cfgIntr
int32_t SDL_VIM_cfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap, SDL_VimIntrType intrType, uint32_t vecAddr)
Configure a source interrupt using VIM.
SDL_CCM_ErrorStatus_t::compareErrorFlag
bool compareErrorFlag
Definition: sdl_ip_ccm.h:140
SDL_CCM_init
int32_t SDL_CCM_init(SDL_CCM_Inst instance, uint32_t index)
Initialization API for CCM module.
SDL_VIM_NUM_INTRS_PER_GROUP
#define SDL_VIM_NUM_INTRS_PER_GROUP
Definition: sdl_ip_ccm.h:68
SDL_CCM_staticRegs::CCMKEYR3
volatile uint32_t CCMKEYR3
Definition: sdl_ip_ccm.h:126
SDL_CCM_SelfTestType
SDL_CCM_SelfTestType
This enumerator defines the type of CCM Self-test type.
Definition: sdl_ip_ccm.h:105
SDL_CCM_ErrorStatus_t::selfTestErrorTypeFlag
bool selfTestErrorTypeFlag
Definition: sdl_ip_ccm.h:144
SDL_CCM_MONITOR_TYPE_VIM
@ SDL_CCM_MONITOR_TYPE_VIM
Definition: sdl_ip_ccm.h:82
SDL_vimStaticRegs::IRQVEC
volatile uint32_t IRQVEC
Definition: sdl_ip_ccm.h:204
SDL_CCM_MONITOR_TYPE_INVALID
@ SDL_CCM_MONITOR_TYPE_INVALID
Definition: sdl_ip_ccm.h:96
SDL_vimStaticRegs_GRP::INTR_EN_SET
volatile uint32_t INTR_EN_SET
Definition: sdl_ip_ccm.h:188
SDL_vimStaticRegs::PID
volatile uint32_t PID
Definition: sdl_ip_ccm.h:202
SDL_vimStaticRegs::FIQVEC
volatile uint32_t FIQVEC
Definition: sdl_ip_ccm.h:205
SDL_vimStaticRegs
This structure defines the static register groups identified for VIM.
Definition: sdl_ip_ccm.h:198
SDL_vimStaticRegs::DEDVEC
volatile uint32_t DEDVEC
Definition: sdl_ip_ccm.h:206
SDL_CCM_staticRegs::CCMKEYR1
volatile uint32_t CCMKEYR1
Definition: sdl_ip_ccm.h:124
SDL_vimStaticRegs_GRP::INTTYPE
volatile uint32_t INTTYPE
Definition: sdl_ip_ccm.h:191
SDL_CCM_ErrorStatus_t
Structure for CCM error status.
Definition: sdl_ip_ccm.h:139
SDL_CCM_MONITOR_TYPE_NONE
@ SDL_CCM_MONITOR_TYPE_NONE
Definition: sdl_ip_ccm.h:78
SDL_CCM_staticRegs::CCMKEYR2
volatile uint32_t CCMKEYR2
Definition: sdl_ip_ccm.h:125
SDL_CCM_SELFTEST_TYPE_NORMAL
@ SDL_CCM_SELFTEST_TYPE_NORMAL
Definition: sdl_ip_ccm.h:106
SDL_VIM_MAX_INTR_GROUPS
#define SDL_VIM_MAX_INTR_GROUPS
Definition: sdl_ip_ccm.h:66
SDL_CCM_selfTest
int32_t SDL_CCM_selfTest(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType, SDL_CCM_SelfTestType testType, uint32_t polarityInversionMask, uint32_t timeoutCnt)
Executes a self-test of the CCM module. The types of self-tests supported are described in detail in ...
SDL_CCM_MONITOR_TYPE_INACTIVITY_MONITOR
@ SDL_CCM_MONITOR_TYPE_INACTIVITY_MONITOR
Definition: sdl_ip_ccm.h:94
SDL_CCM_SELFTEST_POLARITY_INVERSION
@ SDL_CCM_SELFTEST_POLARITY_INVERSION
Definition: sdl_ip_ccm.h:110
sdl_ccm.h
SDL_CCM_getErrorType
int32_t SDL_CCM_getErrorType(SDL_CCM_Inst instance, uint32_t intSrc, SDL_CCM_MonitorType *monitorType)
Gets the monitor type for which the CCM error was generated. Takes the ESM interrupt source as input.
SDL_vimStaticRegs_GRP
This structure defines the group registers identified for VIM static registers.
Definition: sdl_ip_ccm.h:187
SDL_CCM_getStaticRegisters
int32_t SDL_CCM_getStaticRegisters(SDL_CCM_Inst instance, SDL_CCM_staticRegs *pStaticRegs)
Retrieves the static register configuration. The values returned in staticRegs can be saved by the ap...
SDL_VimIntrMap
uint32_t SDL_VimIntrMap
This enumerator defines the possible output interrupt types. Each source interrupt can be configured ...
Definition: sdl_ip_ccm.h:156
SDL_CCM_MonitorType
SDL_CCM_MonitorType
This enumerator defines the type of CCM Monitor type.
Definition: sdl_ip_ccm.h:77
SDL_CCM_verifyConfig
int32_t SDL_CCM_verifyConfig(SDL_CCM_Inst instance)
Verifies the configuration done as part of SDL_CCM_init is as expected.
SDL_CCM_injectError
int32_t SDL_CCM_injectError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType)
Forces an error to be generated for the selected monitor type. After injecting the error,...
SDL_CCM_SELFTEST_TYPE_ERROR_FORCING
@ SDL_CCM_SELFTEST_TYPE_ERROR_FORCING
Definition: sdl_ip_ccm.h:108
SDL_CCM_clearError
int32_t SDL_CCM_clearError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType)
Clears the compare error for the selected monitor type.
SDL_vimStaticRegs_GRP::INTMAP
volatile uint32_t INTMAP
Definition: sdl_ip_ccm.h:190
SDL_CCM_staticRegs::CCMPOLCNTRL
volatile uint32_t CCMPOLCNTRL
Definition: sdl_ip_ccm.h:127
SDL_vimStaticRegs_GRP::INTR_EN_CLR
volatile uint32_t INTR_EN_CLR
Definition: sdl_ip_ccm.h:189
SDL_CCM_Inst
uint32_t SDL_CCM_Inst
CCM Instance supported.
Definition: sdl_soc_ccm.h:68
SDL_vimStaticRegs::INFO
volatile uint32_t INFO
Definition: sdl_ip_ccm.h:203