1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2 /*
3  * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
4  */
5 
6 #include <config.h>
7 #include <common.h>
8 #include <asm/arch/sys_proto.h>
9 #include "../common/stpmic1.h"
10 
11 /* board early initialisation in board_f: need to use global variable */
12 static u32 opp_voltage_mv __section(".data");
13 
board_vddcore_init(u32 voltage_mv)14 void board_vddcore_init(u32 voltage_mv)
15 {
16 	if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
17 		opp_voltage_mv = voltage_mv;
18 }
19 
board_early_init_f(void)20 int board_early_init_f(void)
21 {
22 	if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER))
23 		stpmic1_init(opp_voltage_mv);
24 
25 	return 0;
26 }
27 
28