mb/google/brya: Create rull variant
[coreboot2.git] / src / drivers / maxim / max77802 / max77802.h
blobf880cb4a268f32f8bc9f45e68693d1e54238be2c
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef __MAX77802_H_
4 #define __MAX77802_H_
6 enum {
7 MAX77802_REG_PMIC_ID = 0x0,
8 MAX77802_REG_PMIC_INTSRC,
9 MAX77802_REG_PMIC_INT1,
10 MAX77802_REG_PMIC_INT2,
11 MAX77802_REG_PMIC_INT1MSK,
12 MAX77802_REG_PMIC_INT2MSK,
14 MAX77802_REG_PMIC_STATUS1,
15 MAX77802_REG_PMIC_STATUS2,
17 MAX77802_REG_PMIC_PWRON,
18 MAX77802_REG_PMIC_MRSTB = 0xA,
19 MAX77802_REG_PMIC_EPWRHOLD,
20 MAX77802_REG_PMIC_BOOSTCTRL = 0xE,
21 MAX77802_REG_PMIC_BOOSTOUT,
23 MAX77802_REG_PMIC_BUCK1CTRL = 0x10,
24 MAX77802_REG_PMIC_BUCK1DVS1,
25 MAX77802_REG_PMIC_BUCK1DVS2,
26 MAX77802_REG_PMIC_BUCK1DVS3,
27 MAX77802_REG_PMIC_BUCK1DVS4,
28 MAX77802_REG_PMIC_BUCK1DVS5,
29 MAX77802_REG_PMIC_BUCK1DVS6,
30 MAX77802_REG_PMIC_BUCK1DVS7,
31 MAX77802_REG_PMIC_BUCK1DVS8,
33 MAX77802_REG_PMIC_BUCK234FREQ,
34 MAX77802_REG_PMIC_BUCK2CTRL1,
35 MAX77802_REG_PMIC_BUCK2CTRL2,
36 MAX77802_REG_PMIC_BUCK2PHTRAN,
38 MAX77802_REG_PMIC_BUCK2DVS1,
39 MAX77802_REG_PMIC_BUCK2DVS2,
40 MAX77802_REG_PMIC_BUCK2DVS3,
41 MAX77802_REG_PMIC_BUCK2DVS4,
42 MAX77802_REG_PMIC_BUCK2DVS5,
43 MAX77802_REG_PMIC_BUCK2DVS6,
44 MAX77802_REG_PMIC_BUCK2DVS7,
45 MAX77802_REG_PMIC_BUCK2DVS8,
46 MAX77802_REG_PMIC_BUCK3CTRL1 = 0x27,
47 MAX77802_REG_PMIC_BUCK3DVS1,
48 MAX77802_REG_PMIC_BUCK3DVS2,
49 MAX77802_REG_PMIC_BUCK3DVS3,
50 MAX77802_REG_PMIC_BUCK3DVS4,
51 MAX77802_REG_PMIC_BUCK3DVS5,
52 MAX77802_REG_PMIC_BUCK3DVS6,
53 MAX77802_REG_PMIC_BUCK3DVS7,
54 MAX77802_REG_PMIC_BUCK3DVS8,
55 MAX77802_REG_PMIC_BUCK4CTRL1 = 0x37,
56 MAX77802_REG_PMIC_BUCK4DVS1,
57 MAX77802_REG_PMIC_BUCK4DVS2,
58 MAX77802_REG_PMIC_BUCK4DVS3,
59 MAX77802_REG_PMIC_BUCK4DVS4,
60 MAX77802_REG_PMIC_BUCK4DVS5,
61 MAX77802_REG_PMIC_BUCK4DVS6,
62 MAX77802_REG_PMIC_BUCK4DVS7,
63 MAX77802_REG_PMIC_BUCK4DVS8,
64 MAX77802_REG_PMIC_BUCK5CTRL1 = 0x40,
65 MAX77802_REG_PMIC_BUCK5CTRL,
66 MAX77802_REG_PMIC_BUCK5OUT,
68 MAX77802_REG_PMIC_BUCK6CTRL = 0x44,
69 MAX77802_REG_PMIC_BUCK6DVS1,
70 MAX77802_REG_PMIC_BUCK6DVS2,
71 MAX77802_REG_PMIC_BUCK6DVS3,
72 MAX77802_REG_PMIC_BUCK6DVS4,
73 MAX77802_REG_PMIC_BUCK6DVS5,
74 MAX77802_REG_PMIC_BUCK6DVS6,
75 MAX77802_REG_PMIC_BUCK6DVS7,
76 MAX77802_REG_PMIC_BUCK6DVS8,
78 MAX77802_REG_PMIC_BUCK7CTRL = 0x4E,
79 MAX77802_REG_PMIC_BUCK7OUT,
81 MAX77802_REG_PMIC_BUCK8CTRL = 0x51,
82 MAX77802_REG_PMIC_BUCK8OUT,
84 MAX77802_REG_PMIC_BUCK9CTRL = 0x54,
85 MAX77802_REG_PMIC_BUCK9OUT,
87 MAX77802_REG_PMIC_BUCK10CTRL = 0x57,
88 MAX77802_REG_PMIC_BUCK10OUT,
90 MAX77802_REG_PMIC_LDO1CTRL1 = 0x60,
91 MAX77802_REG_PMIC_LDO2CTRL1,
92 MAX77802_REG_PMIC_LDO3CTRL1,
93 MAX77802_REG_PMIC_LDO4CTRL1,
94 MAX77802_REG_PMIC_LDO5CTRL1,
95 MAX77802_REG_PMIC_LDO6CTRL1,
96 MAX77802_REG_PMIC_LDO7CTRL1,
97 MAX77802_REG_PMIC_LDO8CTRL1,
98 MAX77802_REG_PMIC_LDO9CTRL1,
99 MAX77802_REG_PMIC_LDO10CTRL1,
100 MAX77802_REG_PMIC_LDO11CTRL1,
101 MAX77802_REG_PMIC_LDO12CTRL1,
102 MAX77802_REG_PMIC_LDO13CTRL1,
103 MAX77802_REG_PMIC_LDO14CTRL1,
104 MAX77802_REG_PMIC_LDO15CTRL1,
106 MAX77802_REG_PMIC_LDO17CTRL1 = 0x70,
107 MAX77802_REG_PMIC_LDO18CTRL1,
108 MAX77802_REG_PMIC_LDO19CTRL1,
109 MAX77802_REG_PMIC_LDO20CTRL1,
110 MAX77802_REG_PMIC_LDO21CTRL1,
112 MAX77802_REG_PMIC_LDO23CTRL1 = 0x76,
113 MAX77802_REG_PMIC_LDO24CTRL1,
114 MAX77802_REG_PMIC_LDO25CTRL1,
115 MAX77802_REG_PMIC_LDO26CTRL1,
116 MAX77802_REG_PMIC_LDO27CTRL1 = 0x7A,
117 MAX77802_REG_PMIC_LDO28CTRL1,
118 MAX77802_REG_PMIC_LDO29CTRL1,
119 MAX77802_REG_PMIC_LDO30CTRL1,
120 MAX77802_REG_PMIC_LDO32CTRL1 = 0x7F,
121 MAX77802_REG_PMIC_LDO33CTRL1,
122 MAX77802_REG_PMIC_LDO34CTRL1,
123 MAX77802_REG_PMIC_LDO35CTRL1,
125 MAX77802_REG_PMIC_LDO1CTRL2 = 0x90,
126 MAX77802_REG_PMIC_LDO2CTRL2,
127 MAX77802_REG_PMIC_LDO3CTRL2,
128 MAX77802_REG_PMIC_LDO4CTRL2,
129 MAX77802_REG_PMIC_LDO5CTRL2,
130 MAX77802_REG_PMIC_LDO6CTRL2 = 0x95,
131 MAX77802_REG_PMIC_LDO7CTRL2,
132 MAX77802_REG_PMIC_LDO8CTRL2,
133 MAX77802_REG_PMIC_LDO9CTRL2,
134 MAX77802_REG_PMIC_LDO10CTRL2,
135 MAX77802_REG_PMIC_LDO11CTRL2,
136 MAX77802_REG_PMIC_LDO12CTRL2,
137 MAX77802_REG_PMIC_LDO13CTRL2,
138 MAX77802_REG_PMIC_LDO14CTRL2,
139 MAX77802_REG_PMIC_LDO15CTRL2,
141 MAX77802_REG_PMIC_LDO17CTRL2 = 0xA0,
142 MAX77802_REG_PMIC_LDO18CTRL2,
143 MAX77802_REG_PMIC_LDO19CTRL2,
144 MAX77802_REG_PMIC_LDO20CTRL2,
145 MAX77802_REG_PMIC_LDO21CTRL2,
146 MAX77802_REG_PMIC_LDO22CTRL2,
147 MAX77802_REG_PMIC_LDO23CTRL2,
148 MAX77802_REG_PMIC_LDO24CTRL2,
149 MAX77802_REG_PMIC_LDO25CTRL2,
150 MAX77802_REG_PMIC_LDO26CTRL2,
151 MAX77802_REG_PMIC_LDO27CTRL2 = 0xAA,
152 MAX77802_REG_PMIC_LDO28CTRL2,
153 MAX77802_REG_PMIC_LDO29CTRL2,
154 MAX77802_REG_PMIC_LDO30CTRL2,
155 MAX77802_REG_PMIC_LDO32CTRL2 = 0xAF,
156 MAX77802_REG_PMIC_LDO33CTRL2 = 0xB0,
157 MAX77802_REG_PMIC_LDO34CTRL2,
158 MAX77802_REG_PMIC_LDO35CTRL2,
160 MAX77802_REG_PMIC_BBAT = 0xB4,
161 MAX77802_REG_PMIC_32KHZ,
163 MAX77802_NUM_OF_REGS,
166 /* I2C device address for pmic max77686 */
167 #define MAX77802_I2C_ADDR (0x12 >> 1)
169 enum {
170 LDO_OFF = 0,
171 LDO_ON,
173 DIS_LDO = (0x00 << 6),
174 EN_LDO = (0x3 << 6),
177 /* Buck1 1.0 volt value (P1.0V_AP_MIF) */
178 #define MAX77802_BUCK1DVS1_1V 0x3E
179 /* Buck2 1.0 volt value (P1.0V_VDD_ARM) */
180 #define MAX77802_BUCK2DVS1_1V 0x40
181 /* Buck2 1.2625 volt value (P1.2625V_VDD_ARM) */
182 #define MAX77802_BUCK2DVS1_1_2625V 0x6A
183 /* Buck3 1.0 volt value (P1.0V_VDD_INT) */
184 #define MAX77802_BUCK3DVS1_1V 0x40
185 /* Buck4 1.0 volt value (P1.0V_VDD_G3D) */
186 #define MAX77802_BUCK4DVS1_1V 0x40
187 /* Buck6 1.0 volt value (P1.0V_AP_KFC) */
188 #define MAX77802_BUCK6DVS1_1V 0x3E
191 * Different Bucks use different bits to control power. There are two types,
192 * defined below.
194 /* Type 1, works for BUCKs 1, 5, 6...10 */
195 #define MAX77802_BUCK_TYPE1_ON (1 << 0)
196 #define MAX77802_BUCK_TYPE1_IGNORE_PWRREQ (1 << 1)
198 /* Type 2, works for BUCKs 2...4 */
199 #define MAX77802_BUCK_TYPE2_ON (1 << 4)
200 #define MAX77802_BUCK_TYPE2_IGNORE_PWRREQ (1 << 5)
202 /* LDO35 1.2 volt value for bridge IC */
203 #define MAX77802_LDO35CTRL1_1_2V (1 << 4)
204 #define MAX77802_LOD35CTRL1_ON (1 << 6)
206 /* Disable Boost Mode*/
207 #define MAX77802_BOOSTCTRL_OFF 0x09
210 * MAX77802_REG_PMIC_32KHZ set to 32KH CP
211 * output is activated
213 #define MAX77802_32KHCP_EN (1 << 1)
216 * MAX77802_REG_PMIC_BBAT set to
217 * Back up battery charger on and
218 * limit voltage setting to 3.5v
220 #define MAX77802_BBCHOSTEN (1 << 0)
221 #define MAX77802_BBCVS_3_5V (3 << 3)
223 #endif /* __MAX77802_H_ */