SDL API Guide for J721E
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 
57 #if defined (SOC_J721E)
58 #include <src/ip/pok/soc/j721e/sdl_ip_pok.h>
59 #endif
60 
61 #if defined (SOC_J7200)
62 #include <src/ip/pok/soc/j7200/sdl_ip_pok.h>
63 #endif
64 
82 typedef struct SDL_pokShiftsAndMasks
83 {
84  volatile uint32_t *pokAddr;
85  volatile uint32_t *pokOVAddr;
86  volatile uint32_t *pokDetAddr;
87  volatile uint32_t *pokEnSelAddr;
88  volatile uint32_t *pokEnPPAddr;
89  uint32_t pokEnPPMask;
90  uint32_t pokEnPPShift;
91  uint32_t hystMask;
92  uint32_t hystShift;
93  uint32_t hystOVMask;
94  uint32_t hystOVShift;
95  uint32_t vdDetMask;
96  uint32_t vdDetShift;
97  uint32_t vdDetOVMask;
98  uint32_t vdDetOVShift;
99  uint32_t detEnMask;
100  uint32_t detEnShift;
101  uint32_t ovSelMask;
102  uint32_t ovSelShift;
103  uint32_t pokEnSelMask;
104  uint32_t pokEnSelShift;
105  uint32_t trimMask;
106  uint32_t trimShift;
107  uint32_t trimOVMask;
108  uint32_t trimOVShift;
110 
121 typedef uint8_t SDL_pok_type;
122 
124 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
125 
126 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
127 
128 /* @} */
129 
141 typedef uint8_t SDL_pwrss_hysteresis;
142 
144 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
145 
146 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
147 
148 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
149 
150 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
151 
152 /* @} */
153 
176 typedef uint8_t SDL_pwrss_trim;
183 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
184 
186 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
187 
189 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
190 
192 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
193 
194 
195 /* @} */
196 
207 typedef uint8_t SDL_pwrss_vd_mode;
208 
210 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
211 
212 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
213 
214 #define SDL_PWRSS_SET_PP_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 2U)
215 
216 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 2U)
217 
218 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 3U)
219 
220 /* @} */
221 
232 typedef uint8_t SDL_POK_detection_status;
234 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
235 
236 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
237 
238 /* @} */
239 
250 typedef uint8_t SDL_POK_detection;
252 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
253 
254 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
255 
256 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
257 
258 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
259 
260 
261 /* @} */
262 
273 typedef uint8_t SDL_POK_enSelSrc;
275 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
276 
277 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
278 
279 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
280 
281 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
282 
283 
284 /* @} */
285 
296 typedef uint8_t SDL_POK_thrStatus;
297 /* POK Volage above threshold detected */
298 #define SDL_VOLTAGE_ABOVE_THRESHOLD ((SDL_POK_thrStatus) 0U)
299 /* POK Volage below threshold detected */
300 #define SDL_VOLTAGE_BELOW_THRESHOLD ((SDL_POK_thrStatus) 1U)
301 /* POK Voltage normal/good */
302 #define SDL_VOLTAGE_GOOD ((SDL_POK_thrStatus) 2U)
303 
304 /* @} */
305 
316 typedef uint8_t SDL_por_trim_sel;
317 
319 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
320 
323 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
324 
326 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
327 
329 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
330 
331 
332 /* @} */
333 
344 typedef uint8_t SDL_por_override;
345 
347 #define SDL_POR_OVERRIDE_NOT_SET_DISABLE ((SDL_por_override) 0U)
348 
350 #define SDL_POR_OVERRIDE_NOT_SET_ENABLE ((SDL_por_override) 1U)
351 
353 #define SDL_POR_OVERRIDE_SET_DISABLE ((SDL_por_override) 2U)
354 
356 #define SDL_POR_OVERRIDE_SET_ENABLE ((SDL_por_override) 3U)
357 
359 #define SDL_POR_GET_OVERRIDE_VALUE ((SDL_por_override) 4U)
360 
362 #define SDL_POR_SET_OVERRIDE_NO_CHANGE ((SDL_por_override) 5U)
363 
365 #define SDL_OVERRIDE_SET_UNKNOWN ((SDL_por_override) 0xFFU)
366 
367 
368 /* @} */
369 
381 #define SDL_PORHV_OVERRIDE_INDEX (0U)
382 
384 #define SDL_BGAP_OVERRIDE_INDEX (1U)
385 
387 #define SDL_POKHV_OVERRIDE_INDEX (2U)
388 
390 #define SDL_POKLVA_OVERRIDE_INDEX (3U)
391 
393 #define SDL_POKLVB_OVERRIDE_INDEX (4U)
394 
396 #define SDL_MAX_OVERRIDE_INDEX (5U)
397 
398 /* @} */
399 
400 
411 typedef uint8_t SDL_por_module_status ;
412 
414 #define SDL_POR_MODULE_STATUS_FUNCTIONAL_MODE ((SDL_por_module_status) 0U)
415 
416 #define SDL_POR_MODULE_STATUS_RESET_MODE ((SDL_por_module_status) 1U)
417 /* @} */
418 
419 
429 typedef SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t;
430 
431 /* @} */
441 /* @} */
442 
443 /* @} */
444 
457 typedef struct SDL_pokCfg
458 {
469 
471 
479 typedef struct SDL_pokVal
480 {
493 } SDL_pokVal_t;
494 
495 
504 typedef struct SDL_pokPorCfg
505 {
513 
522 typedef struct SDL_pokPorVal
523 {
531 
532 
541 typedef struct SDL_pokPorStat
542 {
546  bool porBGapOK;
548 
549 /* @} */
550 
551 /*function is used to set error signal wrt given POKID*/
552 void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig, bool *usePorCfgFlag);
553 
556 #ifdef __cplusplus
557 }
558 #endif /* extern "C" */
559 
560 #endif /* end of SDL_POK_DEF_H definition */
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:490
uint8_t SDL_POK_thrStatus
Definition: sdl_pok_def.h:296
uint32_t ovSelShift
Definition: sdl_pok_def.h:102
uint8_t SDL_por_override
Definition: sdl_pok_def.h:344
void sdlGetErrSig(uint32_t id, SDL_POK_Inst *instance, uint32_t *esm_err_sig, bool *usePorCfgFlag)
POK Configuration structure.
Definition: sdl_pok_def.h:457
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:103
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:176
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:504
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:488
uint32_t pokEnPPMask
Definition: sdl_pok_def.h:89
bool porBGapOK
Definition: sdl_pok_def.h:546
SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t
Definition: sdl_pok_def.h:429
uint32_t trimShift
Definition: sdl_pok_def.h:106
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:468
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:486
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:121
uint8_t SDL_pwrss_vd_mode
Definition: sdl_pok_def.h:207
uint32_t hystMask
Definition: sdl_pok_def.h:91
uint32_t pokEnPPShift
Definition: sdl_pok_def.h:90
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:84
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:411
uint32_t vdDetOVShift
Definition: sdl_pok_def.h:98
#define SDL_MAX_OVERRIDE_INDEX
Definition: sdl_pok_def.h:396
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:86
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:511
uint32_t hystOVMask
Definition: sdl_pok_def.h:93
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:316
SDL_POK_thrStatus voltageThrStatus
Definition: sdl_pok_def.h:492
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:466
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:250
uint32_t hystShift
Definition: sdl_pok_def.h:92
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:232
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:462
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:529
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:141
volatile uint32_t * pokEnPPAddr
Definition: sdl_pok_def.h:88
uint32_t hystOVShift
Definition: sdl_pok_def.h:94
SDL_POK_thrStatus porModuleStatus
Definition: sdl_pok_def.h:544
uint32_t ovSelMask
Definition: sdl_pok_def.h:101
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:541
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:273
uint32_t vdDetMask
Definition: sdl_pok_def.h:95
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:522
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:509
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:484
uint32_t trimOVShift
Definition: sdl_pok_def.h:108
This file contains SOC specific defintions.
volatile uint32_t * pokOVAddr
Definition: sdl_pok_def.h:85
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:87
uint32_t vdDetShift
Definition: sdl_pok_def.h:96
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:527
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:104
uint32_t detEnMask
Definition: sdl_pok_def.h:99
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:464
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:482
uint32_t trimMask
Definition: sdl_pok_def.h:105
POK Configuration structure read value.
Definition: sdl_pok_def.h:479
uint32_t vdDetOVMask
Definition: sdl_pok_def.h:97
Definition: sdl_pok_def.h:82
uint32_t trimOVMask
Definition: sdl_pok_def.h:107
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:460
uint32_t detEnShift
Definition: sdl_pok_def.h:100