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 
74 typedef struct SDL_pokShiftsAndMasks
75 {
76  volatile uint32_t *pokAddr;
77  volatile uint32_t *pokDetAddr;
78  volatile uint32_t *pokEnSelAddr;
79  uint32_t hystMask;
80  uint32_t hystShift;
81  uint32_t vdDetMask;
82  uint32_t vdDetShift;
83  uint32_t detEnMask;
84  uint32_t detEnShift;
85  uint32_t pokEnSelMask;
86  uint32_t pokEnSelShift;
87  uint32_t trimMask;
88  uint32_t trimShift;
90 
101 typedef uint8_t SDL_pok_type;
102 
104 #define SDL_TYPE_POK ((SDL_pok_type) 1U)
105 
106 #define SDL_TYPE_POK_SA ((SDL_pok_type) 2U)
107 
108 /* @} */
109 
121 typedef uint8_t SDL_pwrss_hysteresis;
122 
124 #define SDL_PWRSS_SET_HYSTERESIS_DISABLE ((SDL_pwrss_hysteresis) 0U)
125 
126 #define SDL_PWRSS_SET_HYSTERESIS_ENABLE ((SDL_pwrss_hysteresis) 1U)
127 
128 #define SDL_PWRSS_GET_HYSTERESIS_VALUE ((SDL_pwrss_hysteresis) 2U)
129 
130 #define SDL_PWRSS_HYSTERESIS_NO_ACTION ((SDL_pwrss_hysteresis) 3U)
131 
132 /* @} */
133 
156 typedef uint8_t SDL_pwrss_trim;
163 #define SDL_PWRSS_MAX_TRIM_VALUE ((SDL_pwrss_trim) 127U)
164 
166 #define SDL_PWRSS_TRIM_NO_ACTION ((SDL_pwrss_trim) 128U)
167 
169 #define SDL_PWRSS_GET_TRIM_VALUE ((SDL_pwrss_trim) 129U)
170 
172 #define SDL_PWRSS_INVALID_TRIM_VALUE ((SDL_pwrss_trim) 255U)
173 
174 
175 /* @} */
176 
187 typedef uint8_t SDL_pwrss_vd_mode;
188 
190 #define SDL_PWRSS_SET_UNDER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 0U)
191 
192 #define SDL_PWRSS_SET_OVER_VOLTAGE_DET_ENABLE ((SDL_pwrss_vd_mode) 1U)
193 
194 #define SDL_PWRSS_GET_VOLTAGE_DET_MODE ((SDL_pwrss_vd_mode) 2U)
195 
196 #define SDL_PWRSS_VOLTAGE_DET_NO_ACTION ((SDL_pwrss_vd_mode) 3U)
197 
198 /* @} */
199 
210 typedef uint8_t SDL_POK_detection_status;
212 #define SDL_POK_DETECTION_DISABLED ((SDL_POK_detection_status) 0U)
213 
214 #define SDL_POK_DETECTION_ENABLED ((SDL_POK_detection_status) 1U)
215 
216 /* @} */
217 
228 typedef uint8_t SDL_POK_detection;
230 #define SDL_POK_DETECTION_DISABLE ((SDL_POK_detection) 0U)
231 
232 #define SDL_POK_DETECTION_ENABLE ((SDL_POK_detection) 1U)
233 
234 #define SDL_POK_DETECTION_NO_ACTION ((SDL_POK_detection) 2U)
235 
236 #define SDL_POK_GET_DETECTION_VALUE ((SDL_POK_detection) 3U)
237 
238 
239 /* @} */
240 
251 typedef uint8_t SDL_POK_enSelSrc;
253 #define SDL_POK_ENSEL_HWTIEOFFS ((SDL_POK_enSelSrc) 0U)
254 
255 #define SDL_POK_ENSEL_PRG_CTRL ((SDL_POK_enSelSrc) 1U)
256 
257 #define SDL_POK_ENSEL_NO_ACTION ((SDL_POK_enSelSrc) 2U)
258 
259 #define SDL_POK_GET_ENSEL_VALUE ((SDL_POK_enSelSrc) 3U)
260 
261 
262 /* @} */
263 
274 typedef uint8_t SDL_POK_thrStatus;
275 /* POK Volage above threshold detected */
276 #define SDL_VOLTAGE_ABOVE_THRESHOLD ((SDL_POK_thrStatus) 0U)
277 /* POK Volage below threshold detected */
278 #define SDL_VOLTAGE_BELOW_THRESHOLD ((SDL_POK_thrStatus) 1U)
279 /* POK Voltage normal/good */
280 #define SDL_VOLTAGE_GOOD ((SDL_POK_thrStatus) 2U)
281 
282 /* @} */
283 
294 typedef uint8_t SDL_por_trim_sel;
295 
297 #define SDL_POR_TRIM_SELECTION_FROM_HHV_DEFAULT ((uint8_t) 0U)
298 
301 #define SDL_POR_TRIM_SELECTION_FROM_CTRL_REGS ((uint8_t) 1U)
302 
304 #define SDL_POR_TRIM_SELECTION_NO_CHANGE ((uint8_t) 2U)
305 
307 #define SDL_POR_TRIM_SELECTION_GET_VALUE ((uint8_t) 3U)
308 
309 
310 /* @} */
311 
322 typedef uint8_t SDL_por_override;
323 
325 #define SDL_POR_OVERRIDE_NOT_SET_DISABLE ((SDL_por_override) 0U)
326 
328 #define SDL_POR_OVERRIDE_NOT_SET_ENABLE ((SDL_por_override) 1U)
329 
331 #define SDL_POR_OVERRIDE_SET_DISABLE ((SDL_por_override) 2U)
332 
334 #define SDL_POR_OVERRIDE_SET_ENABLE ((SDL_por_override) 3U)
335 
337 #define SDL_POR_GET_OVERRIDE_VALUE ((SDL_por_override) 4U)
338 
340 #define SDL_POR_SET_OVERRIDE_NO_CHANGE ((SDL_por_override) 5U)
341 
343 #define SDL_OVERRIDE_SET_UNKNOWN ((SDL_por_override) 0xFFU)
344 
345 
346 /* @} */
347 
359 #define SDL_PORHV_OVERRIDE_INDEX (0U)
360 
362 #define SDL_BGAP_OVERRIDE_INDEX (1U)
363 
365 #define SDL_POKHV_OVERRIDE_INDEX (2U)
366 
368 #define SDL_POKLVA_OVERRIDE_INDEX (3U)
369 
371 #define SDL_POKLVB_OVERRIDE_INDEX (4U)
372 
374 #define SDL_MAX_OVERRIDE_INDEX (5U)
375 
376 /* @} */
377 
378 
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 /* @} */
396 
397 
407 typedef SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t;
408 
409 /* @} */
410 
420 typedef int8_t SDL_POK_Inst ;
421 
423 #define SDL_FIRST_POK_ID (0)
424 /* PMIC POK ID */
425 #define SDL_POK_VDDA_PMIC_IN_ID (SDL_FIRST_POK_ID)
426 /* CORE Under Voltage POK ID */
427 #define SDL_POK_VDD_CORE_UV_ID (1)
428 /* Wakeup General POK Under Voltage ID */
429 #define SDL_POK_VDDSHV_WKUP_GEN_UV_ID (2)
430 /* CPU under voltage POK ID */
431 #define SDL_POK_VDD_CPU_UV_ID (3)
432 /* MCU under voltage VDD POK ID */
433 #define SDL_POK_VDDR_MCU_UV_ID (4)
434 /* VMON under voltage POK ID */
435 #define SDL_POK_VMON_EXT_UV_ID (5)
436 /* MCU overvoltage POK ID */
437 #define SDL_POK_VDD_MCU_OV_ID (6)
438 /* VDD CORE POK ID */
439 #define SDL_POK_VDDR_CORE_UV_ID (7)
440 /* Wakeup General POK Over voltage ID */
441 #define SDL_POK_VDDSHV_WKUP_GEN_OV_ID (8)
442 /* CORE VDD Over Voltage POK ID */
443 #define SDL_POK_VDD_CORE_OV_ID (9)
444 /* MCU over Voltage POK ID */
445 #define SDL_POK_VDDR_MCU_OV_ID (10)
446 /* CPU over Voltage POK ID */
447 #define SDL_POK_VDD_CPU_OV_ID (11)
448 /* CORE VDDR over Voltage POK ID */
449 #define SDL_POK_VDDR_CORE_OV_ID (12)
450 /* VMON POK Over Voltage ID */
451 #define SDL_POK_VMON_EXT_OV_ID (13)
452 /* POKHV Under Voltage POK ID */
453 #define SDL_POR_POKHV_UV_ID (14)
454 /* POKLV Under Voltage POK ID */
455 #define SDL_POR_POKLV_UV_ID (15)
456 /* POKHV Over Voltage POK ID */
457 #define SDL_POR_POKHV_OV_ID (16)
458 /* LAST POK ID */
459 #define SDL_LAST_POK_ID (SDL_POR_POKHV_OV_ID)
460 
461 
462 /* @} */
463 
464 /* @} */
465 
478 typedef struct SDL_pokCfg
479 {
490 
492 
500 typedef struct SDL_pokVal
501 {
514 } SDL_pokVal_t;
515 
516 
525 typedef struct SDL_pokPorCfg
526 {
534 
543 typedef struct SDL_pokPorVal
544 {
552 
553 
562 typedef struct SDL_pokPorStat
563 {
567  bool porBGapOK;
569 
570 /* @} */
571 
574 #ifdef __cplusplus
575 }
576 #endif /* extern "C" */
577 
578 #endif /* end of SDL_POK_DEF_H definition */
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:511
uint8_t SDL_POK_thrStatus
Definition: sdl_pok_def.h:274
uint8_t SDL_por_override
Definition: sdl_pok_def.h:322
POK Configuration structure.
Definition: sdl_pok_def.h:478
uint32_t pokEnSelMask
Definition: sdl_pok_def.h:85
uint8_t SDL_pwrss_trim
Definition: sdl_pok_def.h:156
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:525
SDL_POK_detection_status detectionStatus
Definition: sdl_pok_def.h:509
bool porBGapOK
Definition: sdl_pok_def.h:567
SDL_wkup_ctrl_mmr_cfg0Regs SDL_wkupCtrlRegsBase_t
Definition: sdl_pok_def.h:407
uint32_t trimShift
Definition: sdl_pok_def.h:88
SDL_POK_enSelSrc pokEnSelSrcCtrl
Definition: sdl_pok_def.h:489
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:507
uint8_t SDL_pok_type
Definition: sdl_pok_def.h:101
uint8_t SDL_pwrss_vd_mode
Definition: sdl_pok_def.h:187
uint32_t hystMask
Definition: sdl_pok_def.h:79
volatile uint32_t * pokAddr
Definition: sdl_pok_def.h:76
uint8_t SDL_por_module_status
Definition: sdl_pok_def.h:389
#define SDL_MAX_OVERRIDE_INDEX
Definition: sdl_pok_def.h:374
volatile uint32_t * pokDetAddr
Definition: sdl_pok_def.h:77
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:532
uint8_t SDL_por_trim_sel
Definition: sdl_pok_def.h:294
SDL_POK_thrStatus voltageThrStatus
Definition: sdl_pok_def.h:513
SDL_POK_detection detectionCtrl
Definition: sdl_pok_def.h:487
uint8_t SDL_POK_detection
Definition: sdl_pok_def.h:228
uint32_t hystShift
Definition: sdl_pok_def.h:80
uint8_t SDL_POK_detection_status
Definition: sdl_pok_def.h:210
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:483
SDL_por_trim_sel trim_select
Definition: sdl_pok_def.h:550
uint8_t SDL_pwrss_hysteresis
Definition: sdl_pok_def.h:121
SDL_POK_thrStatus porModuleStatus
Definition: sdl_pok_def.h:565
POK functionality of POR Configuration structure.
Definition: sdl_pok_def.h:562
uint8_t SDL_POK_enSelSrc
Definition: sdl_pok_def.h:251
uint32_t vdDetMask
Definition: sdl_pok_def.h:81
POK functionality of POR Value structure.
Definition: sdl_pok_def.h:543
int8_t SDL_POK_Inst
Definition: sdl_pok_def.h:420
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:530
SDL_pwrss_vd_mode voltDetMode
Definition: sdl_pok_def.h:505
This file contains SOC specific defintions.
volatile uint32_t * pokEnSelAddr
Definition: sdl_pok_def.h:78
uint32_t vdDetShift
Definition: sdl_pok_def.h:82
bool maskHHVOutputEnable
Definition: sdl_pok_def.h:548
uint32_t pokEnSelShift
Definition: sdl_pok_def.h:86
uint32_t detEnMask
Definition: sdl_pok_def.h:83
SDL_pwrss_trim trim
Definition: sdl_pok_def.h:485
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:503
uint32_t trimMask
Definition: sdl_pok_def.h:87
POK Configuration structure read value.
Definition: sdl_pok_def.h:500
Definition: sdl_pok_def.h:74
SDL_pwrss_hysteresis hystCtrl
Definition: sdl_pok_def.h:481
uint32_t detEnShift
Definition: sdl_pok_def.h:84