Hi Mario,

On 27 April 2018 at 06:52, Mario Six <mario....@gdsys.cc> wrote:
> To print the reset status during boot, add a method print_resetinfo to
> board_f, which is called in init_sequence_f[], that gets the reset
> information from the sysreset driver (assuming there is only one seems
> reasonable), and prints it.
>
> Signed-off-by: Mario Six <mario....@gdsys.cc>
>
> ---
>
> v1 -> v2:
> New in v2
>
> ---
>  common/board_f.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Reviewed-by: Simon Glass <s...@chromium.org>

nit below

>
> diff --git a/common/board_f.c b/common/board_f.c
> index ae8bdb7c5c..2df30cd250 100644
> --- a/common/board_f.c
> +++ b/common/board_f.c
> @@ -25,6 +25,7 @@
>  #include <relocate.h>
>  #include <spi.h>
>  #include <status_led.h>
> +#include <sysreset.h>
>  #include <timer.h>
>  #include <trace.h>
>  #include <video.h>
> @@ -141,6 +142,21 @@ static int display_text_info(void)
>         return 0;
>  }
>
> +#ifdef CONFIG_SYSRESET
> +static int print_resetinfo(void)
> +{
> +       struct udevice *dev;
> +       char status[256];
> +
> +       uclass_first_device_err(UCLASS_SYSRESET, &dev);

Should check the result and only call the function below if it is 0.

> +
> +       if (!sysreset_get_status(dev, status, sizeof(status)))
> +               printf("%s", status);
> +
> +       return 0;
> +}
> +#endif
> +

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to