Add BOOTCOUNT_BOOTLIMIT to set reboot limit
authorAlex Kiernan <alex.kiernan@gmail.com>
Sat, 21 Jul 2018 20:25:32 +0000 (20:25 +0000)
committerTom Rini <trini@konsulko.com>
Fri, 17 Aug 2018 17:03:59 +0000 (13:03 -0400)
Add ability to set environment bootlimit from Kconfig

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
drivers/bootcount/Kconfig
include/env_default.h

index d335ed14b96172a5bbd29768546cf863d2f7bb8e..9a0bd516d93b58d0903300533a2e8a748a8a6a4d 100644 (file)
@@ -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.
+
 config BOOTCOUNT_ALEN
        int "I2C address length"
        default 1
index bd600cfa44ad023ca7fc9326e71ea45f505d353a..86b639d3e28346314370921f4fa72d2214c2b85a 100644 (file)
@@ -104,6 +104,9 @@ const uchar default_environment[] = {
        "soc="          CONFIG_SYS_SOC                  "\0"
 #endif
 #endif
+#if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0)
+       "bootlimit="    __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0"
+#endif
 #ifdef CONFIG_EXTRA_ENV_SETTINGS
        CONFIG_EXTRA_ENV_SETTINGS
 #endif