On Sun, Jul 15, 2018 at 10:36 AM Prabhakar Kushwaha <prabhakar.kushw...@nxp.com> wrote: > > > > -----Original Message----- > > From: U-Boot [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Alex Kiernan > > Sent: Saturday, July 14, 2018 1:30 PM > > To: u-boot@lists.denx.de > > Cc: Thomas Petazzoni <thomas.petazz...@free-electrons.com>; Martyn Welch > > <martyn.we...@collabora.co.uk>; Ian Ray <ian....@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.kier...@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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot