diff mbox series

[5/9] ARM: stm32: Add board_early_init_f() to SPL

Message ID 20200421151128.18072-2-patrick.delaunay@st.com
State Changes Requested
Delegated to: Patrice Chotard
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
From: Marek Vasut <marex@denx.de>

Add weak implementation of board_early_init_f() hook into the
STM32MP1 SPL. This can be used to read out e.g. configuration
straps before initializing the DRAM.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 arch/arm/mach-stm32mp/spl.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

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

On 4/21/20 5:11 PM, Patrick Delaunay wrote:
> From: Marek Vasut <marex@denx.de>
>
> Add weak implementation of board_early_init_f() hook into the
> STM32MP1 SPL. This can be used to read out e.g. configuration
> straps before initializing the DRAM.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> Cc: Patrick Delaunay <patrick.delaunay@st.com>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
>  arch/arm/mach-stm32mp/spl.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
> index ca4231cd0d..cd14d1065e 100644
> --- a/arch/arm/mach-stm32mp/spl.c
> +++ b/arch/arm/mach-stm32mp/spl.c
> @@ -76,6 +76,11 @@ void spl_display_print(void)
>  }
>  #endif
>  
> +__weak int board_early_init_f(void)
> +{
> +	return 0;
> +}
> +
>  void board_init_f(ulong dummy)
>  {
>  	struct udevice *dev;
> @@ -110,6 +115,12 @@ void board_init_f(ulong dummy)
>  	/* enable console uart printing */
>  	preloader_console_init();
>  
> +	ret = board_early_init_f();
> +	if (ret) {
> +		debug("board_early_init_f() failed: %d\n", ret);
> +		hang();
> +	}
> +
>  	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
>  	if (ret) {
>  		printf("DRAM init failed: %d\n", ret);

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

Thanks

Patrice
diff mbox series

Patch

diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
index ca4231cd0d..cd14d1065e 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -76,6 +76,11 @@  void spl_display_print(void)
 }
 #endif
 
+__weak int board_early_init_f(void)
+{
+	return 0;
+}
+
 void board_init_f(ulong dummy)
 {
 	struct udevice *dev;
@@ -110,6 +115,12 @@  void board_init_f(ulong dummy)
 	/* enable console uart printing */
 	preloader_console_init();
 
+	ret = board_early_init_f();
+	if (ret) {
+		debug("board_early_init_f() failed: %d\n", ret);
+		hang();
+	}
+
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
 		printf("DRAM init failed: %d\n", ret);