AM62Ax MCU+ SDK  09.01.00
sdl_pok_def.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  */
47 #ifndef SDL_POK_DEF_H
48 #define SDL_POK_DEF_H
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #include <sdl/include/sdl_types.h>
55 #include <sdl/include/soc_config.h>
56 #include <sdl/esm/sdl_ip_esm.h>
57 
58 #if defined (IP_VERSION_POK_V1)
59 #include <sdl/pok/v1/soc/sdl_soc_pok.h>
60 #endif
61 
75 typedef struct SDL_pokShiftsAndMasks
76 {
77  volatile uint32_t *pokAddr;
78  volatile uint32_t *pokOVAddr;
79  volatile uint32_t *pokDetAddr;
80  volatile uint32_t *pokEnSelAddr;
81  volatile uint32_t *pokEnPPAddr;
82  volatile uint32_t *deglitchSelAddr;
83  uint32_t pokEnPPMask;
84  uint32_t pokEnPPShift;
85  uint32_t hystMask;
86  uint32_t hystShift;
87  uint32_t hystOVMask;
88  uint32_t hystOVShift;
89  uint32_t vdDetMask;
90  uint32_t vdDetShift;
91  uint32_t vdDetOVMask;
92  uint32_t vdDetOVShift;
93  uint32_t detEnMask;
94  uint32_t detEnShift;
95  uint32_t ovSelMask;
96  uint32_t ovSelShift;
97  uint32_t pokEnSelMask;
98  uint32_t pokEnSelShift;
99  uint32_t trimMask;
100  uint32_t trimShift;
101  uint32_t trimOVMask;
102  uint32_t trimOVShift;
103  uint32_t deglitchSelMask;
106 
107 typedef struct SDL_pokPRGInfo
108 {
109  volatile uint32_t *addr;
110  uint32_t pokEnPPMask;
111  uint32_t pokEnPPShift;
113 
129 typedef int8_t SDL_PRG_Inst;
130 typedef int8_t SDL_POK_Inst ;
131 typedef uint8_t SDL_pok_type;
132 
134 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
135 
136 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
137 
138 
151 typedef uint8_t SDL_pwrss_deglitch;
152 
154 #define SDL_PWRSS_DEGLITCH_5US ((SDL_pwrss_deglitch) 0U)
155 
156 #define SDL_PWRSS_DEGLITCH_10US ((SDL_pwrss_deglitch) 1U)
157 
158 #define SDL_PWRSS_DEGLITCH_15US ((SDL_pwrss_deglitch) 2U)
159 
160 #define SDL_PWRSS_DEGLITCH_20US ((SDL_pwrss_deglitch) 3U)
161 
162 #define SDL_PWRSS_DEGLITCH_GET_VALUE ((SDL_pwrss_deglitch) 4U)
163 
164 #define SDL_PWRSS_DEGLITCH_NO_ACTION ((SDL_pwrss_deglitch) 5U)
165 
179 typedef uint8_t SDL_pwrss_pp;
180 
182 #define SDL_PWRSS_PP_MODE_DISABLE ((SDL_pwrss_pp) 0U)
183 
184 #define SDL_PWRSS_PP_MODE_ENABLE ((SDL_pwrss_pp) 1U)
185 
186 #define SDL_PWRSS_PP_MODE_NO_ACTION ((SDL_pwrss_pp) 2U)
187 
202 typedef uint8_t SDL_pwrss_hysteresis;
203 
205 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
206 
207 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
208 
209 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
210 
211 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
212 
237 typedef uint8_t SDL_pwrss_trim;
244 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
245 
247 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
248 
250 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
251 
253 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
254 
255 
268 typedef uint8_t SDL_pwrss_vd_mode;
269 
271 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
272 
273 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
274 
275 #define SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 2U)
276 
277 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 3U)
278 
279 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 4U)
280 
293 typedef uint8_t SDL_POK_detection_status;
295 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
296 
297 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
298 
311 typedef uint8_t SDL_POK_detection;
313 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
314 
315 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
316 
317 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
318 
319 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
320 
321 
334 typedef uint8_t SDL_POK_enSelSrc;
336 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
337 
338 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
339 
340 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
341 
342 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
343 
356 typedef uint8_t SDL_por_trim_sel;
357 
359 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
360 
363 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
364 
366 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
367 
369 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
370 
371 
384 typedef uint8_t SDL_por_module_status ;
385 
387 #define SDL_POR_MODULE_STATUS_FUNCTIONAL_MODE ((SDL_por_module_status) 0U)
388 
389 #define SDL_POR_MODULE_STATUS_RESET_MODE ((SDL_por_module_status) 1U)
390 
402 typedef enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t;
403 
419 typedef struct SDL_pokCfg
420 {
438 
446 typedef struct SDL_pokVal
447 {
464 } SDL_pokVal_t;
465 
466 
475 typedef struct SDL_pokPorCfg
476 {
482 
491 typedef struct SDL_pokPorVal
492 {
498 
502  SDL_PRG_Inst instance,
503  SDL_pokPRGInfo_t *pPRGInfo);
504 
505 
506 /* Function to get the error signal wrt given POKID for v1 of IP */
507 void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag);
508 
509 
510 #ifdef __cplusplus
511 }
512 #endif /* extern "C" */
513 
514 #endif /* end of SDL_POK_DEF_H definition */
SDL_pokShiftsAndMasks_t::detEnShift
uint32_t detEnShift
Definition: sdl_pok_def.h:94
SDL_POK_detection
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:311
SDL_pokVal_t::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:455
SDL_pokPRGInfo_t::pokEnPPMask
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:110
SDL_pokShiftsAndMasks_t::pokAddr
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:77
SDL_POK_config::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:436
SDL_POK_config::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:428
SDL_POK_Inst
int8_t SDL_POK_Inst
Definition: sdl_pok_def.h:130
SDL_pokPorVal_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:496
SDL_pokPorCfg_t
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:476
SDL_pokVal_t::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:463
SDL_pok_getPRGInfo
int32_t SDL_pok_getPRGInfo(SDL_mcuCtrlRegsBase_t *pBaseAddress, SDL_PRG_Inst instance, SDL_pokPRGInfo_t *pPRGInfo)
SDL_pokShiftsAndMasks_t::pokEnPPMask
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:83
SDL_pokVal_t::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:451
SDL_pokShiftsAndMasks_t::ovSelShift
uint32_t ovSelShift
Definition: sdl_pok_def.h:96
SDL_POK_config::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:422
SDL_pokPorCfg_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:480
SDL_pokShiftsAndMasks_t::hystOVMask
uint32_t hystOVMask
Definition: sdl_pok_def.h:87
SDL_pokPorVal_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:494
SDL_pokShiftsAndMasks_t::hystMask
uint32_t hystMask
Definition: sdl_pok_def.h:85
SDL_POK_config::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:424
SDL_POK_config
POK Configuration structure.
Definition: sdl_pok_def.h:420
SDL_pokShiftsAndMasks_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:84
SDL_pokShiftsAndMasks_t::pokEnSelMask
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:97
SDL_pokShiftsAndMasks_t::vdDetOVShift
uint32_t vdDetOVShift
Definition: sdl_pok_def.h:92
SDL_POK_config::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:434
SDL_PRG_Inst
int8_t SDL_PRG_Inst
Definition: sdl_pok_def.h:129
SDL_pokShiftsAndMasks_t::trimShift
uint32_t trimShift
Definition: sdl_pok_def.h:100
SDL_pwrss_trim
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:237
SDL_pokShiftsAndMasks_t::pokEnPPAddr
volatile uint32_t * pokEnPPAddr
Definition: sdl_pok_def.h:81
SDL_pokShiftsAndMasks_t
Definition: sdl_pok_def.h:76
SDL_pokShiftsAndMasks_t::hystShift
uint32_t hystShift
Definition: sdl_pok_def.h:86
SDL_pokPRGInfo_t
Definition: sdl_pok_def.h:108
SDL_pokShiftsAndMasks_t::pokDetAddr
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:79
SDL_pokPRGInfo_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:111
SDL_pokShiftsAndMasks_t::hystOVShift
uint32_t hystOVShift
Definition: sdl_pok_def.h:88
SDL_pokPorCfg_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:478
SDL_pokShiftsAndMasks_t::deglitchSelShift
uint32_t deglitchSelShift
Definition: sdl_pok_def.h:104
SDL_pok_type
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:131
SDL_pokShiftsAndMasks_t::detEnMask
uint32_t detEnMask
Definition: sdl_pok_def.h:93
SDL_pokVal_t::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:453
SDL_POK_config::detectionCtrl
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:432
SDL_pokShiftsAndMasks_t::vdDetMask
uint32_t vdDetMask
Definition: sdl_pok_def.h:89
SDL_pokShiftsAndMasks_t::deglitchSelAddr
volatile uint32_t * deglitchSelAddr
Definition: sdl_pok_def.h:82
SDL_mcuCtrlRegsBase_t
enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t
Definition: sdl_pok_def.h:402
SDL_POK_config::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:430
SDL_pokPRGInfo_t::addr
volatile uint32_t * addr
Definition: sdl_pok_def.h:109
SDL_pokShiftsAndMasks_t::trimOVShift
uint32_t trimOVShift
Definition: sdl_pok_def.h:102
SDL_pokShiftsAndMasks_t::pokEnSelShift
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:98
SDL_pokShiftsAndMasks_t::pokEnSelAddr
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:80
SDL_pokVal_t::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:461
SDL_pokShiftsAndMasks_t::vdDetOVMask
uint32_t vdDetOVMask
Definition: sdl_pok_def.h:91
SDL_pokShiftsAndMasks_t::ovSelMask
uint32_t ovSelMask
Definition: sdl_pok_def.h:95
SDL_pokShiftsAndMasks_t::trimOVMask
uint32_t trimOVMask
Definition: sdl_pok_def.h:101
SDL_pokShiftsAndMasks_t::pokOVAddr
volatile uint32_t * pokOVAddr
Definition: sdl_pok_def.h:78
SDL_pokShiftsAndMasks_t::vdDetShift
uint32_t vdDetShift
Definition: sdl_pok_def.h:90
SDL_pokPorVal_t
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:492
SDL_POK_config::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:426
SDL_pokVal_t::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:457
SDL_pokShiftsAndMasks_t::trimMask
uint32_t trimMask
Definition: sdl_pok_def.h:99
SDL_por_trim_sel
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:356
SDL_por_module_status
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:384
sdlGetErrSig
void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag)
SDL_pwrss_vd_mode
uint8_t SDL_pwrss_vd_mode
Definition: sdl_pok_def.h:268
SDL_pokVal_t
POK Configuration structure read value.
Definition: sdl_pok_def.h:447
SDL_pokVal_t::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:449
SDL_pwrss_hysteresis
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:202
SDL_pwrss_deglitch
uint8_t SDL_pwrss_deglitch
Definition: sdl_pok_def.h:151
SDL_POK_enSelSrc
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:334
SDL_POK_detection_status
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:293
SDL_pokShiftsAndMasks_t::deglitchSelMask
uint32_t deglitchSelMask
Definition: sdl_pok_def.h:103
SDL_pokVal_t::detectionStatus
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:459
SDL_pwrss_pp
uint8_t SDL_pwrss_pp
Definition: sdl_pok_def.h:179