From: sbabic at denx.de Date: Tue, 23 Jun 2020 09:51:43 +0200 (CEST) Subject: [PATCH v1 10/13] toradex: imx: enable BOOTCOUNT feature In-Reply-To: <1592335211-5998-11-git-send-email-igor.opaniuk@gmail.com> Message-ID: <20200623075143.1D78D81ED1@phobos.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > From: Igor Opaniuk > This introduces automatic boot counter that increases after every > reset.After a power-on reset, it will be initialized with 1, > and each reboot will increment the value by 1. By default it's > disabled if bootlimit isn't set. > To enable this feature you have set bootcount limit ("bootlimit"), > alternate boot action ("altbootcmd") that will be performed if > the new value of bootcount exceeds the value of bootlimit, and > "upgrade_available" to let U-Boot automatically increase and save > the counter value after every reset: > > setenv bootlimit 5 > > setenv upgrade_available 1 > > setenv altbootcmd "bootm ..." > In case the bootlimit exceeds, the message will be shown and > albootcmd executed: > Warning: Bootlimit (5) exceeded. Using altbootcmd. > To reset bootcount run: > > bootcount reset > Print current value: > > bootcount print > Signed-off-by: Igor Opaniuk Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================