1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
4 * These values are used by MediaTek internally.
5 * We can find these registers in "MT6363TP_PMIC_Design_Notice_for_MT8196G_V0.2".
6 * The setting values are provided by MeidaTek designers.
9 #include <console/console.h>
10 #include <soc/mt6363.h>
12 static const struct pmic_setting init_setting
[] = {
102 {0x150B, 0x19, 0x7F},
103 {0x1587, 0xA8, 0xFF},
106 {0x158B, 0x19, 0x7F},
107 {0x1607, 0x40, 0xFF},
110 {0x160B, 0x19, 0x7F},
111 {0x1687, 0x78, 0xFF},
114 {0x168B, 0x19, 0x7F},
115 {0x1707, 0x40, 0xFF},
118 {0x1787, 0x40, 0xFF},
121 {0x1807, 0x40, 0xFF},
124 {0x1887, 0x98, 0xFF},
126 {0x188A, 0x19, 0x7F},
127 {0x188B, 0x33, 0x7F},
128 {0x1907, 0xA0, 0xFF},
131 {0x190B, 0x19, 0x7F},
132 {0x198A, 0x2E, 0x2F},
133 {0x198C, 0xF8, 0xF8},
134 {0x198D, 0x32, 0x3F},
136 {0x1990, 0xED, 0xFF},
137 {0x1991, 0x10, 0xFF},
139 {0x1995, 0x60, 0x60},
140 {0x1996, 0x45, 0xFF},
142 {0x1998, 0x10, 0x10},
143 {0x1999, 0x2D, 0x2F},
144 {0x199B, 0xF8, 0xF8},
145 {0x199C, 0x32, 0x3F},
147 {0x199F, 0xED, 0xFF},
149 {0x19A4, 0x60, 0x60},
150 {0x19A5, 0x45, 0xFF},
152 {0x19AC, 0x85, 0x87},
156 {0x1A08, 0x10, 0x10},
157 {0x1A09, 0x2D, 0x2F},
158 {0x1A0B, 0xF8, 0xF8},
159 {0x1A0C, 0x32, 0x3F},
161 {0x1A0F, 0xED, 0xFF},
163 {0x1A12, 0x10, 0x50},
164 {0x1A13, 0x2D, 0x2F},
165 {0x1A14, 0xC1, 0xC1},
166 {0x1A15, 0xFA, 0xFF},
167 {0x1A16, 0x32, 0x3F},
169 {0x1A19, 0x77, 0xFF},
170 {0x1A1A, 0xC0, 0xFF},
171 {0x1A1B, 0x2B, 0x7F},
172 {0x1A1C, 0x10, 0x50},
173 {0x1A1D, 0x2D, 0x2F},
174 {0x1A1E, 0xC1, 0xC1},
175 {0x1A1F, 0xFA, 0xFF},
176 {0x1A20, 0x32, 0x3F},
178 {0x1A23, 0x77, 0xFF},
179 {0x1A24, 0xC0, 0xFF},
180 {0x1A25, 0x2B, 0x7F},
181 {0x1A27, 0x2E, 0x2F},
182 {0x1A29, 0xF8, 0xF8},
183 {0x1A2A, 0x32, 0x3F},
185 {0x1A2D, 0xED, 0xFF},
186 {0x1A2E, 0x10, 0xFF},
189 {0x1A37, 0xFE, 0xFF},
190 {0x1A39, 0xCD, 0xFF},
191 {0x1A3A, 0x7F, 0xFF},
192 {0x1A3B, 0x7F, 0xFF},
193 {0x1A3C, 0x45, 0xFF},
194 {0x1A3D, 0xF0, 0xF0},
200 {0x1A88, 0x10, 0x50},
201 {0x1A89, 0x2D, 0x2F},
202 {0x1A8B, 0xF8, 0xF8},
203 {0x1A8C, 0x32, 0x3F},
205 {0x1A8F, 0xED, 0xFF},
207 {0x1A92, 0x10, 0x50},
208 {0x1A93, 0x2D, 0x2F},
210 {0x1A95, 0xFC, 0xFF},
211 {0x1A96, 0x32, 0x3F},
213 {0x1A99, 0xED, 0xFF},
216 {0x1A9C, 0x10, 0x10},
217 {0x1A9D, 0x2D, 0x2F},
218 {0x1A9E, 0xC1, 0xC1},
219 {0x1A9F, 0xFA, 0xFF},
220 {0x1AA0, 0x32, 0x3F},
222 {0x1AA3, 0x77, 0xFF},
223 {0x1AA4, 0xC0, 0xFF},
224 {0x1AA5, 0x2B, 0x7F},
225 {0x1AA6, 0x10, 0x10},
226 {0x1AA7, 0x2D, 0x2F},
227 {0x1AA8, 0xC1, 0xC1},
228 {0x1AA9, 0xFA, 0xFF},
229 {0x1AAA, 0x32, 0x3F},
231 {0x1AAD, 0x77, 0xFF},
232 {0x1AAE, 0xC0, 0xFF},
233 {0x1AAF, 0x2B, 0x7F},
234 {0x1AB7, 0xFC, 0xFE},
235 {0x1AB9, 0xCD, 0xFF},
236 {0x1ABA, 0xCD, 0xFF},
237 {0x1ABB, 0x7F, 0xFF},
238 {0x1ABC, 0x7F, 0xFF},
239 {0x1ABD, 0xF0, 0xF0},
245 {0x1ADD, 0x10, 0x78},
248 {0x1B11, 0xFF, 0xFF},
249 {0x1B14, 0xFF, 0xFF},
250 {0x1B17, 0xFF, 0xFF},
253 {0x1B88, 0x10, 0x10},
255 {0x1B96, 0x10, 0x10},
257 {0x1BA4, 0x10, 0x10},
259 {0x1BB2, 0x10, 0x10},
261 {0x1BC0, 0x10, 0x10},
263 {0x1BCE, 0x10, 0x10},
265 {0x1C08, 0x10, 0x10},
267 {0x1C0E, 0x40, 0x40},
268 {0x1C16, 0x10, 0x10},
270 {0x1C1C, 0x40, 0x40},
271 {0x1C24, 0x10, 0x10},
273 {0x1C32, 0x10, 0x10},
275 {0x1C40, 0x10, 0x10},
277 {0x1C4E, 0x10, 0x10},
279 {0x1C88, 0x10, 0x10},
281 {0x1C96, 0x10, 0x10},
283 {0x1CA4, 0x10, 0x10},
285 {0x1CB2, 0x10, 0x10},
287 {0x1CC0, 0x10, 0x10},
289 {0x1D08, 0x10, 0x10},
291 {0x1D1E, 0x10, 0x10},
293 {0x1D23, 0x20, 0x7F},
295 {0x1D28, 0x19, 0x7F},
296 {0x1D88, 0x10, 0x10},
298 {0x1D8D, 0x18, 0x7F},
300 {0x1D92, 0x19, 0x7F},
301 {0x1DA3, 0x10, 0x10},
303 {0x1DA8, 0x4C, 0x7F},
305 {0x1DAD, 0x19, 0x7F},
306 {0x1DB8, 0x14, 0x1C},
308 {0x1DBA, 0xC0, 0xFF},
309 {0x1DBC, 0x60, 0xFF},
310 {0x1E08, 0x10, 0x10},
312 {0x1E0D, 0x7F, 0x7F},
314 {0x1E12, 0x14, 0x7F},
315 {0x1E1E, 0x10, 0x10},
318 {0x1E28, 0x14, 0x7F},
319 {0x1E88, 0x10, 0x10},
321 {0x1E8D, 0x7F, 0x7F},
323 {0x1E92, 0x19, 0x7F},
324 {0x1E9E, 0x10, 0x10},
326 {0x1EA3, 0x58, 0x7F},
347 {0x2207, 0xE0, 0xE0},
348 {0x2208, 0xE0, 0xE0},
349 {0x2209, 0xE0, 0xE0},
350 {0x220A, 0xE0, 0xE0},
351 {0x2214, 0xF0, 0xF0},
354 /* Add UVLO 2.0 setting. also need to modify dts setting for main pmic */
360 * 1. Set VS1_VOTER_VOSEL = 1.8875V
361 * 2. Set VS1_VOTER_EN = 0x8 (bit3 for VS1 users)
363 {0x18A0, 0x97, 0xFF},
366 * 1. Set VS2_VOTER_VOSEL = 1.275V
367 * 2. Set VS2_VOTER_EN = 0x48 (bit6/3 for VS2 users)
369 {0x14A0, 0x66, 0xFF},
370 {0x149A, 0x48, 0xFF},
372 * 1. Set VS3_VOTER_VOSEL = 0.975V
373 * 2. Set VS3_VOTER_EN = 0x8 (bit3 for VS3 users)
375 {0x1920, 0x9C, 0xFF},
379 void pmic_init_setting(void)
381 for (int i
= 0; i
< ARRAY_SIZE(init_setting
); i
++)
382 mt6363_write_field(init_setting
[i
].addr
, init_setting
[i
].val
,
383 init_setting
[i
].mask
, 0);
386 * TODO: Disable unused modem power in a separate function and
387 * call that function from mainboard folder.
389 printk(BIOS_INFO
, "%s done\n", __func__
);