[U-Boot] [PATCH v1 4/5] bootcount: display5: spl: Extend SPL to support bootcount checking

Stefan Roese sr at denx.de
Mon Feb 26 15:14:03 UTC 2018


Hi Lukasz,

On 26.02.2018 13:22, Lukasz Majewski wrote:
> This patch is necessary for providing basic bootcount checking in the case
> of using "falcon" boot mode.
> 
> It forces u-boot proper boot, when we exceed the number of errors.
> 
> Signed-off-by: Lukasz Majewski <lukma at denx.de>
> ---
> 
>   board/liebherr/display5/spl.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/board/liebherr/display5/spl.c b/board/liebherr/display5/spl.c
> index 0a36e656c0..5812f71dfc 100644
> --- a/board/liebherr/display5/spl.c
> +++ b/board/liebherr/display5/spl.c
> @@ -20,6 +20,7 @@
>   #include <environment.h>
>   #include <fsl_esdhc.h>
>   #include <netdev.h>
> +#include <bootcount.h>
>   #include "common.h"
>   
>   DECLARE_GLOBAL_DATA_PTR;
> @@ -194,6 +195,9 @@ void board_init_f(ulong dummy)
>   	/* Clear the BSS. */
>   	memset(__bss_start, 0, __bss_end - __bss_start);
>   
> +	/* Increment bootcount */
> +	bootcount_inc();
> +

Wouldn't it be better, to move this incrementing into some common
code, so that other platform who might use the bootcounter in SPL
in the future could also use it without code duplication?

What do you think?

Thanks,
Stefan


More information about the U-Boot mailing list