SDL API Guide for J721E
sdl_pok.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2021
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  */
33 
42 #ifndef SDL_POK_H_
43 #define SDL_POK_H_
44 
45 #include <src/ip/sdl_ip_pok.h>
46 #include <src/ip/sdl_ip_esm.h>
47 #include <osal/sdl_osal.h>
48 
49 #if defined (SOC_J721E)
50 #include <include/soc/j721e/sdlr_soc_baseaddress.h>
51 #include <include/soc/j721e/sdlr_wkup_ctrl_mmr.h>
52 #endif /* SOC_J721E */
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
75 /**************************************************************************
76 * Register Macros
77 **************************************************************************/
78 #define SDL_WKUP_ESM0_CFG_BASE (0x42080000U)
79 #define SDL_POK_MMR_BASE (SDL_WKUP_CTRL_MMR0_CFG0_BASE)
80 
81 
82 #define WKUP_ESM_INSTANCE (SDL_WKUP_ESM0_CFG_BASE)
83 #define WKUP_ESM_INTID (SDLR_MCU_R5FSS0_CORE0_INTR_WKUP_ESM0_ESM_INT_HI_LVL_0)
84 #define WKUP_ESM_ERR_SIG_POKHV_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU_3POKS0_POK_PGOOD_OUT_N_TO_ESM_2)
85 #define WKUP_ESM_ERR_SIG_POKHV_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU_3POKS0_POK_PGOOD_OUT_N_TO_ESM_1)
86 #define WKUP_ESM_ERR_SIG_PORHV_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU_3POKS0_POK_PGOOD_OUT_N_TO_ESM_2)
87 #define WKUP_ESM_ERR_SIG_POKLV_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU_3POKS0_POK_PGOOD_OUT_N_TO_ESM_0)
88 #define WKUP_ESM_ERR_SIG_VDDA_IN (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_0)
89 #define WKUP_ESM_ERR_SIG_VDDSHV_WKUP_GEN_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_5)
90 #define WKUP_ESM_ERR_SIG_VDDR_MCU_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_4)
91 #define WKUP_ESM_ERR_SIG_VDD_MCU_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_1)
92 #define WKUP_ESM_ERR_SIG_VDDSHV_WKUP_GEN_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_2)
93 #define WKUP_ESM_ERR_SIG_VDDR_MCU_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG_MCU0_POK_PGOOD_OUT_N_TO_ESM_3)
94 #define WKUP_ESM_ERR_SIG_VDD_CORE_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_7)
95 #define WKUP_ESM_ERR_SIG_VDD_CPU_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_6)
96 #define WKUP_ESM_ERR_SIG_VMON_EXT_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_5)
97 #define WKUP_ESM_ERR_SIG_VDDR_CORE_UV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_4)
98 #define WKUP_ESM_ERR_SIG_VDD_CORE_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_3)
99 #define WKUP_ESM_ERR_SIG_VDD_CPU_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_2)
100 #define WKUP_ESM_ERR_SIG_VMON_EXT_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_1)
101 #define WKUP_ESM_ERR_SIG_VDDR_CORE_OV (SDLR_WKUP_ESM0_ESM_PLS_EVENT0_WKUP_PRG0_POK_PGOOD_OUT_N_TO_ESM_0)
102 
103 
104 #define ESM_INSTANCE WKUP_ESM_INSTANCE
105 #define ESM_INTID WKUP_ESM_INTID
106 #define ESM_ERR_SIG_POKHV_UV WKUP_ESM_ERR_SIG_POKHV_UV
107 #define ESM_ERR_SIG_POKHV_OV WKUP_ESM_ERR_SIG_POKHV_OV
108 #define ESM_ERR_SIG_POKLV_UV WKUP_ESM_ERR_SIG_POKLV_UV
109 #define ESM_ERR_SIG_PORHV_UV WKUP_ESM_ERR_SIG_PORHV_UV
110 #define ESM_ERR_SIG_VDDA_IN WKUP_ESM_ERR_SIG_VDDA_IN
111 #define ESM_ERR_SIG_VDD_CORE_UV WKUP_ESM_ERR_SIG_VDD_CORE_UV
112 #define ESM_ERR_SIG_VDDSHV_WKUP_GEN_UV WKUP_ESM_ERR_SIG_VDDSHV_WKUP_GEN_UV
113 #define ESM_ERR_SIG_VDD_CPU_UV WKUP_ESM_ERR_SIG_VDD_CPU_UV
114 #define ESM_ERR_SIG_VDDR_MCU_UV WKUP_ESM_ERR_SIG_VDDR_MCU_UV
115 #define ESM_ERR_SIG_VMON_EXT_UV WKUP_ESM_ERR_SIG_VMON_EXT_UV
116 #define ESM_ERR_SIG_VDD_MCU_OV WKUP_ESM_ERR_SIG_VDD_MCU_OV
117 #define ESM_ERR_SIG_VDDR_CORE_UV WKUP_ESM_ERR_SIG_VDDR_CORE_UV
118 #define ESM_ERR_SIG_VDDSHV_WKUP_GEN_OV WKUP_ESM_ERR_SIG_VDDSHV_WKUP_GEN_OV
119 #define ESM_ERR_SIG_VDD_CORE_OV WKUP_ESM_ERR_SIG_VDD_CORE_OV
120 #define ESM_ERR_SIG_VDDR_MCU_OV WKUP_ESM_ERR_SIG_VDDR_MCU_OV
121 #define ESM_ERR_SIG_VDD_CPU_OV WKUP_ESM_ERR_SIG_VDD_CPU_OV
122 #define ESM_ERR_SIG_VDDR_CORE_OV WKUP_ESM_ERR_SIG_VDDR_CORE_OV
123 #define ESM_ERR_SIG_VMON_EXT_OV WKUP_ESM_ERR_SIG_VMON_EXT_OV
124 
125 
126 
127 
128 /* ========================================================================== */
129 /* Structures and Enums */
130 /* ========================================================================== */
131 
144 typedef struct SDL_Pok_Static_Reg_read{
145  uint8_t hystCtrl;
147  uint8_t voltDetMode;
149  uint8_t trim;
151  bool porBGapOK;
156 
159 /* ========================================================================== */
160 /* Function Declarations */
161 /* ========================================================================== */
162 
181 int32_t SDL_POK_getStaticRegisters(SDL_POK_Inst Instance,SDL_POK_staticRegs *pStaticRegs);
182 
192 int32_t SDL_POK_init(SDL_POK_Inst instance, SDL_POK_config *pConfig);
193 
206 int32_t SDL_POK_verifyConfig(SDL_POK_Inst instance, SDL_POK_config *pConfig);
207 
217 int32_t SDL_POK_getStatus(SDL_POK_Inst instance, SDL_POK_thrStatus *pStatus);
218 
221 #ifdef __cplusplus
222 }
223 #endif
224 #endif /* SDL_POK_H_ */
225 
uint8_t SDL_POK_thrStatus
Definition: sdl_pok_def.h:274
POK Configuration structure.
Definition: sdl_pok_def.h:478
uint8_t hystCtrl
Definition: sdl_pok.h:145
bool porBGapOK
Definition: sdl_pok.h:151
uint8_t trim
Definition: sdl_pok.h:149
int32_t SDL_POK_getStaticRegisters(SDL_POK_Inst Instance, SDL_POK_staticRegs *pStaticRegs)
POK Function to get the Static Registers. This function reads the values of the static registers such...
This file contains the SDL OSAL API's.
POK Static Registers structure.
Definition: sdl_pok.h:144
uint8_t porModuleStatus
Definition: sdl_pok.h:153
int8_t SDL_POK_Inst
Definition: sdl_pok_def.h:420
int32_t SDL_POK_init(SDL_POK_Inst instance, SDL_POK_config *pConfig)
POK module configuration API.
int32_t SDL_POK_getStatus(SDL_POK_Inst instance, SDL_POK_thrStatus *pStatus)
POK Function to get the threshold status of the POK instance.
int32_t SDL_POK_verifyConfig(SDL_POK_Inst instance, SDL_POK_config *pConfig)
POK Function to verify the written configuration. This function checks the provided config against th...
uint8_t voltDetMode
Definition: sdl_pok.h:147