Skip to content

Commit

Permalink
Add BOOTCOUNT_BOOTLIMIT to set reboot limit
Browse files Browse the repository at this point in the history
Add ability to set environment bootlimit from Kconfig

Signed-off-by: Alex Kiernan <[email protected]>
  • Loading branch information
akiernan authored and trini committed Aug 17, 2018
1 parent d7869b2 commit c9ad6bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/bootcount/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions include/env_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c9ad6bc

Please sign in to comment.