PDK API Guide for J721E
pmic_power_lp8764x.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2020 Texas Instruments Incorporated - http://www.ti.com
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  *****************************************************************************/
46 #ifndef PMIC_POWER_LP8764X_H_
47 #define PMIC_POWER_LP8764X_H_
48 
49 /* ========================================================================== */
50 /* Include Files */
51 /* ========================================================================== */
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /* ========================================================================== */
57 /* Macros & Typedefs */
58 /* ========================================================================== */
59 
66 #define PMIC_LP8764X_POWER_RESOURCE_TYPE_VCCA (0U)
67 #define PMIC_LP8764X_POWER_RESOURCE_TYPE_BUCK (1U)
68 #define PMIC_LP8764X_POWER_RESOURCE_TYPE_LDO (2U)
69 #define PMIC_LP8764X_POWER_RESOURCE_TYPE_VMON (3U)
70 /* @} */
71 
78 #define PMIC_LP8764X_POWER_SOURCE_VCCA \
79  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_VCCA << 8U) | 0x0U))
80 #define PMIC_LP8764X_REGULATOR_BUCK1 \
81  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_BUCK << 8U) | 0x1U))
82 #define PMIC_LP8764X_REGULATOR_BUCK2 \
83  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_BUCK << 8U) | 0x2U))
84 #define PMIC_LP8764X_REGULATOR_BUCK3 \
85  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_BUCK << 8U) | 0x3U))
86 #define PMIC_LP8764X_REGULATOR_BUCK4 \
87  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_BUCK << 8U) | 0x4U))
88 #define PMIC_LP8764X_POWER_SOURCE_VMON1 \
89  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_VMON << 8U) | 0x5U))
90 #define PMIC_LP8764X_POWER_SOURCE_VMON2 \
91  ((((uint16_t)PMIC_LP8764X_POWER_RESOURCE_TYPE_VMON << 8U) | 0x6U))
92 /* @} */
93 
103 #define PMIC_LP8764X_REGULATOR_VMON_RV_SEL_ENABLE (0x1U)
104 
105 #define PMIC_LP8764X_REGULATOR_VMON_RV_SEL_DISABLE (0x0U)
106 /* @} */
107 
115 #define PMIC_LP8764X_REGULATOR_BUCK_PLDN_ENABLE (0x1U)
116 
117 #define PMIC_LP8764X_REGULATOR_BUCK_PLDN_DISABLE (0x0U)
118 /* @} */
119 
129 #define PMIC_LP8764X_VMON_DISABLE (0x0U)
130 
131 #define PMIC_LP8764X_VMON_ENABLE (0x1U)
132 /* @} */
133 
143 #define PMIC_LP8764X_REGULATOR_BUCK_VOUT_SEL_VOUT2 (bool)true
144 
145 #define PMIC_LP8764X_REGULATOR_BUCK_VOUT_SEL_VOUT1 (bool)false
146 /* @} */
147 
158 #define PMIC_LP8764X_REGULATOR_PWM_MODE (0x1U)
159 
160 #define PMIC_LP8764X_REGULATOR_AUTO_PWM_PFM_MODE (0x0U)
161 /* @} */
162 
173 #define PMIC_LP8764X_REGULATOR_PWM_MP_MODE (0x1U)
174 
175 #define PMIC_LP8764X_REGULATOR_AUTO_PHASE_MODE (0x0U)
176 /* @} */
177 
185 #define PMIC_LP8764X_BUCK_REGULATOR_ENABLE (0x1U)
186 
187 #define PMIC_LP8764X_BUCK_REGULATOR_DISABLE (0x0U)
188 /* @} */
189 
197 #define PMIC_LP8764X_POWER_RESOURCE_DEGLITCH_SEL_4US (0x0U)
198 
199 #define PMIC_LP8764X_POWER_RESOURCE_DEGLITCH_SEL_20US (0x1U)
200 /* @} */
201 
209 #define PMIC_LP8764X_VCCA_PG_3V3_LEVEL (0x0U)
210 
211 #define PMIC_LP8764X_VCCA_PG_5V_LEVEL (0x1U)
212 /* @} */
213 
221 #define PMIC_LP8764X_VMON_RANGE_0V3_3V34 (bool)false
222 
223 #define PMIC_LP8764X_VMON_RANGE_3V35_5V (bool)true
224 /* @} */
225 
233 #define PMIC_LP8764X_REGULATOR_BUCK_CURRENT_LIMIT_2A5 (0x2U)
234 
235 #define PMIC_LP8764X_REGULATOR_BUCK_CURRENT_LIMIT_3A5 (0x3U)
236 
237 #define PMIC_LP8764X_REGULATOR_BUCK_CURRENT_LIMIT_4A5 (0x4U)
238 
239 #define PMIC_LP8764X_REGULATOR_BUCK_CURRENT_LIMIT_5A5 (0x5U)
240 
241 #define PMIC_LP8764X_REGULATOR_BUCK_CURRENT_LIMIT_6A5 (0x6U)
242 /* @} */
243 
251 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_33MV (0x0U)
252 
253 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_20MV (0x1U)
254 
255 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_10MV (0x2U)
256 
257 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_05MV (0x3U)
258 
259 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_2MV5 (0x4U)
260 
261 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_1MV3 (0x5U)
262 
263 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_0MV63 (0x6U)
264 
265 #define PMIC_LP8764X_REGULATOR_BUCK_VMON_SLEW_RATE_0MV31 (0x7U)
266 /* @} */
267 
281 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_30_OR_3 (0U)
282 
285 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_35_OR_3P5 (1U)
286 
289 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_40_OR_4 (2U)
290 
293 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_50_OR_5 (3U)
294 
297 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_60_OR_6 (4U)
298 
301 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_70_OR_7 (5U)
302 
305 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_80_OR_8 (6U)
306 
309 #define PMIC_LP8764X_PG_OV_UV_THRESHOLD_LVL_100_OR_10 (7U)
310 /* @} */
311 
323 #define PMIC_LP8764X_POWER_RAIL_SEL_NONE (0x0U)
324 
325 #define PMIC_LP8764X_POWER_RAIL_SEL_MCU (0x1U)
326 
327 #define PMIC_LP8764X_POWER_RAIL_SEL_SOC (0x2U)
328 
329 #define PMIC_LP8764X_POWER_RAIL_SEL_OTHER (0x3U)
330 /* @} */
331 
338 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_VCCA (0U)
339 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_BUCK (1U)
340 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_NRSTOUT (2U)
341 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_NRSTOUT_SOC (3U)
342 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_TDIE (4U)
343 /* LDO type is not supported by HERA LP8764X PMIC */
344 #define PMIC_LP8764X_PGOOD_SOURCE_TYPE_VMON (6U)
345 /* @} */
346 
353 #define PMIC_LP8764X_PGOOD_SOURCE_VCCA \
354  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_VCCA << 8U) | 0U))
355 #define PMIC_LP8764X_PGOOD_SOURCE_BUCK1 \
356  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_BUCK << 8U) | 1U))
357 #define PMIC_LP8764X_PGOOD_SOURCE_BUCK2 \
358  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_BUCK << 8U) | 2U))
359 #define PMIC_LP8764X_PGOOD_SOURCE_BUCK3 \
360  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_BUCK << 8U) | 3U))
361 #define PMIC_LP8764X_PGOOD_SOURCE_BUCK4 \
362  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_BUCK << 8U) | 4U))
363 #define PMIC_LP8764X_PGOOD_SOURCE_NRSTOUT \
364  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_NRSTOUT << 8U) | 5U))
365 #define PMIC_LP8764X_PGOOD_SOURCE_NRSTOUT_SOC \
366  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_NRSTOUT_SOC << 8U) | 6U))
367 #define PMIC_LP8764X_PGOOD_SOURCE_TDIE \
368  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_TDIE << 8U) | 7U))
369 #define PMIC_LP8764X_PGOOD_SOURCE_VMON1 \
370  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_VMON << 8U) | 8U))
371 #define PMIC_LP8764X_PGOOD_SOURCE_VMON2 \
372  ((((uint16_t)PMIC_LP8764X_PGOOD_SOURCE_TYPE_VMON << 8U) | 9U))
373 /* @} */
374 
382 #define PMIC_LP8764X_POWER_GOOD_UV_MONITOR_ENABLE (0x0U)
383 
384 #define PMIC_LP8764X_POWER_GOOD_UV_OV_MONITOR_ENABLE (0x1U)
385 /* @} */
386 
394 #define PMIC_LP8764X_POWER_PGOOD_POL_HIGH (0x0U)
395 
396 #define PMIC_LP8764X_POWER_PGOOD_POL_LOW (0x1U)
397 /* @} */
398 
406 #define PMIC_LP8764X_POWER_PGOOD_SEL_NRSTOUT_SOC_MASKED (0x0U)
407 
408 #define PMIC_LP8764X_POWER_PGOOD_SEL_NRSTOUT_SOC (0x1U)
409 /* @} */
410 
418 #define PMIC_LP8764X_POWER_PGOOD_SEL_NRSTOUT_MASKED (0x0U)
419 
420 #define PMIC_LP8764X_POWER_PGOOD_SEL_NRSTOUT (0x1U)
421 /* @} */
422 
430 #define PMIC_LP8764X_POWER_PGOOD_SEL_TDIE_WARN_MASKED (0x0U)
431 
432 #define PMIC_LP8764X_POWER_PGOOD_SEL_TDIE_WARN (0x1U)
433 /* @} */
434 
442 #define PMIC_LP8764X_POWER_PGOOD_SEL_VCCA_VMON_DISABLE (0x0U)
443 
444 #define PMIC_LP8764X_POWER_PGOOD_SEL_VCCA_VMON_ENABLE (0x1U)
445 /* @} */
446 
454 #define PMIC_LP8764X_POWER_PGOOD_SEL_SRC_MASKED (0x0U)
455 
456 #define PMIC_LP8764X_POWER_PGOOD_SEL_SRC_VOLTAGE (0x1U)
457 
458 #define PMIC_LP8764X_POWER_PGOOD_SEL_SRC_VOLTAGE_CURRENT (0x2U)
459 /* @} */
460 
469 #define PMIC_LP8764X_POWER_CURRENT_LIMIT_STATUS_ABOVE_LIMIT (0x0U)
470 
472 #define PMIC_LP8764X_POWER_CURRENT_LIMIT_STATUS_BELOW_LIMIT (0x1U)
473 /* @} */
474 
485 #define PMIC_LP8764X_REGULATOR_OUTPUT_UNDER_VOLTAGE_STATUS_ABOVE_UV (0x0U)
486 
489 #define PMIC_LP8764X_REGULATOR_OUTPUT_UNDER_VOLTAGE_STATUS_BELOW_UV (0x1U)
490 /* @} */
491 
501 #define PMIC_LP8764X_VCCA_VMON_INPUT_UNDER_VOLTAGE_STATUS_ABOVE_UV (0x0U)
502 
504 #define PMIC_LP8764X_VCCA_VMON_INPUT_UNDER_VOLTAGE_STATUS_BELOW_UV (0x1U)
505 /* @} */
506 
517 #define PMIC_LP8764X_REGULATOR_OUTPUT_OVER_VOLTAGE_STATUS_ABOVE_OV (0x0U)
518 
521 #define PMIC_LP8764X_REGULATOR_OUTPUT_OVER_VOLTAGE_STATUS_BELOW_OV (0x1U)
522 /* @} */
523 
533 #define PMIC_LP8764X_VCCA_VMON_INPUT_OVER_VOLTAGE_STATUS_ABOVE_OV (0x0U)
534 
536 #define PMIC_LP8764X_VCCA_VMON_INPUT_OVER_VOLTAGE_STATUS_BELOW_OV (0x1U)
537 /* @} */
538 
548 #define PMIC_LP8764X_VCCA_OVER_VOLTAGE_LVL_STATUS_ABOVE_OV (0x0U)
549 
551 #define PMIC_LP8764X_VCCA_OVER_VOLTAGE_LVL_STATUS_BELOW_OV (0x1U)
552 /* @} */
553 
561 #define PMIC_LP8764X_THERMAL_TEMP_TSD_ORD_140C (0U)
562 
563 #define PMIC_LP8764X_THERMAL_TEMP_TSD_ORD_145C (1U)
564 /* @} */
565 
573 #define PMIC_LP8764X_THERMAL_TEMP_WARN_120C (0U)
574 
575 #define PMIC_LP8764X_THERMAL_TEMP_WARN_130C (1U)
576 /* @} */
577 
584 #define PMIC_LP8764X_POWER_OV_INT (0U)
585 #define PMIC_LP8764X_POWER_UV_INT (1U)
586 #define PMIC_LP8764X_POWER_ILIM_INT (3U)
587 /* @} */
588 
595 #define PMIC_LP8764X_POWER_INTERRUPT_TWARN (0U)
596 #define PMIC_LP8764X_POWER_INTERRUPT_NRSTOUT_READBACK (1U)
597 #define PMIC_LP8764X_POWER_INTERRUPT_SOC_PWR_ERR (2U)
598 #define PMIC_LP8764X_POWER_INTERRUPT_MCU_PWR_ERR (3U)
599 #define PMIC_LP8764X_POWER_INTERRUPT_ORD_SHUTDOWN (4U)
600 #define PMIC_LP8764X_POWER_INTERRUPT_IMM_SHUTDOWN (5U)
601 #define PMIC_LP8764X_POWER_INTERRUPT_NRSTOUT_SOC_READBACK (6U)
602 #define PMIC_LP8764X_POWER_INTERRUPT_EN_DRV_READBACK (7U)
603 /* @} */
604 
605 /*==========================================================================*/
606 /* Structures and Enums */
607 /*==========================================================================*/
608 
609 /*==========================================================================*/
610 /* Function Declarations */
611 /*==========================================================================*/
612 
613 #ifdef __cplusplus
614 }
615 #endif /* __cplusplus */
616 
617 #endif/* PMIC_POWER_LP8764X_H_ */
618 
619 /* @} */