1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
7 #include <power/pmic.h>
8 #include <power/stpmic1.h>
9 #include <asm/arch/sys_proto.h>
10 #include "../common/stpmic1.h"
12 /* board early initialisation in board_f: need to use global variable */
13 static u32 opp_voltage_mv __section(".data");
15 void board_vddcore_init(u32 voltage_mv)
17 if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
18 opp_voltage_mv = voltage_mv;
21 int board_early_init_f(void)
23 if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER)) {
24 struct udevice *dev = stpmic1_init(opp_voltage_mv);
26 /* Keep vdd on during the reset cycle */
28 STPMIC1_BUCKS_MRST_CR,
29 STPMIC1_MRST_BUCK(STPMIC1_BUCK3),
30 STPMIC1_MRST_BUCK(STPMIC1_BUCK3));