AM263x MCU+ SDK  09.01.00
sdl_ip_ccm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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 {
89 
94 typedef enum {
104 
105 
112 typedef struct {
113  volatile uint32_t CCMKEYR1; /* MKEY1 value */
114  volatile uint32_t CCMKEYR2; /* MKEY2 value */
115  volatile uint32_t CCMKEYR3; /* MKEY3 value */
116  volatile uint32_t CCMPOLCNTRL; /* POL_INV value */
118 
123 typedef struct SDL_CCM_ErrorStatus_s
124 {
133 
141 typedef uint32_t SDL_VimIntrMap;
142 
144 #define SDL_VIM_INTR_MAP_IRQ ((uint32_t)0U)
145 
147 #define SDL_VIM_INTR_MAP_FIQ ((uint32_t)1U)
148 
150 #define SDL_VIM_INTR_MAP_ALL ((uint32_t)2U)
151 
158 typedef uint32_t SDL_VimIntrType;
159 
161 #define SDL_VIM_INTR_TYPE_LEVEL ((uint32_t)0U)
162 
164 #define SDL_VIM_INTR_TYPE_PULSE ((uint32_t)1U)
165 
172 typedef struct {
173  volatile uint32_t INTR_EN_SET;
174  volatile uint32_t INTR_EN_CLR;
175  volatile uint32_t INTMAP;
176  volatile uint32_t INTTYPE;
183 typedef struct {
187  volatile uint32_t PID;
188  volatile uint32_t INFO;
189  volatile uint32_t IRQVEC;
190  volatile uint32_t FIQVEC;
191  volatile uint32_t DEDVEC;
193 
194 /* ========================================================================== */
195 /* Function Declarations */
196 /* ========================================================================== */
197 
209 int32_t SDL_CCM_init(SDL_CCM_Inst instance, uint32_t index);
210 
222 
247  int32_t SDL_CCM_selfTest(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType, SDL_CCM_SelfTestType testType, \
248  uint32_t polarityInversionMask, uint32_t timeoutCnt);
249 
265  int32_t SDL_CCM_injectError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType);
266 
285 
302  int32_t SDL_CCM_getErrorType(SDL_CCM_Inst instance, uint32_t intSrc, SDL_CCM_MonitorType *monitorType);
303 
317  int32_t SDL_CCM_clearError(SDL_CCM_Inst instance, SDL_CCM_MonitorType monitorType);
318 
335 int32_t SDL_VIM_cfgIntr(SDL_vimRegs *pRegs, uint32_t intrNum, uint32_t pri, SDL_VimIntrMap intrMap,
336  SDL_VimIntrType intrType, uint32_t vecAddr );
354 int32_t SDL_VIM_verifyCfgIntr(SDL_vimRegs *pRegs,
355  uint32_t intrNum, uint32_t pri,
356  SDL_VimIntrMap intrMap,
357  SDL_VimIntrType intrType,
358  uint32_t vecAddr);
374 int32_t SDL_VIM_getStaticRegs( SDL_vimRegs *pRegs, SDL_vimStaticRegs *pStaticRegs);
375 #ifdef __cplusplus
376 }
377 #endif /*extern "C" */
378 #endif
379 
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:127
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:158
SDL_CCM_SELFTEST_TYPE_INVALID
@ SDL_CCM_SELFTEST_TYPE_INVALID
Definition: sdl_ip_ccm.h:101
SDL_CCM_staticRegs
CCM Static Register.
Definition: sdl_ip_ccm.h:112
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:125
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:115
SDL_CCM_SelfTestType
SDL_CCM_SelfTestType
This enumerator defines the type of CCM Self-test type.
Definition: sdl_ip_ccm.h:94
SDL_CCM_ErrorStatus_t::selfTestErrorTypeFlag
bool selfTestErrorTypeFlag
Definition: sdl_ip_ccm.h:129
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:189
SDL_CCM_MONITOR_TYPE_INVALID
@ SDL_CCM_MONITOR_TYPE_INVALID
Definition: sdl_ip_ccm.h:86
SDL_vimStaticRegs_GRP::INTR_EN_SET
volatile uint32_t INTR_EN_SET
Definition: sdl_ip_ccm.h:173
SDL_vimStaticRegs::PID
volatile uint32_t PID
Definition: sdl_ip_ccm.h:187
SDL_vimStaticRegs::FIQVEC
volatile uint32_t FIQVEC
Definition: sdl_ip_ccm.h:190
SDL_vimStaticRegs
This structure defines the static register groups identified for VIM.
Definition: sdl_ip_ccm.h:183
SDL_vimStaticRegs::DEDVEC
volatile uint32_t DEDVEC
Definition: sdl_ip_ccm.h:191
SDL_CCM_staticRegs::CCMKEYR1
volatile uint32_t CCMKEYR1
Definition: sdl_ip_ccm.h:113
SDL_vimStaticRegs_GRP::INTTYPE
volatile uint32_t INTTYPE
Definition: sdl_ip_ccm.h:176
SDL_CCM_ErrorStatus_t
Structure for CCM error status.
Definition: sdl_ip_ccm.h:124
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:114
SDL_CCM_SELFTEST_TYPE_NORMAL
@ SDL_CCM_SELFTEST_TYPE_NORMAL
Definition: sdl_ip_ccm.h:95
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:84
SDL_CCM_SELFTEST_POLARITY_INVERSION
@ SDL_CCM_SELFTEST_POLARITY_INVERSION
Definition: sdl_ip_ccm.h:99
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:172
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:141
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:97
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:175
SDL_CCM_staticRegs::CCMPOLCNTRL
volatile uint32_t CCMPOLCNTRL
Definition: sdl_ip_ccm.h:116
SDL_vimStaticRegs_GRP::INTR_EN_CLR
volatile uint32_t INTR_EN_CLR
Definition: sdl_ip_ccm.h:174
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:188