AM62x MCU+ SDK  09.00.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 
56 
57 #if defined (SOC_AM62X)
59 #include <sdl/esm/sdl_ip_esm.h>
60 #endif
61 
62 
63 #if defined (SOC_AM62AX)
64 #include <sdl/pok/v1/soc/am62ax/sdl_soc_pok.h>
65 #include <sdl/esm/sdl_ip_esm.h>
66 #endif
67 
80 typedef struct SDL_pokShiftsAndMasks
81 {
82  volatile uint32_t *pokAddr;
83  volatile uint32_t *pokOVAddr;
84  volatile uint32_t *pokDetAddr;
85  volatile uint32_t *pokEnSelAddr;
86  volatile uint32_t *pokEnPPAddr;
87  volatile uint32_t *deglitchSelAddr;
88  uint32_t pokEnPPMask;
89  uint32_t pokEnPPShift;
90  uint32_t hystMask;
91  uint32_t hystShift;
92  uint32_t hystOVMask;
93  uint32_t hystOVShift;
94  uint32_t vdDetMask;
95  uint32_t vdDetShift;
96  uint32_t vdDetOVMask;
97  uint32_t vdDetOVShift;
98  uint32_t detEnMask;
99  uint32_t detEnShift;
100  uint32_t ovSelMask;
101  uint32_t ovSelShift;
102  uint32_t pokEnSelMask;
103  uint32_t pokEnSelShift;
104  uint32_t trimMask;
105  uint32_t trimShift;
106  uint32_t trimOVMask;
107  uint32_t trimOVShift;
108  uint32_t deglitchSelMask;
111 
112 typedef struct SDL_pokPRGInfo
113 {
114  volatile uint32_t *addr;
115  uint32_t pokEnPPMask;
116  uint32_t pokEnPPShift;
118 
134 typedef int8_t SDL_PRG_Inst;
135 typedef int8_t SDL_POK_Inst ;
136 typedef uint8_t SDL_pok_type;
137 
139 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
140 
141 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
142 
143 
156 typedef uint8_t SDL_pwrss_deglitch;
157 
159 #define SDL_PWRSS_DEGLITCH_5US ((SDL_pwrss_deglitch) 0U)
160 
161 #define SDL_PWRSS_DEGLITCH_10US ((SDL_pwrss_deglitch) 1U)
162 
163 #define SDL_PWRSS_DEGLITCH_15US ((SDL_pwrss_deglitch) 2U)
164 
165 #define SDL_PWRSS_DEGLITCH_20US ((SDL_pwrss_deglitch) 3U)
166 
167 #define SDL_PWRSS_DEGLITCH_GET_VALUE ((SDL_pwrss_deglitch) 4U)
168 
169 #define SDL_PWRSS_DEGLITCH_NO_ACTION ((SDL_pwrss_deglitch) 5U)
170 
184 typedef uint8_t SDL_pwrss_pp;
185 
187 #define SDL_PWRSS_PP_MODE_DISABLE ((SDL_pwrss_pp) 0U)
188 
189 #define SDL_PWRSS_PP_MODE_ENABLE ((SDL_pwrss_pp) 1U)
190 
191 #define SDL_PWRSS_PP_MODE_NO_ACTION ((SDL_pwrss_pp) 2U)
192 
207 typedef uint8_t SDL_pwrss_hysteresis;
208 
210 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
211 
212 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
213 
214 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
215 
216 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
217 
242 typedef uint8_t SDL_pwrss_trim;
249 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
250 
252 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
253 
255 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
256 
258 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
259 
260 
273 typedef uint8_t SDL_pwrss_vd_mode;
274 
276 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
277 
278 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
279 
280 #define SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 2U)
281 
282 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 3U)
283 
284 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 4U)
285 
298 typedef uint8_t SDL_POK_detection_status;
300 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
301 
302 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
303 
316 typedef uint8_t SDL_POK_detection;
318 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
319 
320 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
321 
322 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
323 
324 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
325 
326 
339 typedef uint8_t SDL_POK_enSelSrc;
341 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
342 
343 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
344 
345 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
346 
347 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
348 
361 typedef uint8_t SDL_por_trim_sel;
362 
364 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
365 
368 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
369 
371 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
372 
374 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
375 
376 
389 typedef uint8_t SDL_por_module_status ;
390 
392 #define SDL_POR_MODULE_STATUS_FUNCTIONAL_MODE ((SDL_por_module_status) 0U)
393 
394 #define SDL_POR_MODULE_STATUS_RESET_MODE ((SDL_por_module_status) 1U)
395 
407 typedef enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t;
408 
424 typedef struct SDL_pokCfg
425 {
443 
451 typedef struct SDL_pokVal
452 {
469 } SDL_pokVal_t;
470 
471 
480 typedef struct SDL_pokPorCfg
481 {
487 
496 typedef struct SDL_pokPorVal
497 {
503 
507  SDL_PRG_Inst instance,
508  SDL_pokPRGInfo_t *pPRGInfo);
509 
510 
511 /* Function to get the error signal wrt given POKID for v1 of IP */
512 void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag);
513 
514 
515 #ifdef __cplusplus
516 }
517 #endif /* extern "C" */
518 
519 #endif /* end of SDL_POK_DEF_H definition */
SDL_pokShiftsAndMasks_t::detEnShift
uint32_t detEnShift
Definition: sdl_pok_def.h:99
SDL_POK_detection
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:316
SDL_pokVal_t::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:460
SDL_pokPRGInfo_t::pokEnPPMask
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:115
SDL_pokShiftsAndMasks_t::pokAddr
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:82
SDL_POK_config::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:441
SDL_POK_config::trim
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:433
SDL_POK_Inst
int8_t SDL_POK_Inst
Definition: sdl_pok_def.h:135
SDL_pokPorVal_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:501
SDL_pokPorCfg_t
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:481
SDL_pokVal_t::deglitch
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:468
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:88
SDL_pokVal_t::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:456
SDL_pokShiftsAndMasks_t::ovSelShift
uint32_t ovSelShift
Definition: sdl_pok_def.h:101
SDL_POK_config::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:427
SDL_pokPorCfg_t::trim_select
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:485
SDL_pokShiftsAndMasks_t::hystOVMask
uint32_t hystOVMask
Definition: sdl_pok_def.h:92
SDL_pokPorVal_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:499
SDL_pokShiftsAndMasks_t::hystMask
uint32_t hystMask
Definition: sdl_pok_def.h:90
SDL_POK_config::hystCtrlOV
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:429
SDL_POK_config
POK Configuration structure.
Definition: sdl_pok_def.h:425
SDL_pokShiftsAndMasks_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:89
SDL_pokShiftsAndMasks_t::pokEnSelMask
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:102
SDL_pokShiftsAndMasks_t::vdDetOVShift
uint32_t vdDetOVShift
Definition: sdl_pok_def.h:97
SDL_POK_config::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:439
SDL_PRG_Inst
int8_t SDL_PRG_Inst
Definition: sdl_pok_def.h:134
SDL_pokShiftsAndMasks_t::trimShift
uint32_t trimShift
Definition: sdl_pok_def.h:105
SDL_pwrss_trim
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:242
SDL_pokShiftsAndMasks_t::pokEnPPAddr
volatile uint32_t * pokEnPPAddr
Definition: sdl_pok_def.h:86
SDL_pokShiftsAndMasks_t
Definition: sdl_pok_def.h:81
SDL_pokShiftsAndMasks_t::hystShift
uint32_t hystShift
Definition: sdl_pok_def.h:91
SDL_pokPRGInfo_t
Definition: sdl_pok_def.h:113
SDL_pokShiftsAndMasks_t::pokDetAddr
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:84
SDL_pokPRGInfo_t::pokEnPPShift
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:116
SDL_pokShiftsAndMasks_t::hystOVShift
uint32_t hystOVShift
Definition: sdl_pok_def.h:93
SDL_pokPorCfg_t::maskHHVOutputEnable
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:483
SDL_pokShiftsAndMasks_t::deglitchSelShift
uint32_t deglitchSelShift
Definition: sdl_pok_def.h:109
SDL_pok_type
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:136
SDL_pokShiftsAndMasks_t::detEnMask
uint32_t detEnMask
Definition: sdl_pok_def.h:98
SDL_pokVal_t::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:458
SDL_POK_config::detectionCtrl
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:437
SDL_pokShiftsAndMasks_t::vdDetMask
uint32_t vdDetMask
Definition: sdl_pok_def.h:94
SDL_pokShiftsAndMasks_t::deglitchSelAddr
volatile uint32_t * deglitchSelAddr
Definition: sdl_pok_def.h:87
SDL_mcuCtrlRegsBase_t
enum SDL_mcu_ctrl_mmr_cfg0Regs SDL_mcuCtrlRegsBase_t
Definition: sdl_pok_def.h:407
SDL_POK_config::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:435
SDL_pokPRGInfo_t::addr
volatile uint32_t * addr
Definition: sdl_pok_def.h:114
SDL_pokShiftsAndMasks_t::trimOVShift
uint32_t trimOVShift
Definition: sdl_pok_def.h:107
SDL_pokShiftsAndMasks_t::pokEnSelShift
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:103
SDL_pokShiftsAndMasks_t::pokEnSelAddr
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:85
SDL_pokVal_t::pokEnSelSrcCtrl
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:466
SDL_pokShiftsAndMasks_t::vdDetOVMask
uint32_t vdDetOVMask
Definition: sdl_pok_def.h:96
SDL_pokShiftsAndMasks_t::ovSelMask
uint32_t ovSelMask
Definition: sdl_pok_def.h:100
SDL_pokShiftsAndMasks_t::trimOVMask
uint32_t trimOVMask
Definition: sdl_pok_def.h:106
SDL_pokShiftsAndMasks_t::pokOVAddr
volatile uint32_t * pokOVAddr
Definition: sdl_pok_def.h:83
SDL_pokShiftsAndMasks_t::vdDetShift
uint32_t vdDetShift
Definition: sdl_pok_def.h:95
SDL_pokPorVal_t
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:497
SDL_POK_config::voltDetMode
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:431
SDL_pokVal_t::trimOV
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:462
SDL_pokShiftsAndMasks_t::trimMask
uint32_t trimMask
Definition: sdl_pok_def.h:104
SDL_por_trim_sel
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:361
sdl_soc_pok.h
This file contains the prototypes of the APIs present in the device abstraction layer file of POK....
SDL_por_module_status
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:389
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:273
SDL_pokVal_t
POK Configuration structure read value.
Definition: sdl_pok_def.h:452
SDL_pokVal_t::hystCtrl
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:454
SDL_pwrss_hysteresis
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:207
SDL_pwrss_deglitch
uint8_t SDL_pwrss_deglitch
Definition: sdl_pok_def.h:156
SDL_POK_enSelSrc
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:339
SDL_POK_detection_status
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:298
SDL_pokShiftsAndMasks_t::deglitchSelMask
uint32_t deglitchSelMask
Definition: sdl_pok_def.h:108
SDL_pokVal_t::detectionStatus
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:464
SDL_pwrss_pp
uint8_t SDL_pwrss_pp
Definition: sdl_pok_def.h:184