SDL API Guide for J721S2
sdl_pok_def.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_types.h>
55 #include <include/soc.h>
56 #if defined (SOC_J7200)
57 #include <src/ip/pok/soc/j7200/sdl_ip_pok.h>
58 #endif
59 #if defined (SOC_J721S2)
60 #include <src/ip/pok/soc/j721s2/sdl_ip_pok.h>
61 #endif
62 #if defined (SOC_J784S4)
63 #include <src/ip/pok/soc/j784s4/sdl_ip_pok.h>
64 #endif
65 
78 typedef struct SDL_pokShiftsAndMasks
79 {
80  volatile uint32_t *pokAddr;
81  volatile uint32_t *pokOVAddr;
82  volatile uint32_t *pokDetAddr;
83  volatile uint32_t *pokEnSelAddr;
84  volatile uint32_t *pokEnPPAddr;
85  volatile uint32_t *deglitchSelAddr;
86  uint32_t pokEnPPMask;
87  uint32_t pokEnPPShift;
88  uint32_t hystMask;
89  uint32_t hystShift;
90  uint32_t hystOVMask;
91  uint32_t hystOVShift;
92  uint32_t vdDetMask;
93  uint32_t vdDetShift;
94  uint32_t vdDetOVMask;
95  uint32_t vdDetOVShift;
96  uint32_t detEnMask;
97  uint32_t detEnShift;
98  uint32_t ovSelMask;
99  uint32_t ovSelShift;
100  uint32_t pokEnSelMask;
101  uint32_t pokEnSelShift;
102  uint32_t trimMask;
103  uint32_t trimShift;
104  uint32_t trimOVMask;
105  uint32_t trimOVShift;
106  uint32_t deglitchSelMask;
109 
110 typedef struct SDL_pokPRGInfo
111 {
112  volatile uint32_t *addr;
113  uint32_t pokEnPPMask;
114  uint32_t pokEnPPShift;
116 
132 typedef uint8_t SDL_pok_type;
133 
135 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
136 
137 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
138 
139 /* @} */
140 
152 typedef uint8_t SDL_pwrss_deglitch;
153 
155 #define SDL_PWRSS_DEGLITCH_5US ((SDL_pwrss_deglitch) 0U)
156 
157 #define SDL_PWRSS_DEGLITCH_10US ((SDL_pwrss_deglitch) 1U)
158 
159 #define SDL_PWRSS_DEGLITCH_15US ((SDL_pwrss_deglitch) 2U)
160 
161 #define SDL_PWRSS_DEGLITCH_20US ((SDL_pwrss_deglitch) 3U)
162 
163 #define SDL_PWRSS_DEGLITCH_GET_VALUE ((SDL_pwrss_deglitch) 4U)
164 
165 #define SDL_PWRSS_DEGLITCH_NO_ACTION ((SDL_pwrss_deglitch) 5U)
166 
167 /* @} */
168 
180 typedef uint8_t SDL_pwrss_pp;
181 
183 #define SDL_PWRSS_PP_MODE_DISABLE ((SDL_pwrss_pp) 0U)
184 
185 #define SDL_PWRSS_PP_MODE_ENABLE ((SDL_pwrss_pp) 1U)
186 
187 #define SDL_PWRSS_PP_MODE_NO_ACTION ((SDL_pwrss_pp) 2U)
188 
189 /* @} */
190 
191 
203 typedef uint8_t SDL_pwrss_hysteresis;
204 
206 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
207 
208 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
209 
210 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
211 
212 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
213 
214 /* @} */
215 
238 typedef uint8_t SDL_pwrss_trim;
245 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
246 
248 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
249 
251 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
252 
254 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
255 
256 
257 /* @} */
258 
269 typedef uint8_t SDL_pwrss_vd_mode;
270 
272 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
273 
274 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
275 
276 #define SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 2U)
277 
278 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 3U)
279 
280 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 4U)
281 
282 /* @} */
283 
294 typedef uint8_t SDL_POK_detection_status;
296 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
297 
298 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
299 
300 /* @} */
301 
312 typedef uint8_t SDL_POK_detection;
314 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
315 
316 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
317 
318 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
319 
320 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
321 
322 
323 /* @} */
324 
335 typedef uint8_t SDL_POK_enSelSrc;
337 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
338 
339 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
340 
341 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
342 
343 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
344 
345 /* @} */
346 
357 typedef uint8_t SDL_por_trim_sel;
358 
360 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
361 
364 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
365 
367 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
368 
370 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
371 
372 
373 /* @} */
374 
385 typedef uint8_t SDL_por_module_status ;
386 
388 #define SDL_POR_MODULE_STATUS_FUNCTIONAL_MODE ((SDL_por_module_status) 0U)
389 
390 #define SDL_POR_MODULE_STATUS_RESET_MODE ((SDL_por_module_status) 1U)
391 /* @} */
392 
393 
403 typedef SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t;
404 
405 /* @} */
406 
407 /* @} */
420 typedef struct SDL_pokCfg
421 {
439 
447 typedef struct SDL_pokVal
448 {
465 } SDL_pokVal_t;
466 
467 
476 typedef struct SDL_pokPorCfg
477 {
483 
492 typedef struct SDL_pokPorVal
493 {
499 
500 /* @} */
501 
502 int32_t SDL_pok_getPRGInfo(SDL_wkupCtrlRegsBase_t *pBaseAddress,
503  SDL_PRG_Inst instance,
504  SDL_pokPRGInfo_t *pPRGInfo);
505 
506 
507 /* Function to get the error signal wrt given POKID for v1 of IP */
508 void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag);
509 
512 #ifdef __cplusplus
513 }
514 #endif /* extern "C" */
515 
516 #endif /* end of SDL_POK_DEF_H definition */
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:462
uint32_t ovSelShift
Definition: sdl_pok_def.h:99
POK Configuration structure.
Definition: sdl_pok_def.h:420
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:100
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:238
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:476
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:460
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:86
SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t
Definition: sdl_pok_def.h:403
uint32_t trimShift
Definition: sdl_pok_def.h:103
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:435
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:456
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:132
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:437
uint8_t SDL_pwrss_vd_mode
Definition: sdl_pok_def.h:269
uint32_t hystMask
Definition: sdl_pok_def.h:88
SDL_pwrss_deglitch deglitch
Definition: sdl_pok_def.h:464
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:87
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:80
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:385
uint32_t vdDetOVShift
Definition: sdl_pok_def.h:95
Definition: sdl_pok_def.h:110
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:82
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:481
uint8_t SDL_pwrss_deglitch
Definition: sdl_pok_def.h:152
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:431
uint32_t hystOVMask
Definition: sdl_pok_def.h:90
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:357
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:433
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:312
uint32_t hystShift
Definition: sdl_pok_def.h:89
uint8_t SDL_pwrss_pp
Definition: sdl_pok_def.h:180
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:114
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:294
SDL_pwrss_trim trimOV
Definition: sdl_pok_def.h:458
int32_t SDL_pok_getPRGInfo(SDL_wkupCtrlRegsBase_t *pBaseAddress, SDL_PRG_Inst instance, SDL_pokPRGInfo_t *pPRGInfo)
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:427
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:497
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:203
volatile uint32_t * pokEnPPAddr
Definition: sdl_pok_def.h:84
uint32_t hystOVShift
Definition: sdl_pok_def.h:91
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:113
volatile uint32_t * deglitchSelAddr
Definition: sdl_pok_def.h:85
uint32_t ovSelMask
Definition: sdl_pok_def.h:98
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:335
uint32_t vdDetMask
Definition: sdl_pok_def.h:92
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:492
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:479
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:454
uint32_t deglitchSelShift
Definition: sdl_pok_def.h:107
uint32_t trimOVShift
Definition: sdl_pok_def.h:105
This file contains SOC specific defintions.
volatile uint32_t * pokOVAddr
Definition: sdl_pok_def.h:81
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:83
uint32_t vdDetShift
Definition: sdl_pok_def.h:93
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:495
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:101
uint32_t detEnMask
Definition: sdl_pok_def.h:96
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:429
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:450
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:452
uint32_t trimMask
Definition: sdl_pok_def.h:102
POK Configuration structure read value.
Definition: sdl_pok_def.h:447
volatile uint32_t * addr
Definition: sdl_pok_def.h:112
void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig_ov, uint32_t *esm_err_sig_uv, bool *usePorCfgFlag)
uint32_t vdDetOVMask
Definition: sdl_pok_def.h:94
Definition: sdl_pok_def.h:78
uint32_t trimOVMask
Definition: sdl_pok_def.h:104
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:423
uint32_t detEnShift
Definition: sdl_pok_def.h:97
SDL_pwrss_hysteresis hystCtrlOV
Definition: sdl_pok_def.h:425
uint32_t deglitchSelMask
Definition: sdl_pok_def.h:106