[U-Boot] [RESEND PATCH v2 1/2] Add BOOTCOUNT_BOOTLIMIT to set reboot limit

Alex Kiernan alex.kiernan at gmail.com
Sun Jul 15 15:47:16 UTC 2018


On Sun, Jul 15, 2018 at 10:36 AM Prabhakar Kushwaha
<prabhakar.kushwaha at nxp.com> wrote:
>
>
> > -----Original Message-----
> > From: U-Boot [mailto:u-boot-bounces at lists.denx.de] On Behalf Of Alex Kiernan
> > Sent: Saturday, July 14, 2018 1:30 PM
> > To: u-boot at lists.denx.de
> > Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>; Martyn Welch
> > <martyn.welch at collabora.co.uk>; Ian Ray <ian.ray at ge.com>
> > Subject: [U-Boot] [RESEND PATCH v2 1/2] Add BOOTCOUNT_BOOTLIMIT to set
> > reboot limit
> >
> > Add ability to set environment bootlimit from Kconfig
> >
> > Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
> > ---
> >
> > Changes in v2: None
> >
> >  drivers/bootcount/Kconfig | 8 ++++++++
> >  include/env_default.h     | 3 +++
> >  2 files changed, 11 insertions(+)
> >
> > diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index
> > d335ed14b9..9a0bd516d9 100644
> > --- a/drivers/bootcount/Kconfig
> > +++ b/drivers/bootcount/Kconfig
> > @@ -72,6 +72,14 @@ config BOOTCOUNT_AT91
> >
> >  endchoice
> >
> > +config BOOTCOUNT_BOOTLIMIT
> > +     int "Maximum number of reboot cycles allowed"
> > +     default 0
> > +     help
> > +       Set the Maximum number of reboot cycles allowed without the boot
> > +       counter being cleared.
> > +       If set to 0 do not set a boot limit in the environment.
> > +
>
> Just a curiosity, if maximum number of reboot cycles expires, what will be the behavior of u-boot?
>

It depends on which bootcount implementation you're using, I expect
some are undefined. For the default based on a u32, it'll wrap to 0
(which IIRC is defined behaviour in C) and you'll go back to the
bootcmd flow rather than altbootcmd.

> --pk
>
>


-- 
Alex Kiernan


More information about the U-Boot mailing list