1.. SPDX-License-Identifier: GPL-2.0+ 2 3Boot Count Limit 4================ 5 6This allows to detect multiple failed attempts to boot Linux. 7 8After a power-on reset, "bootcount" variable will be initialized with 1, and 9each reboot will increment the value by 1. 10 11If, after a reboot, the new value of "bootcount" exceeds the value of 12"bootlimit", then instead of the standard boot action (executing the contents of 13"bootcmd") an alternate boot action will be performed, and the contents of 14"altbootcmd" will be executed. 15 16If the variable "bootlimit" is not defined in the environment, the Boot Count 17Limit feature is disabled. If it is enabled, but "altbootcmd" is not defined, 18then U-Boot will drop into interactive mode and remain there. 19 20It is the responsibility of some application code (typically a Linux 21application) to reset the variable "bootcount", thus allowing for more boot 22cycles. 23 24BOOTCOUNT_EXT 25------------- 26 27This adds support for maintaining boot count in a file on an EXT filesystem. 28The file to use is define by: 29 30SYS_BOOTCOUNT_EXT_INTERFACE 31SYS_BOOTCOUNT_EXT_DEVPART 32SYS_BOOTCOUNT_EXT_NAME 33 34The format of the file is: 35 36==== ================= 37type entry 38==== ================= 39u8 magic 40u8 version 41u8 bootcount 42u8 upgrade_available 43==== ================= 44 45To prevent unattended usage of "altbootcmd" the "upgrade_available" variable is 46used. 47If "upgrade_available" is 0, "bootcount" is not saved, if "upgrade_available" is 481 "bootcount" is save. 49So the Userspace Application must set the "upgrade_available" and "bootcount" 50variables to 0, if a boot was successfully. 51This also prevents writes on all reboots. 52