AM243x MCU+ SDK  09.01.00
sdl/esm/v0/esm.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2022
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  */
61 #ifndef SDL_ESM_H
62 #define SDL_ESM_H
63 
64 /* ========================================================================== */
65 /* Include Files */
66 /* ========================================================================== */
67 #include <stdint.h>
68 #include <stdbool.h>
69 
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 /* ========================================================================== */
76 /* Macros & Typedefs */
77 /* ========================================================================== */
78 
83 #define ESM_NUMBER_OF_GROUP_REGS (32u)
84 
94 typedef uint32_t esmOperationMode_t;
95 
96 #define ESM_OPERATION_MODE_NORMAL 0x0U
97 
98 #define ESM_OPERATION_MODE_ERROR_FORCE 0xAu
99 
108 typedef uint32_t esmIntrType_t;
109 
110 #define ESM_INTR_TYPE_CONFIG_ERROR (0x0u)
111 
112 #define ESM_INTR_TYPE_LOW_PRIO_ERROR (0x1u)
113 
114 #define ESM_INTR_TYPE_HIGH_PRIO_ERROR (0x2u)
115 
124 typedef uint32_t esmIntrPriorityLvl_t;
125 
126 #define ESM_INTR_PRIORITY_LEVEL_LOW (0x0u)
127 
128 #define ESM_INTR_PRIORITY_LEVEL_HIGH (0x1u)
129 
133 /* ========================================================================== */
134 /* Structures and Enums */
135 /* ========================================================================== */
136 
140 typedef struct esmRevisionId
141 {
142  uint32_t scheme;
144  uint32_t func;
146  uint32_t rtlRev;
148  uint32_t major;
150  uint32_t custom;
152  uint32_t minor;
155 
159 typedef struct esmInfo
160 {
161  uint32_t lastRstType;
166  uint32_t plsGrpNum;
168  uint32_t lvlGrpNum;
170 }esmInfo_t;
171 
176 typedef struct esmGroupIntrStatus
177 {
186  uint32_t grpIntrStatus;
193 
197 typedef struct {
198  volatile uint32_t RAW; /* Config Error Raw Status/Set Register */
199  volatile uint32_t INTR_EN_SET; /* Level Error Interrutp Enable Set Register */
200  volatile uint32_t INTR_EN_CLR; /* Level Error Interrupt Enabled Clear Register */
201  volatile uint32_t INT_PRIO; /* Level Error Interrupt Enabled Clear Register */
202  volatile uint32_t PIN_EN_SET; /* Level Error Interrupt Enabled Clear Register */
203  volatile uint32_t PIN_EN_CLR; /* Level Error Interrupt Enabled Clear Register */
205 
209 typedef struct {
211  volatile uint32_t PID; /* Revision Register */
212  volatile uint32_t INFO; /* Info Register */
213  volatile uint32_t EN; /* Global Enable Register */
214  volatile uint32_t ERR_EN_SET; /* Config Error Interrutp Enable Set Register */
215  volatile uint32_t ERR_EN_CLR; /* Config Error Interrupt Enabled Clear Register */
216  volatile uint32_t LOW_PRI; /* Low Priority Prioritized Register */
217  volatile uint32_t HI_PRI; /* High Priority Prioritized Register */
218  volatile uint32_t LOW; /* Low Priority Interrupt Status Register */
219  volatile uint32_t HI; /* High Priority Interrupt Status Register */
220  volatile uint32_t PIN_CTRL; /* Error Pin Control Register */
221  volatile uint32_t PIN_CNTR; /* Error Counter Value Register */
222  volatile uint32_t PIN_CNTR_PRE; /* Error Counter Value Pre-Load Register */
224 
225 
226 /* ========================================================================== */
227 /* Global Variables */
228 /* ========================================================================== */
229 /* None */
230 
231 /* ========================================================================== */
232 /* Function Declarations */
233 /* ========================================================================== */
263 int32_t SDL_ESM_setMode(uint32_t baseAddr, esmOperationMode_t mode);
264 
294 int32_t SDL_ESM_getPinMode(uint32_t baseAddr, esmOperationMode_t *pMode);
295 
329 int32_t SDL_ESM_setInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc,
330  bool enable);
331 
368 int32_t SDL_ESM_getInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc,
369  uint32_t *pInfluence);
405 int32_t SDL_ESM_setErrPinLowTimePreload(uint32_t baseAddr, uint32_t lowTime);
406 
442 int32_t SDL_ESM_getErrPinLowTimePreload(uint32_t baseAddr, uint32_t *pLowTime);
443 
444 
472 int32_t SDL_ESM_getCurrErrPinLowTimeCnt(uint32_t baseAddr, uint32_t *pPinCntrPre);
473 
501 int32_t SDL_ESM_getErrPinStatus(uint32_t baseAddr, uint32_t *pStatus);
502 
529 int32_t SDL_ESM_resetErrPin(uint32_t baseAddr);
530 
565 int32_t SDL_ESM_isEnableCfgIntr(uint32_t baseAddr, uint32_t group, uint32_t *pEnStatus);
566 
601 int32_t SDL_ESM_isEnableIntr(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pEnStatus);
602 
631 int32_t SDL_ESM_disableCfgIntr(uint32_t baseAddr, uint32_t intrNum);
632 
661 int32_t SDL_ESM_enableCfgIntr(uint32_t baseAddr, uint32_t group);
662 
691 int32_t SDL_ESM_enableIntr(uint32_t baseAddr, uint32_t intrNum);
692 
721 int32_t SDL_ESM_disableIntr(uint32_t baseAddr, uint32_t intrNum);
722 
759 int32_t SDL_ESM_setIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc,
760  esmIntrPriorityLvl_t intrPriorityLvl);
761 
798 int32_t SDL_ESM_getIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc,
799  esmIntrPriorityLvl_t *pIntrPriorityLvl);
800 
835 int32_t SDL_ESM_getCfgIntrStatus(uint32_t baseAddr, uint32_t group, uint32_t *pStaus);
836 
871 int32_t SDL_ESM_getIntrStatus(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStaus);
872 
905 int32_t SDL_ESM_setCfgIntrStatusRAW(uint32_t baseAddr, uint32_t group);
906 
939 int32_t SDL_ESM_setIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc);
940 
975 int32_t SDL_ESM_getIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStatus);
976 
1012 int32_t SDL_ESM_getGroupIntrStatus(uint32_t baseAddr, esmIntrPriorityLvl_t intrPrioType,
1013  esmGroupIntrStatus_t *pIntrstatus);
1014 
1046 int32_t SDL_ESM_clearCfgIntrStatus(uint32_t baseAddr, uint32_t group);
1047 
1079 int32_t SDL_ESM_clearIntrStatus(uint32_t baseAddr, uint32_t intrSrc);
1080 
1109 int32_t SDL_ESM_writeEOI(uint32_t baseAddr, esmIntrType_t intrType);
1110 
1139 int32_t SDL_ESM_getRevisionId(uint32_t baseAddr, esmRevisionId_t *pRevId);
1140 
1170 int32_t SDL_ESM_getInfo(uint32_t baseAddr, esmInfo_t *pInfo);
1171 
1172 
1206 int32_t SDL_ESM_getGlobalIntrEnabledStatus(uint32_t baseAddr, uint32_t *pStatus);
1207 
1208 
1233 int32_t SDL_ESM_enableGlobalIntr(uint32_t baseAddr);
1234 
1259 int32_t SDL_ESM_disableGlobalIntr(uint32_t baseAddr);
1260 
1286 int32_t SDL_ESM_reset(uint32_t baseAddr);
1287 
1290 #ifdef __cplusplus
1291 }
1292 
1293 #endif /*extern "C" */
1294 
1295 #endif /*SDL_ESM_H*/
SDL_ESM_setInfluenceOnErrPin
int32_t SDL_ESM_setInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc, bool enable)
This API is used to set the influence of interrupt on nERROR pin.
SDL_ESM_setIntrPriorityLvl
int32_t SDL_ESM_setIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t intrPriorityLvl)
This API is used to set interrupt level.
SDL_ESM_getGroupIntrStatus
int32_t SDL_ESM_getGroupIntrStatus(uint32_t baseAddr, esmIntrPriorityLvl_t intrPrioType, esmGroupIntrStatus_t *pIntrstatus)
This API is used to get the interrupt/error status for a group. This will also return highest pending...
SDL_ESM_setIntrStatusRAW
int32_t SDL_ESM_setIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc)
This API is used to set the interrupt RAW status.
SDL_ESM_getInfo
int32_t SDL_ESM_getInfo(uint32_t baseAddr, esmInfo_t *pInfo)
This API is used read the ESM information register.
esmGroupIntrStatus_t
Structure to access the status of interrupts belonging to a High or Low priority interrupt.
Definition: sdl/esm/v0/esm.h:177
ESM_NUMBER_OF_GROUP_REGS
#define ESM_NUMBER_OF_GROUP_REGS
ESM Operation Mode type.
Definition: sdl/esm/v0/esm.h:83
SDL_ESM_staticRegs::PIN_CNTR
volatile uint32_t PIN_CNTR
Definition: sdl/esm/v0/esm.h:221
esmRevisionId_t::minor
uint32_t minor
Definition: sdl/esm/v0/esm.h:152
SDL_esmRegs_ERR_GRP_STATIC::INTR_EN_CLR
volatile uint32_t INTR_EN_CLR
Definition: sdl/esm/v0/esm.h:200
esmGroupIntrStatus_t::highestPendLvlIntNum
uint32_t highestPendLvlIntNum
Definition: sdl/esm/v0/esm.h:182
SDL_ESM_getErrPinLowTimePreload
int32_t SDL_ESM_getErrPinLowTimePreload(uint32_t baseAddr, uint32_t *pLowTime)
This API is used to read the low time counter pre-load value.
SDL_ESM_getInfluenceOnErrPin
int32_t SDL_ESM_getInfluenceOnErrPin(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pInfluence)
This API is used to get the influence of interrupt on nERROR pin.
SDL_ESM_setCfgIntrStatusRAW
int32_t SDL_ESM_setCfgIntrStatusRAW(uint32_t baseAddr, uint32_t group)
This API is used to set the configuration interrupt RAW status for a group.
esmRevisionId_t::custom
uint32_t custom
Definition: sdl/esm/v0/esm.h:150
SDL_ESM_staticRegs
ESM static registers list.
Definition: sdl/esm/v0/esm.h:209
SDL_ESM_enableGlobalIntr
int32_t SDL_ESM_enableGlobalIntr(uint32_t baseAddr)
This API is used to enable Global control of interrupt.
esmRevisionId_t::func
uint32_t func
Definition: sdl/esm/v0/esm.h:144
SDL_esmRegs_ERR_GRP_STATIC::PIN_EN_SET
volatile uint32_t PIN_EN_SET
Definition: sdl/esm/v0/esm.h:202
SDL_ESM_disableCfgIntr
int32_t SDL_ESM_disableCfgIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to disable the configuration interrupt.
SDL_ESM_getIntrStatus
int32_t SDL_ESM_getIntrStatus(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStaus)
This API is used to get the interrupt status.
esmOperationMode_t
uint32_t esmOperationMode_t
ESM Operation Mode type.
Definition: sdl/esm/v0/esm.h:94
esmInfo_t
Structure for accessing information register of ESM module.
Definition: sdl/esm/v0/esm.h:160
esmRevisionId_t
Structure for accessing Revision ID of ESM module.
Definition: sdl/esm/v0/esm.h:141
SDL_ESM_getPinMode
int32_t SDL_ESM_getPinMode(uint32_t baseAddr, esmOperationMode_t *pMode)
This API is used to read operation mode of ESM module.
esmRevisionId_t::rtlRev
uint32_t rtlRev
Definition: sdl/esm/v0/esm.h:146
SDL_esmRegs_ERR_GRP_STATIC::PIN_EN_CLR
volatile uint32_t PIN_EN_CLR
Definition: sdl/esm/v0/esm.h:203
SDL_ESM_getCfgIntrStatus
int32_t SDL_ESM_getCfgIntrStatus(uint32_t baseAddr, uint32_t group, uint32_t *pStaus)
This API is used to get the configuration interrupt status for a group.
SDL_ESM_staticRegs::INFO
volatile uint32_t INFO
Definition: sdl/esm/v0/esm.h:212
SDL_ESM_getGlobalIntrEnabledStatus
int32_t SDL_ESM_getGlobalIntrEnabledStatus(uint32_t baseAddr, uint32_t *pStatus)
This API is used read the ESM information register.
SDL_ESM_staticRegs::PIN_CNTR_PRE
volatile uint32_t PIN_CNTR_PRE
Definition: sdl/esm/v0/esm.h:222
esmInfo_t::lastRstType
uint32_t lastRstType
Definition: sdl/esm/v0/esm.h:161
esmIntrType_t
uint32_t esmIntrType_t
Definition: sdl/esm/v0/esm.h:108
SDL_ESM_staticRegs::LOW
volatile uint32_t LOW
Definition: sdl/esm/v0/esm.h:218
SDL_ESM_getErrPinStatus
int32_t SDL_ESM_getErrPinStatus(uint32_t baseAddr, uint32_t *pStatus)
This API is used to get the current status of nERROR pin.
SDL_ESM_staticRegs::PIN_CTRL
volatile uint32_t PIN_CTRL
Definition: sdl/esm/v0/esm.h:220
SDL_ESM_getIntrPriorityLvl
int32_t SDL_ESM_getIntrPriorityLvl(uint32_t baseAddr, uint32_t intrSrc, esmIntrPriorityLvl_t *pIntrPriorityLvl)
This API is used to get interrupt level.
SDL_ESM_reset
int32_t SDL_ESM_reset(uint32_t baseAddr)
This API is used to reset ESM module. Reset is used to reset all enables and raw status bits.
SDL_ESM_staticRegs::ERR_EN_SET
volatile uint32_t ERR_EN_SET
Definition: sdl/esm/v0/esm.h:214
SDL_ESM_isEnableIntr
int32_t SDL_ESM_isEnableIntr(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pEnStatus)
This API is used check if interrupt is enabled/disabled.
SDL_ESM_disableGlobalIntr
int32_t SDL_ESM_disableGlobalIntr(uint32_t baseAddr)
This API is used to disable Global control of interrupt.
esmRevisionId_t::scheme
uint32_t scheme
Definition: sdl/esm/v0/esm.h:142
SDL_ESM_setErrPinLowTimePreload
int32_t SDL_ESM_setErrPinLowTimePreload(uint32_t baseAddr, uint32_t lowTime)
This API is used to configure the low time counter pre-load value.
SDL_ESM_staticRegs::EN
volatile uint32_t EN
Definition: sdl/esm/v0/esm.h:213
esmInfo_t::plsGrpNum
uint32_t plsGrpNum
Definition: sdl/esm/v0/esm.h:166
SDL_esmRegs_ERR_GRP_STATIC::RAW
volatile uint32_t RAW
Definition: sdl/esm/v0/esm.h:198
SDL_ESM_getCurrErrPinLowTimeCnt
int32_t SDL_ESM_getCurrErrPinLowTimeCnt(uint32_t baseAddr, uint32_t *pPinCntrPre)
This API is used to get the current value of low time counter.
SDL_esmRegs_ERR_GRP_STATIC::INT_PRIO
volatile uint32_t INT_PRIO
Definition: sdl/esm/v0/esm.h:201
esmIntrPriorityLvl_t
uint32_t esmIntrPriorityLvl_t
Definition: sdl/esm/v0/esm.h:124
mode
char mode[32]
Definition: tisci_pm_core.h:1
SDL_ESM_writeEOI
int32_t SDL_ESM_writeEOI(uint32_t baseAddr, esmIntrType_t intrType)
This API is used to write EOI.
SDL_ESM_disableIntr
int32_t SDL_ESM_disableIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to disable interrupt.
SDL_ESM_getIntrStatusRAW
int32_t SDL_ESM_getIntrStatusRAW(uint32_t baseAddr, uint32_t intrSrc, uint32_t *pStatus)
This API is used to get the interrupt RAW status.
SDL_ESM_enableCfgIntr
int32_t SDL_ESM_enableCfgIntr(uint32_t baseAddr, uint32_t group)
This API is used to enable the configuration interrupt.
SDL_ESM_staticRegs::HI
volatile uint32_t HI
Definition: sdl/esm/v0/esm.h:219
SDL_ESM_isEnableCfgIntr
int32_t SDL_ESM_isEnableCfgIntr(uint32_t baseAddr, uint32_t group, uint32_t *pEnStatus)
This API is used check if the configuration interrupt for a group is enabled/disabled.
esmGroupIntrStatus_t::highestPendPlsIntNum
uint32_t highestPendPlsIntNum
Definition: sdl/esm/v0/esm.h:178
SDL_ESM_enableIntr
int32_t SDL_ESM_enableIntr(uint32_t baseAddr, uint32_t intrNum)
This API is used to enable interrupt.
SDL_ESM_staticRegs::LOW_PRI
volatile uint32_t LOW_PRI
Definition: sdl/esm/v0/esm.h:216
esmRevisionId_t::major
uint32_t major
Definition: sdl/esm/v0/esm.h:148
SDL_ESM_staticRegs::PID
volatile uint32_t PID
Definition: sdl/esm/v0/esm.h:211
SDL_ESM_setMode
int32_t SDL_ESM_setMode(uint32_t baseAddr, esmOperationMode_t mode)
This API is used to configure operation mode of ESM module.
SDL_ESM_clearIntrStatus
int32_t SDL_ESM_clearIntrStatus(uint32_t baseAddr, uint32_t intrSrc)
This API is used to clear the interrupt status.
SDL_ESM_staticRegs::HI_PRI
volatile uint32_t HI_PRI
Definition: sdl/esm/v0/esm.h:217
SDL_ESM_resetErrPin
int32_t SDL_ESM_resetErrPin(uint32_t baseAddr)
This API is used to reset the nERROR pin.
SDL_ESM_staticRegs::ERR_EN_CLR
volatile uint32_t ERR_EN_CLR
Definition: sdl/esm/v0/esm.h:215
SDL_ESM_clearCfgIntrStatus
int32_t SDL_ESM_clearCfgIntrStatus(uint32_t baseAddr, uint32_t group)
This API is used to clear the configuration interrupt status.
esmInfo_t::lvlGrpNum
uint32_t lvlGrpNum
Definition: sdl/esm/v0/esm.h:168
SDL_ESM_getRevisionId
int32_t SDL_ESM_getRevisionId(uint32_t baseAddr, esmRevisionId_t *pRevId)
This API is used get the ESM revision ID.
esmGroupIntrStatus_t::grpIntrStatus
uint32_t grpIntrStatus
Definition: sdl/esm/v0/esm.h:186
SDL_esmRegs_ERR_GRP_STATIC::INTR_EN_SET
volatile uint32_t INTR_EN_SET
Definition: sdl/esm/v0/esm.h:199
SDL_esmRegs_ERR_GRP_STATIC
ESM Error Group static registers list.
Definition: sdl/esm/v0/esm.h:197