From patchwork Tue Apr 21 15:11:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 238208 List-Id: U-Boot discussion From: patrick.delaunay at st.com (Patrick Delaunay) Date: Tue, 21 Apr 2020 17:11:27 +0200 Subject: [PATCH 8/9] board: stm32mp1: update vddcore in SPL In-Reply-To: <20200421151128.18072-1-patrick.delaunay@st.com> References: <20200421151128.18072-1-patrick.delaunay@st.com> Message-ID: <20200421171123.8.I6f11a8bc7a6681ab18c3bbbc1ac73cbdac030982@changeid> For board using STPMIC1, the vddcore is provided by BUCK1 of STMPIC1 and need to be updated for 800MHz support and only after the clock tree initialization. The VDDCORE voltage value in provide by clock driver, saved in global variable opp_voltage_mv and udpated SPL in board_early_init_f(). Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- board/st/stm32mp1/spl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/board/st/stm32mp1/spl.c b/board/st/stm32mp1/spl.c index e65ff288ea..616fb1d6f2 100644 --- a/board/st/stm32mp1/spl.c +++ b/board/st/stm32mp1/spl.c @@ -12,6 +12,26 @@ #include #include #include +#include "../common/stpmic1.h" + +/* board early initialisation in board_f: need to use global variable */ +#if defined(CONFIG_PMIC_STPMIC1) && defined(CONFIG_SPL_POWER_SUPPORT) +static u32 opp_voltage_mv __section(".data"); + +void board_vddcore_init(u32 voltage_mv) +{ + opp_voltage_mv = voltage_mv; +} +#endif + +int board_early_init_f(void) +{ +#if defined(CONFIG_PMIC_STPMIC1) && defined(CONFIG_SPL_POWER_SUPPORT) + stmpic_buck1_set(opp_voltage_mv); +#endif + + return 0; +} void spl_board_init(void) {