xref: /openbmc/u-boot/board/nvidia/venice2/as3722_init.h (revision b064c9124acddbcdc70843f62fda13a2d7d7a392)
1f7dc4ac3STom Warren /*
2f7dc4ac3STom Warren  * (C) Copyright 2013
3f7dc4ac3STom Warren  * NVIDIA Corporation <www.nvidia.com>
4f7dc4ac3STom Warren  *
5f7dc4ac3STom Warren  * SPDX-License-Identifier:     GPL-2.0+
6f7dc4ac3STom Warren  */
7f7dc4ac3STom Warren 
8f7dc4ac3STom Warren /* AS3722-PMIC-specific early init regs */
9f7dc4ac3STom Warren 
10f7dc4ac3STom Warren #define AS3722_I2C_ADDR		0x80
11f7dc4ac3STom Warren 
12f7dc4ac3STom Warren #define AS3722_SD0VOLTAGE_REG	0x00	/* CPU */
13f7dc4ac3STom Warren #define AS3722_SD1VOLTAGE_REG	0x01	/* CORE, already set by OTP */
14f7dc4ac3STom Warren #define AS3722_SD6VOLTAGE_REG	0x06	/* GPU */
15f7dc4ac3STom Warren #define AS3722_SDCONTROL_REG	0x4D
16f7dc4ac3STom Warren 
17f7dc4ac3STom Warren #define AS3722_LDO2VOLTAGE_REG	0x12	/* VPP_FUSE */
18f7dc4ac3STom Warren #define AS3722_LDO6VOLTAGE_REG	0x16	/* VDD_SDMMC */
19f7dc4ac3STom Warren #define AS3722_LDCONTROL_REG	0x4E
20f7dc4ac3STom Warren 
21a6c7b461SAllen Martin #if defined(CONFIG_TARGET_JETSON_TK1) || defined(CONFIG_TARGET_NYAN_BIG)
22e04bfdacSStephen Warren #define AS3722_SD0VOLTAGE_DATA	(0x3C00 | AS3722_SD0VOLTAGE_REG)
23e04bfdacSStephen Warren #else
24f7dc4ac3STom Warren #define AS3722_SD0VOLTAGE_DATA	(0x2800 | AS3722_SD0VOLTAGE_REG)
25e04bfdacSStephen Warren #endif
26f7dc4ac3STom Warren #define AS3722_SD0CONTROL_DATA	(0x0100 | AS3722_SDCONTROL_REG)
27f7dc4ac3STom Warren 
28*b064c912SBibek Basu #ifdef CONFIG_TARGET_JETSON_TK1
29*b064c912SBibek Basu #define AS3722_SD1VOLTAGE_DATA	(0x2800 | AS3722_SD1VOLTAGE_REG)
30f7dc4ac3STom Warren #define AS3722_SD1CONTROL_DATA	(0x0200 | AS3722_SDCONTROL_REG)
31*b064c912SBibek Basu #endif
32f7dc4ac3STom Warren 
33f7dc4ac3STom Warren #define AS3722_SD6CONTROL_DATA	(0x4000 | AS3722_SDCONTROL_REG)
34f7dc4ac3STom Warren #define AS3722_SD6VOLTAGE_DATA	(0x2800 | AS3722_SD6VOLTAGE_REG)
35f7dc4ac3STom Warren 
36f7dc4ac3STom Warren #define AS3722_LDO2CONTROL_DATA	(0x0400 | AS3722_LDCONTROL_REG)
37f7dc4ac3STom Warren #define AS3722_LDO2VOLTAGE_DATA	(0x1000 | AS3722_LDO2VOLTAGE_REG)
38f7dc4ac3STom Warren 
39f7dc4ac3STom Warren #define AS3722_LDO6CONTROL_DATA	(0x4000 | AS3722_LDCONTROL_REG)
40f7dc4ac3STom Warren #define AS3722_LDO6VOLTAGE_DATA	(0x3F00 | AS3722_LDO6VOLTAGE_REG)
41f7dc4ac3STom Warren 
42f7dc4ac3STom Warren #define I2C_SEND_2_BYTES	0x0A02
43f7dc4ac3STom Warren 
44f7dc4ac3STom Warren void pmic_enable_cpu_vdd(void);
45