AM62Ax MCU+ SDK  09.01.00
sdl_ecc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 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 
42 #ifndef INCLUDE_SDL_ECC_H_
43 #define INCLUDE_SDL_ECC_H_
44 
45 #include <stdint.h>
46 #include <stdbool.h>
47 
48 #include "sdl_common.h"
49 #include <sdl/ecc/sdl_ip_ecc.h>
50 #include <sdl/ecc/soc/sdl_soc_ecc.h>
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
66 typedef enum {
72 
73 
79 typedef enum {
99 
100 
105 typedef enum {
111 
117 typedef uint32_t SDL_ECC_MemSubType;
118 
122 typedef void (*SDL_ECC_ErrorCallback_t) (uint32_t errorSrc, uint32_t address);
123 
125 typedef void (*SDL_ECC_VIMDEDVector_t) (void);
126 
136 typedef struct SDL_ECC_InitConfig_s
137 {
138  uint32_t numRams;
144 
149 typedef struct SDL_ECC_InjectErrorConfig_s
150 {
151  uint32_t *pErrMem;
153  uint32_t flipBitMask;
155  uint16_t chkGrp;
158 
163 typedef struct SDL_ECC_ErrorInfo_s
164 {
165  SDL_ECC_MemType eccMemType;
171  uint32_t bitErrCnt;
173  uint32_t injectBitErrCnt;
175  uint32_t bitErrorGroup;
177  uint64_t bitErrorOffset;
180 
196 int32_t SDL_ECC_initEsm (const SDL_ESM_Inst esmInstType);
197 
207 int32_t SDL_ECC_init (SDL_ECC_MemType eccMemType,
208  const SDL_ECC_InitConfig_t *pECCInitConfig);
209 
220 int32_t SDL_ECC_initMemory (SDL_ECC_MemType eccMemType,
221  SDL_ECC_MemSubType memSubType);
222 
236 int32_t SDL_ECC_selfTest(SDL_ECC_MemType eccMemType,
237  SDL_ECC_MemSubType memSubType,
238  SDL_ECC_InjectErrorType errorType,
239  const SDL_ECC_InjectErrorConfig_t *pECCErrorConfig,
240  uint32_t selfTestTimeOut);
241 
254 int32_t SDL_ECC_injectError(SDL_ECC_MemType eccMemType,
255  SDL_ECC_MemSubType memSubType,
256  SDL_ECC_InjectErrorType errorType,
257  const SDL_ECC_InjectErrorConfig_t *pECCErrorConfig);
258 
268 int32_t SDL_ECC_getStaticRegisters(SDL_ECC_MemType eccMemType,
269  SDL_ECC_staticRegs *pStaticRegs);
270 
282 int32_t SDL_ECC_getErrorInfo(SDL_ECC_MemType eccMemType,
283  SDL_Ecc_AggrIntrSrc intrSrc,
284  SDL_ECC_ErrorInfo_t *pErrorInfo);
285 
295 int32_t SDL_ECC_ackIntr(SDL_ECC_MemType eccMemType,
296  SDL_Ecc_AggrIntrSrc intrSrc);
297 
311 int32_t SDL_ECC_getESMErrorInfo(SDL_ESM_Inst instance, uint32_t intSrc,
312  SDL_ECC_MemType *eccMemType, SDL_Ecc_AggrIntrSrc *intrSrcType);
313 
327 int32_t SDL_ECC_clearNIntrPending(SDL_ECC_MemType eccMemType, SDL_ECC_MemSubType memSubType,
328  SDL_Ecc_AggrIntrSrc intrSrc,
329  SDL_Ecc_AggrEDCErrorSubType subType, uint32_t numEvents);
330 
347 void SDL_ECC_applicationCallbackFunction(SDL_ECC_MemType eccMemType,
348  uint32_t errorSrc,
349  uint32_t address,
350  uint32_t ramId,
351  uint64_t bitErrorOffset,
352  uint32_t bitErrorGroup);
353 
356 #ifdef __cplusplus
357 }
358 #endif /* extern "C" */
359 
360 #endif
SDL_ECC_ErrorCallback_t
void(* SDL_ECC_ErrorCallback_t)(uint32_t errorSrc, uint32_t address)
Definition: sdl_ecc.h:122
SDL_ESM_Inst
SDL_ESM_Inst
Definition: sdl_esm_soc.h:59
SDL_ECC_InitConfig_t
Definition: sdl_ecc.h:137
SDL_ECC_initMemory
int32_t SDL_ECC_initMemory(SDL_ECC_MemType eccMemType, SDL_ECC_MemSubType memSubType)
Initializes Memory to be ready for ECC error detection. Assumes ECC is already enabled.
SDL_ECC_ErrorInfo_t::memSubType
SDL_ECC_MemSubType memSubType
Definition: sdl_ecc.h:167
SDL_ECC_InitConfig_t::numRams
uint32_t numRams
Definition: sdl_ecc.h:138
SDL_INJECT_ECC_ERROR_FORCING_2BIT_ONCE
@ SDL_INJECT_ECC_ERROR_FORCING_2BIT_ONCE
Definition: sdl_ecc.h:85
SDL_ECC_injectError
int32_t SDL_ECC_injectError(SDL_ECC_MemType eccMemType, SDL_ECC_MemSubType memSubType, SDL_ECC_InjectErrorType errorType, const SDL_ECC_InjectErrorConfig_t *pECCErrorConfig)
Injects ECC error at specified location Assumes ECC is already enabled.
SDL_ECC_ackIntr
int32_t SDL_ECC_ackIntr(SDL_ECC_MemType eccMemType, SDL_Ecc_AggrIntrSrc intrSrc)
Acknowledge the ECC interrupt.
SDL_Ecc_AggrEDCErrorSubType
uint32_t SDL_Ecc_AggrEDCErrorSubType
This enumerator defines the types of possible EDC errors.
Definition: sdl_ip_ecc.h:189
SDL_ECC_getStaticRegisters
int32_t SDL_ECC_getStaticRegisters(SDL_ECC_MemType eccMemType, SDL_ECC_staticRegs *pStaticRegs)
Gets the static registers for the specified ECC instance.
SDL_ECC_AGGR_TYPE_INJECT_ONLY
@ SDL_ECC_AGGR_TYPE_INJECT_ONLY
Definition: sdl_ecc.h:67
SDL_INJECT_ECC_ERROR_FORCING_1BIT_N_ROW_ONCE
@ SDL_INJECT_ECC_ERROR_FORCING_1BIT_N_ROW_ONCE
Definition: sdl_ecc.h:87
SDL_INJECT_ECC_ERROR_FORCING_1BIT_ONCE
@ SDL_INJECT_ECC_ERROR_FORCING_1BIT_ONCE
Definition: sdl_ecc.h:83
SDL_ECC_selfTest
int32_t SDL_ECC_selfTest(SDL_ECC_MemType eccMemType, SDL_ECC_MemSubType memSubType, SDL_ECC_InjectErrorType errorType, const SDL_ECC_InjectErrorConfig_t *pECCErrorConfig, uint32_t selfTestTimeOut)
Runs self test by injecting and error and monitor response Assumes ECC is already enabled.
SDL_ECC_InjectErrorConfig_t::chkGrp
uint16_t chkGrp
Definition: sdl_ecc.h:155
SDL_ECC_ErrorInfo_t::bitErrorGroup
uint32_t bitErrorGroup
Definition: sdl_ecc.h:175
SDL_INJECT_ECC_ERROR_FORCING_2BIT_N_ROW_ONCE
@ SDL_INJECT_ECC_ERROR_FORCING_2BIT_N_ROW_ONCE
Definition: sdl_ecc.h:89
SDL_ECC_ErrorInfo_t::intrSrc
SDL_Ecc_AggrIntrSrc intrSrc
Definition: sdl_ecc.h:169
SDL_INJECT_ECC_ERROR_FORCING_1BIT_REPEAT
@ SDL_INJECT_ECC_ERROR_FORCING_1BIT_REPEAT
Definition: sdl_ecc.h:91
SDL_ECC_InjectErrorConfig_t
Definition: sdl_ecc.h:150
SDL_INJECT_ECC_NO_ERROR
@ SDL_INJECT_ECC_NO_ERROR
Definition: sdl_ecc.h:81
SDL_ECC_InjectErrorConfig_t::pErrMem
uint32_t * pErrMem
Definition: sdl_ecc.h:151
SDL_ECC_staticRegs
This structure contains the static register group for Ecc aggregator used by the SDL_ecc_aggrReadStat...
Definition: sdl_ip_ecc.h:350
SDL_ECC_AGGR_TYPE_FULL_FUNCTION
@ SDL_ECC_AGGR_TYPE_FULL_FUNCTION
Definition: sdl_ecc.h:69
SDL_ECC_VIMDEDVector_t
void(* SDL_ECC_VIMDEDVector_t)(void)
Definition: sdl_ecc.h:125
SDL_ECC_InjectErrorType
SDL_ECC_InjectErrorType
ECC Inject error types.
Definition: sdl_ecc.h:79
SDL_ECC_initEsm
int32_t SDL_ECC_initEsm(const SDL_ESM_Inst esmInstType)
Initializes an module for usage with ECC module.
SDL_ECC_ErrorInfo_t::bitErrorOffset
uint64_t bitErrorOffset
Definition: sdl_ecc.h:177
SDL_ECC_InjectErrorConfig_t::flipBitMask
uint32_t flipBitMask
Definition: sdl_ecc.h:153
SDL_ECC_AggregatorType
SDL_ECC_AggregatorType
Definition: sdl_ecc.h:66
SDL_INJECT_ECC_ERROR_FORCING_2BIT_REPEAT
@ SDL_INJECT_ECC_ERROR_FORCING_2BIT_REPEAT
Definition: sdl_ecc.h:93
SDL_ECC_RAM_ID_TYPE_INTERCONNECT
@ SDL_ECC_RAM_ID_TYPE_INTERCONNECT
Definition: sdl_ecc.h:108
SDL_Ecc_AggrIntrSrc
uint32_t SDL_Ecc_AggrIntrSrc
This enumerator defines the types of possible ECC errors.
Definition: sdl_ip_ecc.h:108
SDL_ECC_getESMErrorInfo
int32_t SDL_ECC_getESMErrorInfo(SDL_ESM_Inst instance, uint32_t intSrc, SDL_ECC_MemType *eccMemType, SDL_Ecc_AggrIntrSrc *intrSrcType)
Retrieves the ECC error information for the specified ESM error. If it isn't an ECC error or the ECC ...
SDL_ECC_ErrorInfo_t
Definition: sdl_ecc.h:164
SDL_ECC_InitConfig_t::pMemSubTypeList
SDL_ECC_MemSubType * pMemSubTypeList
Definition: sdl_ecc.h:141
SDL_ECC_MemSubType
uint32_t SDL_ECC_MemSubType
This enumerator indicate ECC memory Sub Type.
Definition: sdl_ecc.h:117
SDL_INJECT_ECC_ERROR_FORCING_1BIT_N_ROW_REPEAT
@ SDL_INJECT_ECC_ERROR_FORCING_1BIT_N_ROW_REPEAT
Definition: sdl_ecc.h:95
SDL_ECC_clearNIntrPending
int32_t SDL_ECC_clearNIntrPending(SDL_ECC_MemType eccMemType, SDL_ECC_MemSubType memSubType, SDL_Ecc_AggrIntrSrc intrSrc, SDL_Ecc_AggrEDCErrorSubType subType, uint32_t numEvents)
Clears N pending interrupts for the specified memtype, subtype and interrupt source.
SDL_ECC_ErrorInfo_t::injectBitErrCnt
uint32_t injectBitErrCnt
Definition: sdl_ecc.h:173
SDL_ECC_getErrorInfo
int32_t SDL_ECC_getErrorInfo(SDL_ECC_MemType eccMemType, SDL_Ecc_AggrIntrSrc intrSrc, SDL_ECC_ErrorInfo_t *pErrorInfo)
Retrieves the ECC error information for the specified memtype and interrupt source.
SDL_ECC_ErrorInfo_t::bitErrCnt
uint32_t bitErrCnt
Definition: sdl_ecc.h:171
SDL_ECC_ErrorInfo_t::eccMemType
SDL_ECC_MemType eccMemType
Definition: sdl_ecc.h:165
SDL_ECC_applicationCallbackFunction
void SDL_ECC_applicationCallbackFunction(SDL_ECC_MemType eccMemType, uint32_t errorSrc, uint32_t address, uint32_t ramId, uint64_t bitErrorOffset, uint32_t bitErrorGroup)
Application provided external callback function for ECC handling Called inside the reference function...
SDL_INJECT_ECC_ERROR_FORCING_2BIT_N_ROW_REPEAT
@ SDL_INJECT_ECC_ERROR_FORCING_2BIT_N_ROW_REPEAT
Definition: sdl_ecc.h:97
SDL_ECC_RamIdType
SDL_ECC_RamIdType
Definition: sdl_ecc.h:105
SDL_ECC_RAM_ID_TYPE_WRAPPER
@ SDL_ECC_RAM_ID_TYPE_WRAPPER
Definition: sdl_ecc.h:106
SDL_ECC_init
int32_t SDL_ECC_init(SDL_ECC_MemType eccMemType, const SDL_ECC_InitConfig_t *pECCInitConfig)
Initializes ECC module for ECC detection.