AM62x MCU+ SDK  09.02.01
sdl_pok_def.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023-2024 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  */
46 #ifndef SDL_POK_DEF_H
47 #define SDL_POK_DEF_H
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 #include <sdl/include/sdl_types.h>
54 #include <sdl/include/soc_config.h>
55 #include <sdl/esm/sdl_ip_esm.h>
56 
57 #if defined (IP_VERSION_POK_V1)
58 #include <sdl/pok/v1/soc/sdl_soc_pok.h>
59 #endif
60 
74 typedef struct SDL_pokShiftsAndMasks
75 {
76  volatile uint32_t *pokAddr;
77  volatile uint32_t *pokOVAddr;
78  volatile uint32_t *pokDetAddr;
79  volatile uint32_t *pokEnSelAddr;
80  volatile uint32_t *pokEnPPAddr;
81  volatile uint32_t *deglitchSelAddr;
82  uint32_t pokEnPPMask;
83  uint32_t pokEnPPShift;
84  uint32_t hystMask;
85  uint32_t hystShift;
86  uint32_t hystOVMask;
87  uint32_t hystOVShift;
88  uint32_t vdDetMask;
89  uint32_t vdDetShift;
90  uint32_t vdDetOVMask;
91  uint32_t vdDetOVShift;
92  uint32_t detEnMask;
93  uint32_t detEnShift;
94  uint32_t ovSelMask;
95  uint32_t ovSelShift;
96  uint32_t pokEnSelMask;
97  uint32_t pokEnSelShift;
98  uint32_t trimMask;
99  uint32_t trimShift;
100  uint32_t trimOVMask;
101  uint32_t trimOVShift;
102  uint32_t deglitchSelMask;
105 
106 typedef struct SDL_pokPRGInfo
107 {
108  volatile uint32_t *addr;
109  uint32_t pokEnPPMask;
110  uint32_t pokEnPPShift;
112 
129 typedef uint8_t SDL_pok_type;
130 
132 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
133 
134 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
135 
136 
149 typedef uint8_t SDL_pwrss_deglitch;
150 
152 #define SDL_PWRSS_DEGLITCH_5US ((SDL_pwrss_deglitch) 0U)
153 
154 #define SDL_PWRSS_DEGLITCH_10US ((SDL_pwrss_deglitch) 1U)
155 
156 #define SDL_PWRSS_DEGLITCH_15US ((SDL_pwrss_deglitch) 2U)
157 
158 #define SDL_PWRSS_DEGLITCH_20US ((SDL_pwrss_deglitch) 3U)
159 
160 #define SDL_PWRSS_DEGLITCH_GET_VALUE ((SDL_pwrss_deglitch) 4U)
161 
162 #define SDL_PWRSS_DEGLITCH_NO_ACTION ((SDL_pwrss_deglitch) 5U)
163 
177 typedef uint8_t SDL_pwrss_pp;
178 
180 #define SDL_PWRSS_PP_MODE_DISABLE ((SDL_pwrss_pp) 0U)
181 
182 #define SDL_PWRSS_PP_MODE_ENABLE ((SDL_pwrss_pp) 1U)
183 
184 #define SDL_PWRSS_PP_MODE_NO_ACTION ((SDL_pwrss_pp) 2U)
185 
200 typedef uint8_t SDL_pwrss_hysteresis;
201 
203 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
204 
205 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
206 
207 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
208 
209 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
210 
235 typedef uint8_t SDL_pwrss_trim;
242 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
243 
245 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
246 
248 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
249 
251 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
252 
253 
266 typedef uint8_t SDL_pwrss_vd_mode;
267 
269 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
270 
271 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
272 
273 #define SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 2U)
274 
275 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 3U)
276 
277 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 4U)
278 
291 typedef uint8_t SDL_POK_detection_status;
293 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
294 
295 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
296 
309 typedef uint8_t SDL_POK_detection;
311 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
312 
313 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
314 
315 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
316 
317 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
318 
319 
332 typedef uint8_t SDL_POK_enSelSrc;
334 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
335 
336 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
337 
338 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
339 
340 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
341 
354 typedef uint8_t SDL_por_trim_sel;
355 
357 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
358 
361 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
362 
364 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
365 
367 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
368 
369 
382 typedef uint8_t SDL_por_module_status ;
383 
385 #define SDL_POR_MODULE_STATUS_FUNCTIONAL_MODE ((SDL_por_module_status) 0U)
386 
387 #define SDL_POR_MODULE_STATUS_RESET_MODE ((SDL_por_module_status) 1U)
388 
400 typedef enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t;
401 
417 typedef struct SDL_pokCfg
418 {
436 
444 typedef struct SDL_pokVal
445 {
462 } SDL_pokVal_t;
463 
464 
473 typedef struct SDL_pokPorCfg
474 {
480 
489 typedef struct SDL_pokPorVal
490 {
496 
500  SDL_PRG_Inst instance,
501  SDL_pokPRGInfo_t *pPRGInfo);
502 
503 
504 /* Function to get the error signal wrt given POKID for v1 of IP */
505 void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag);
506 
507 
508 #ifdef __cplusplus
509 }
510 #endif /* extern "C" */
511 
512 #endif /* end of SDL_POK_DEF_H definition */
SDL_pokShiftsAndMasks_t::detEnShift
uint32_t detEnShift
Definition: sdl_pok_def.h:93
SDL_POK_detection
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:309
SDL_pokVal_t::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:453
SDL_pokPRGInfo_t::pokEnPPMask
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:109
SDL_pokShiftsAndMasks_t::pokAddr
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:76
SDL_POK_config::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:434
SDL_POK_config::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:426
SDL_pokPorVal_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:494
SDL_pokPorCfg_t
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:474
SDL_pokVal_t::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:461
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:82
SDL_pokVal_t::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:449
SDL_pokShiftsAndMasks_t::ovSelShift
uint32_t ovSelShift
Definition: sdl_pok_def.h:95
SDL_PRG_Inst
int8_t SDL_PRG_Inst
Definition: sdl_soc_pok.h:104
SDL_POK_config::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:420
SDL_pokPorCfg_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:478
SDL_pokShiftsAndMasks_t::hystOVMask
uint32_t hystOVMask
Definition: sdl_pok_def.h:86
SDL_pokPorVal_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:492
SDL_pokShiftsAndMasks_t::hystMask
uint32_t hystMask
Definition: sdl_pok_def.h:84
SDL_POK_config::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:422
SDL_POK_config
POK Configuration structure.
Definition: sdl_pok_def.h:418
SDL_pokShiftsAndMasks_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:83
SDL_pokShiftsAndMasks_t::pokEnSelMask
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:96
SDL_pokShiftsAndMasks_t::vdDetOVShift
uint32_t vdDetOVShift
Definition: sdl_pok_def.h:91
SDL_POK_config::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:432
SDL_pokShiftsAndMasks_t::trimShift
uint32_t trimShift
Definition: sdl_pok_def.h:99
SDL_pwrss_trim
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:235
SDL_pokShiftsAndMasks_t::pokEnPPAddr
volatile uint32_t * pokEnPPAddr
Definition: sdl_pok_def.h:80
SDL_pokShiftsAndMasks_t
Definition: sdl_pok_def.h:75
SDL_pokShiftsAndMasks_t::hystShift
uint32_t hystShift
Definition: sdl_pok_def.h:85
SDL_pokPRGInfo_t
Definition: sdl_pok_def.h:107
SDL_pokShiftsAndMasks_t::pokDetAddr
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:78
SDL_pokPRGInfo_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:110
SDL_pokShiftsAndMasks_t::hystOVShift
uint32_t hystOVShift
Definition: sdl_pok_def.h:87
SDL_pokPorCfg_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:476
SDL_pokShiftsAndMasks_t::deglitchSelShift
uint32_t deglitchSelShift
Definition: sdl_pok_def.h:103
SDL_pok_type
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:129
SDL_pokShiftsAndMasks_t::detEnMask
uint32_t detEnMask
Definition: sdl_pok_def.h:92
SDL_pokVal_t::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:451
SDL_POK_config::detectionCtrl
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:430
SDL_pokShiftsAndMasks_t::vdDetMask
uint32_t vdDetMask
Definition: sdl_pok_def.h:88
SDL_pokShiftsAndMasks_t::deglitchSelAddr
volatile uint32_t * deglitchSelAddr
Definition: sdl_pok_def.h:81
SDL_mcuCtrlRegsBase_t
enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t
Definition: sdl_pok_def.h:400
SDL_POK_config::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:428
SDL_pokPRGInfo_t::addr
volatile uint32_t * addr
Definition: sdl_pok_def.h:108
SDL_pokShiftsAndMasks_t::trimOVShift
uint32_t trimOVShift
Definition: sdl_pok_def.h:101
SDL_pokShiftsAndMasks_t::pokEnSelShift
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:97
SDL_pokShiftsAndMasks_t::pokEnSelAddr
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:79
SDL_pokVal_t::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:459
SDL_pokShiftsAndMasks_t::vdDetOVMask
uint32_t vdDetOVMask
Definition: sdl_pok_def.h:90
SDL_pokShiftsAndMasks_t::ovSelMask
uint32_t ovSelMask
Definition: sdl_pok_def.h:94
SDL_pokShiftsAndMasks_t::trimOVMask
uint32_t trimOVMask
Definition: sdl_pok_def.h:100
SDL_pokShiftsAndMasks_t::pokOVAddr
volatile uint32_t * pokOVAddr
Definition: sdl_pok_def.h:77
SDL_pokShiftsAndMasks_t::vdDetShift
uint32_t vdDetShift
Definition: sdl_pok_def.h:89
SDL_pokPorVal_t
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:490
SDL_POK_config::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:424
SDL_pokVal_t::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:455
SDL_pokShiftsAndMasks_t::trimMask
uint32_t trimMask
Definition: sdl_pok_def.h:98
SDL_por_trim_sel
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:354
SDL_por_module_status
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:382
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:266
SDL_pokVal_t
POK Configuration structure read value.
Definition: sdl_pok_def.h:445
SDL_pokVal_t::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:447
SDL_pwrss_hysteresis
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:200
SDL_pwrss_deglitch
uint8_t SDL_pwrss_deglitch
Definition: sdl_pok_def.h:149
SDL_POK_enSelSrc
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:332
SDL_POK_detection_status
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:291
SDL_POK_Inst
int8_t SDL_POK_Inst
Definition: sdl_soc_pok.h:75
SDL_pokShiftsAndMasks_t::deglitchSelMask
uint32_t deglitchSelMask
Definition: sdl_pok_def.h:102
SDL_pokVal_t::detectionStatus
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:457
SDL_pwrss_pp
uint8_t SDL_pwrss_pp
Definition: sdl_pok_def.h:177