Tom Rini | 8b0c8a1 | 2018-05-06 18:27:01 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2018, STMicroelectronics - All Rights Reserved |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <config.h> |
| 7 | #include <common.h> |
Patrick Delaunay | f2f25c3 | 2020-05-25 12:19:46 +0200 | [diff] [blame] | 8 | #include <asm/arch/sys_proto.h> |
| 9 | #include "../common/stpmic1.h" |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 10 | |
Patrick Delaunay | 08c891a | 2020-05-25 12:19:47 +0200 | [diff] [blame] | 11 | /* board early initialisation in board_f: need to use global variable */ |
| 12 | static u32 opp_voltage_mv __section(".data"); |
| 13 | |
| 14 | void board_vddcore_init(u32 voltage_mv) |
| 15 | { |
Simon Glass | e91ac4c | 2021-07-10 21:14:24 -0600 | [diff] [blame] | 16 | if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER)) |
Patrick Delaunay | 08c891a | 2020-05-25 12:19:47 +0200 | [diff] [blame] | 17 | opp_voltage_mv = voltage_mv; |
| 18 | } |
| 19 | |
Patrick Delaunay | f2f25c3 | 2020-05-25 12:19:46 +0200 | [diff] [blame] | 20 | int board_early_init_f(void) |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 21 | { |
Simon Glass | e91ac4c | 2021-07-10 21:14:24 -0600 | [diff] [blame] | 22 | if (IS_ENABLED(CONFIG_PMIC_STPMIC1) && CONFIG_IS_ENABLED(POWER)) |
Patrick Delaunay | 08c891a | 2020-05-25 12:19:47 +0200 | [diff] [blame] | 23 | stpmic1_init(opp_voltage_mv); |
Patrick Delaunay | bff284f | 2019-07-30 19:16:20 +0200 | [diff] [blame] | 24 | |
Patrick Delaunay | f2f25c3 | 2020-05-25 12:19:46 +0200 | [diff] [blame] | 25 | return 0; |
Patrick Delaunay | 8eb3b1e | 2018-03-12 10:46:18 +0100 | [diff] [blame] | 26 | } |
Patrick Delaunay | 79c0791 | 2020-05-25 12:19:49 +0200 | [diff] [blame] | 27 | |