arm: stm32mp: spl: update error management in board_init_f
authorPatrick Delaunay <patrick.delaunay@st.com>
Wed, 22 Apr 2020 12:29:10 +0000 (14:29 +0200)
committerPatrick Delaunay <patrick.delaunay@st.com>
Thu, 14 May 2020 07:02:12 +0000 (09:02 +0200)
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@st.com>
arch/arm/mach-stm32mp/spl.c

index 760fe45f56fcd9e0cff075c37d12f916c3008ca2..6368db4f6d3adeae5c5f094e342120008d87efec 100644 (file)
@@ -99,19 +99,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 */