diff mbox series

[8/9] board: stm32mp1: update vddcore in SPL

Message ID 20200421171123.8.I6f11a8bc7a6681ab18c3bbbc1ac73cbdac030982@changeid
State New
Headers show
Series stm32mp1: use OPP information for PLL1 settings in SPL | expand

Commit Message

Patrick Delaunay April 21, 2020, 3:11 p.m. UTC
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 <patrick.delaunay at st.com>
---

 board/st/stm32mp1/spl.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Patrice CHOTARD May 11, 2020, 1:54 p.m. UTC | #1
Hi Patrick

On 4/21/20 5:11 PM, Patrick Delaunay wrote:
> 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 <patrick.delaunay at st.com>
> ---
>
>  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 <power/pmic.h>
>  #include <power/stpmic1.h>
>  #include <asm/arch/ddr.h>
> +#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)
>  {

Reviewed-by: Patrice Chotard <patrice.chotard at st.com>

Thanks

Patrice
Patrick Delaunay May 13, 2020, 4:32 p.m. UTC | #2
Hi,

> From: Patrick DELAUNAY <patrick.delaunay at st.com>
> Sent: mardi 21 avril 2020 17:11
> 
> 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 <patrick.delaunay at st.com>
> ---

Ok for ST board boards but compilation failed for 
stm32mp15_dhcor_basic / stm32mp15_dhcom_basic

+arm-linux-gnueabi-ld.bfd: spl/board/dhelectronics/dh_stm32mp1/board.o: in function `board_early_init_f':
+board/dhelectronics/dh_stm32mp1/board.c:196: multiple definition of `board_early_init_f'; spl/board/dhelectronics/dh_stm32mp1/../../st/stm32mp1/spl.o:board/dhelectronics/dh_stm32mp1/../../st/stm32mp1/spl.c:28: first defined here

need V2
with rework for board/st/stm32mp1/spl.c
and better split for DHCOM SOM

regards

Patrick
diff mbox series

Patch

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 <power/pmic.h>
 #include <power/stpmic1.h>
 #include <asm/arch/ddr.h>
+#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)
 {