The Open Source Development Labs
Carrier Grade Linux Requirements Definition
version 2.0
(
http://www.osdl.org/docs/carrier_grade_linux_requirements_definition___version_20_final_public_draft.pdf)
contains the following requirement definition (ID PLT.4.0, p. 44):
CGL shall provide support for detecting a repeating reboot cycle due to recurring failures and will go to an offline state if this occurs.
This feature is available in U-Boot if you enable the
CONFIG_BOOTCOUNT_LIMIT
configuration option. The implementation uses the following environment variables:
- bootcount:
- This variable will be automatically created if it does not exist,
and it will be updated at each reset of the processor.
After a power-on reset, it will be initialized with 1, and each reboot
will increment the value by 1.
- bootlimit:
- If this variable exists, its contents are taken as the maximum
number of reboot cycles allowed.
- altbootcmd:
- If, after a reboot, the new value of
bootcount
exceeds the value of bootlimit
, then instead of the standard boot action
(executing the contents of bootcmd
) an alternate boot action will be
performed, and the contents of altbootcmd
will be executed.
If the variable
bootlimit
is not defined in the environment,
the Boot Count Limit feature is disabled.
If it is enabled, but
altbootcmd
is not defined, then U-Boot will drop
into interactive mode and remain there.
It is the responsibility of some application code (typically a Linux application)
to reset the variable
bootcount
, thus allowing for more boot cycles.

At the moment, the Boot Count Limit feature is available only for MPC8xx and MPC82xx
PowerPC processors.