summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-07-16 12:46:39 -0600
committerTom Rini <trini@konsulko.com>2024-07-16 12:56:20 -0600
commit7f050668699377321339d82231afe1417849b5f8 (patch)
treea63e29d79ba51fc859e09f18cb0832a1946a7e99 /doc
parent0b2394c110a5d796406ceded9cc42cebe29113ee (diff)
parent330a30f4289a49563dc594fb66129488e1e972db (diff)
downloadu-boot-7f050668699377321339d82231afe1417849b5f8.tar.gz
u-boot-7f050668699377321339d82231afe1417849b5f8.tar.bz2
u-boot-7f050668699377321339d82231afe1417849b5f8.zip
Merge patch series "drivers: bootcount: Add support for ANY filesystem"
Vasileios Amoiridis <vassilisamir@gmail.com> says: This patch adds support to save the bootcount variable in a file located in FAT filesystem. Up to now, there was support only for EXT filesystem.
Diffstat (limited to 'doc')
-rw-r--r--doc/README.bootcount53
-rw-r--r--doc/api/bootcount.rst58
-rw-r--r--doc/api/index.rst1
3 files changed, 59 insertions, 53 deletions
diff --git a/doc/README.bootcount b/doc/README.bootcount
deleted file mode 100644
index f6c5f82f98..0000000000
--- a/doc/README.bootcount
+++ /dev/null
@@ -1,53 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0+
-
-Boot Count Limit
-================
-
-This is enabled by CONFIG_BOOTCOUNT_LIMIT.
-
-This allows to detect multiple failed attempts to boot Linux.
-
-After a power-on reset, the "bootcount" variable will be initialized to 1, and
-each reboot will increment the value by 1.
-
-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" to 0 when the system booted
-successfully, thus allowing for more boot cycles.
-
-CONFIG_BOOTCOUNT_EXT
---------------------
-
-This adds support for maintaining boot count in a file on an EXT filesystem.
-The file to use is defined by:
-
-CONFIG_SYS_BOOTCOUNT_EXT_INTERFACE
-CONFIG_SYS_BOOTCOUNT_EXT_DEVPART
-CONFIG_SYS_BOOTCOUNT_EXT_NAME
-
-The format of the file is:
-
-==== =================
-type entry
-==== =================
-u8 magic
-u8 version
-u8 bootcount
-u8 upgrade_available
-==== =================
-
-To prevent unattended usage of "altbootcmd", the "upgrade_available" variable is
-used.
-If "upgrade_available" is 0, "bootcount" is not saved.
-If "upgrade_available" is 1, "bootcount" is saved.
-So a userspace application should take care of setting the "upgrade_available"
-and "bootcount" variables to 0, if the system boots successfully.
-This also avoids writing the "bootcount" information on all reboots.
diff --git a/doc/api/bootcount.rst b/doc/api/bootcount.rst
new file mode 100644
index 0000000000..968c679c3c
--- /dev/null
+++ b/doc/api/bootcount.rst
@@ -0,0 +1,58 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Boot Count Limit
+================
+
+This is enabled by CONFIG_BOOTCOUNT_LIMIT.
+
+This allows to detect multiple failed attempts to boot Linux.
+
+After a power-on reset, the ``bootcount`` variable will be initialized to 1, and
+each reboot will increment the value by 1.
+
+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`` to 0 when the system booted
+successfully, thus allowing for more boot cycles.
+
+CONFIG_BOOTCOUNT_FS
+--------------------
+
+This adds support for maintaining boot count in a file on a filesystem.
+Tested filesystems are FAT and EXT. The file to use is defined by:
+
+CONFIG_SYS_BOOTCOUNT_FS_INTERFACE
+CONFIG_SYS_BOOTCOUNT_FS_DEVPART
+CONFIG_SYS_BOOTCOUNT_FS_NAME
+
+The format of the file is:
+
+.. list-table::
+ :header-rows: 1
+
+ * - type
+ - entry
+ * - u8
+ - magic
+ * - u8
+ - version
+ * - u8
+ - bootcount
+ * - u8
+ - upgrade_available
+
+To prevent unintended usage of ``altbootcmd``, the ``upgrade_available``
+variable is used.
+If ``upgrade_available`` is 0, ``bootcount`` is not saved.
+If ``upgrade_available`` is 1, ``bootcount`` is saved.
+So a userspace application should take care of setting the ``upgrade_available``
+and ``bootcount`` variables to 0, if the system boots successfully.
+This also avoids writing the ``bootcount`` information on all reboots.
diff --git a/doc/api/index.rst b/doc/api/index.rst
index 51b2013af3..ec0b8adb2c 100644
--- a/doc/api/index.rst
+++ b/doc/api/index.rst
@@ -6,6 +6,7 @@ U-Boot API documentation
.. toctree::
:maxdepth: 2
+ bootcount
clk
dfu
dm