AM263x MCU+ SDK  08.05.00
sdl_esm.h
Go to the documentation of this file.
1 /*
2  * SDL ESM
3  *
4  * Software Diagnostics Reference module for Error Signaling Module
5  *
6  * Copyright (c) Texas Instruments Incorporated 2022
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  */
74 #ifndef INCLUDE_SDL_ESM_H_
75 #define INCLUDE_SDL_ESM_H_
76 
77 #include <stdint.h>
78 #include <stdbool.h>
79 #include <sdl/esm/soc/sdl_esm_soc.h>
80 #include <sdl/esm/v0/esm.h>
81 #include <sdl/esm/sdlr_esm.h>
82 
83 #ifdef __cplusplus
84 extern "C" {
85 #endif
86 
87 typedef int32_t SDL_Result;
88 
94 typedef enum {
104 
105 
107 #define SDL_ESM_INTNUMBER_INVALID (0xffffffffu)
108 
110 #define SDL_ESM_INST_INVALID (0xfffffffeu)
111 
113 #define SDL_ESM_ERRORADDR_INVALID (0xffffffffu)
114 
116 #define SDL_ESM_ERRORRAMID_INVALID (0xffffffffu)
117 
119 #define SDL_ESM_ERRORBITOFFSET_INVALID (0xffffffffffffffffu)
120 
122 #define SDL_ESM_ERRORBITGROUP_INVALID (0xffffffffu)
123 
125 #define SDL_ESM_MAX_EVENT_MAP_NUM_WORDS (32u)
126 
135 typedef uint32_t sdlEsmEccErrorSource_t;
136 
138 #define SDL_ESM_ECC_PARAM_MCU_CPU0_SEC_ERROR (1u)
139 
140 #define SDL_ESM_ECC_PARAM_MCU_CPU0_DED_ERROR (2u)
141 
142 #define SDL_ESM_ECC_PARAM_MCU_CPU1_SEC_ERROR (3u)
143 
144 #define SDL_ESM_ECC_PARAM_MCU_CPU1_DED_ERROR (4u)
145 
146 #define SDL_ESM_ECC_PARAM_MCU_CBASS_SEC_ERROR (5u)
147 
148 #define SDL_ESM_ECC_PARAM_MCU_CBASS_DED_ERROR (6u)
149 
153 #define SDL_ESM_ECC_PARAM_MAIN_MSMC_AGGR0_SEC_ERROR (10001u)
154 
155 #define SDL_ESM_ECC_PARAM_MAIN_MSMC_AGGR0_DED_ERROR (10002u)
156 
157 #define SDL_ESM_ECC_PARAM_MAIN_A72_AGGR0_SEC_ERROR (10003u)
158 
159 #define SDL_ESM_ECC_PARAM_MAIN_A72_AGGR0_DED_ERROR (10004u)
160 
161 typedef int32_t (* SDL_ESM_applicationCallback) (SDL_ESM_Inst instance, SDL_ESM_IntType intrType, uint32_t grpChannel, uint32_t index, uint32_t intSrc, void *arg);
162 
169 typedef struct SDL_ESM_Errorconfig_s
170 {
171  uint32_t groupNumber;
173  uint32_t bitNumber;
176 
183 typedef struct SDL_ESM_InitConfig_s
184 {
187  uint32_t enableBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS];
189  uint32_t priorityBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS];
191  uint32_t errorpinBitmap[SDL_ESM_MAX_EVENT_MAP_NUM_WORDS];
196  uint32_t pinmininterval;
198 
213 int32_t SDL_ESM_getNErrorStatus(SDL_ESM_Inst instance, uint32_t *pStatus);
214 
229 int32_t SDL_ESM_getStaticRegisters(SDL_ESM_Inst instance, SDL_ESM_staticRegs *pStaticRegs);
230 
244 int32_t SDL_ESM_verifyConfig(SDL_ESM_Inst instance, const SDL_ESM_config *pConfig);
245 
255 int32_t SDL_ESM_clrNError(SDL_ESM_Inst instance);
256 
266 int32_t SDL_ESM_setNError(SDL_ESM_Inst instance);
267 
289 int32_t SDL_ESM_registerECCCallback(SDL_ESM_Inst instance, uint32_t eventBitMap[],
290  SDL_ESM_applicationCallback eccCallback,
291  void *callbackArg);
292 
313 int32_t SDL_ESM_init(SDL_ESM_Inst instance, const SDL_ESM_config *pConfig,
314  SDL_ESM_applicationCallback applicationCallback, void *appArg);
315 
322 void SDL_ESM_hiInterruptHandler (void *arg);
323 
330 void SDL_ESM_loInterruptHandler (void *arg);
331 
339 
350 int32_t SDL_ESM_getIntNumber(SDL_ESM_Inst esmInstType,
351  SDL_ESM_IntType esmIntType);
352 
353 
356 #ifdef __cplusplus
357 }
358 #endif /* extern "C" */
359 
360 #endif /* INCLUDE_SDL_ESM_H_ */
SDL_ESM_ErrorConfig_t
ESM error configuration.
Definition: sdl_esm.h:170
SDL_ESM_IntType
SDL_ESM_IntType
Definition: sdl_esm.h:94
SDL_ESM_registerECCCallback
int32_t SDL_ESM_registerECCCallback(SDL_ESM_Inst instance, uint32_t eventBitMap[], SDL_ESM_applicationCallback eccCallback, void *callbackArg)
There are modules within SDL which will generate ESM errors intentionally in the course of running se...
sdlEsmEccErrorSource_t
uint32_t sdlEsmEccErrorSource_t
Source of the ECC error which maps to the ESM interrupt source.
Definition: sdl_esm.h:135
SDL_ESM_config
ESM init configuration.
Definition: sdl_esm.h:184
SDL_ESM_INT_TYPE_CFG
@ SDL_ESM_INT_TYPE_CFG
Definition: sdl_esm.h:99
SDL_ESM_staticRegs
ESM static registers list.
Definition: esm.h:209
esm.h
This file contains the prototypes of the APIs present in the device abstraction layer file of ESM....
SDL_ESM_INT_TYPE_LO
@ SDL_ESM_INT_TYPE_LO
Definition: sdl_esm.h:97
SDL_Result
int32_t SDL_Result
Definition: sdl_esm.h:87
SDL_ESM_clrNError
int32_t SDL_ESM_clrNError(SDL_ESM_Inst instance)
SDL ESM API to clear the nError pin for the specified ESM instance.
SDL_ESM_getNErrorStatus
int32_t SDL_ESM_getNErrorStatus(SDL_ESM_Inst instance, uint32_t *pStatus)
SDL ESM API to get the status of the nError pin for the specified ESM instance.
SDL_ESM_config::pinmininterval
uint32_t pinmininterval
Definition: sdl_esm.h:196
SDL_ESM_hiInterruptHandler
void SDL_ESM_hiInterruptHandler(void *arg)
Esm Hi Interrupt Handler for MCU Esm Instance.
SDL_ESM_loInterruptHandler
void SDL_ESM_loInterruptHandler(void *arg)
Esm Lo Interrupt Handler for MCU Esm Instance.
SDL_ESM_configInterruptHandler
void SDL_ESM_configInterruptHandler(void *arg)
Esm Config Interrupt Handler for MCU Instance.
SDL_ESM_getIntNumber
int32_t SDL_ESM_getIntNumber(SDL_ESM_Inst esmInstType, SDL_ESM_IntType esmIntType)
Esm get Interrupt Number corresponding to the input interrupt type.
SDL_ESM_getStaticRegisters
int32_t SDL_ESM_getStaticRegisters(SDL_ESM_Inst instance, SDL_ESM_staticRegs *pStaticRegs)
SDL ESM API to read the static registers. The API reads and returns the static register configuration...
SDL_ESM_MAX_EVENT_MAP_NUM_WORDS
#define SDL_ESM_MAX_EVENT_MAP_NUM_WORDS
Maximum number of EVENT words.
Definition: sdl_esm.h:125
SDL_ESM_verifyConfig
int32_t SDL_ESM_verifyConfig(SDL_ESM_Inst instance, const SDL_ESM_config *pConfig)
SDL ESM API to verify the written configuration of the ESM module. The API verifies the written confi...
SDL_ESM_setNError
int32_t SDL_ESM_setNError(SDL_ESM_Inst instance)
SDL ESM API to set the nError pin for the specified ESM instance.
SDL_ESM_applicationCallback
int32_t(* SDL_ESM_applicationCallback)(SDL_ESM_Inst instance, SDL_ESM_IntType intrType, uint32_t grpChannel, uint32_t index, uint32_t intSrc, void *arg)
Definition: sdl_esm.h:161
SDL_ESM_config::esmErrorConfig
SDL_ESM_ErrorConfig_t esmErrorConfig
Definition: sdl_esm.h:185
SDL_ESM_init
int32_t SDL_ESM_init(SDL_ESM_Inst instance, const SDL_ESM_config *pConfig, SDL_ESM_applicationCallback applicationCallback, void *appArg)
SDL ESM API to initialize an ESM instance. The API initializes the specified ESM instance with the pr...
SDL_ESM_INT_TYPE_HI
@ SDL_ESM_INT_TYPE_HI
Definition: sdl_esm.h:95
SDL_ESM_INT_TYPE_MAX
@ SDL_ESM_INT_TYPE_MAX
Definition: sdl_esm.h:101
SDL_ESM_ErrorConfig_t::bitNumber
uint32_t bitNumber
Definition: sdl_esm.h:173
SDL_ESM_ErrorConfig_t::groupNumber
uint32_t groupNumber
Definition: sdl_esm.h:171