diff mbox series

[v2,02/12] arm: stm32mp: spl: update error management in board_init_f

Message ID 20200422142834.v2.2.I703cbd885066981e3bab374021d5578dce7cb035@changeid
State Accepted
Commit eaec1f9e90241e9fde5540f6da28063df730102f
Headers show
Series stm32mp1: several board and arch updates | expand

Commit Message

Patrick Delaunay April 22, 2020, 12:29 p.m. UTC
Call hang when an error is detected for probe of any driver
needed for console or DDR init: clk, reset and pincontrol

NB: previous behavior with a return in board_init_f() was not correct;
    DDR is not initialized and SPL execution can't continue


Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
---

Changes in v2:
- simplify patch after Wolfgang review, as console init alway failed when
  drivers can't probe (remove printf after preloader_console_init call)

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

Comments

Patrice CHOTARD May 11, 2020, 1:58 p.m. UTC | #1
On 4/22/20 2:29 PM, Patrick Delaunay wrote:
> Call hang when an error is detected for probe of any driver
> needed for console or DDR init: clk, reset and pincontrol
>
> NB: previous behavior with a return in board_init_f() was not correct;
>     DDR is not initialized and SPL execution can't continue
>
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at st.com>
> ---
>
> Changes in v2:
> - simplify patch after Wolfgang review, as console init alway failed when
>   drivers can't probe (remove printf after preloader_console_init call)
>
>  arch/arm/mach-stm32mp/spl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c
> index ca4231cd0d..445c5a231c 100644
> --- a/arch/arm/mach-stm32mp/spl.c
> +++ b/arch/arm/mach-stm32mp/spl.c
> @@ -92,19 +92,19 @@ void board_init_f(ulong dummy)
>  	ret = uclass_get_device(UCLASS_CLK, 0, &dev);
>  	if (ret) {
>  		debug("Clock init failed: %d\n", ret);
> -		return;
> +		hang();
>  	}
>  
>  	ret = uclass_get_device(UCLASS_RESET, 0, &dev);
>  	if (ret) {
>  		debug("Reset init failed: %d\n", ret);
> -		return;
> +		hang();
>  	}
>  
>  	ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
>  	if (ret) {
>  		debug("%s: Cannot find pinctrl device\n", __func__);
> -		return;
> +		hang();
>  	}
>  
>  	/* enable console uart printing */

Reviewed-by: Patrice Chotard <patrice.chotard at 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..445c5a231c 100644
--- a/arch/arm/mach-stm32mp/spl.c
+++ b/arch/arm/mach-stm32mp/spl.c
@@ -92,19 +92,19 @@  void board_init_f(ulong dummy)
 	ret = uclass_get_device(UCLASS_CLK, 0, &dev);
 	if (ret) {
 		debug("Clock init failed: %d\n", ret);
-		return;
+		hang();
 	}
 
 	ret = uclass_get_device(UCLASS_RESET, 0, &dev);
 	if (ret) {
 		debug("Reset init failed: %d\n", ret);
-		return;
+		hang();
 	}
 
 	ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
 	if (ret) {
 		debug("%s: Cannot find pinctrl device\n", __func__);
-		return;
+		hang();
 	}
 
 	/* enable console uart printing */