From df928f8549ab4470b45bdf3ca2a1b45c9ffd4317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Tue, 17 Mar 2020 17:59:09 +0100 Subject: bootcount_ext: Add flag to enable/disable bootcount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After a successful upgrade, multiple problem during boot sequence may trigger the altbootcmd process. This patch adds a version and an upgrade_available entries to the bootcount file to enable/disable the bootcount check. When failing to read the bootcount file it will consider that bootcount is enabled, acting as previously, and update the file accordingly. The bootcount file is only saved when `upgrade_available` is true, this allows to save writes to the filesystem. Signed-off-by: Frédéric Danis Reviewed-by: Simon Glass --- doc/README.bootcount | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 doc/README.bootcount (limited to 'doc') diff --git a/doc/README.bootcount b/doc/README.bootcount new file mode 100644 index 00000000000..b1c22905c66 --- /dev/null +++ b/doc/README.bootcount @@ -0,0 +1,51 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Boot Count Limit +================ + +This allows to detect multiple failed attempts to boot Linux. + +After a power-on reset, "bootcount" variable will be initialized with 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", thus allowing for more boot +cycles. + +BOOTCOUNT_EXT +------------- + +This adds support for maintaining boot count in a file on an EXT filesystem. +The file to use is define by: + +SYS_BOOTCOUNT_EXT_INTERFACE +SYS_BOOTCOUNT_EXT_DEVPART +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 save. +So the Userspace Application must set the "upgrade_available" and "bootcount" +variables to 0, if a boot was successfully. +This also prevents writes on all reboots. -- cgit v1.2.3 From 9b544c9eb312741e8e27bb738329bcf2737168ad Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Fri, 20 Mar 2020 02:18:30 -0400 Subject: docs: Fix conf.py for Sphinx 2.0 commit 3bc8088464712fdcb078eefb68837ccfcc413c88 upstream. Our version check in Documentation/conf.py never envisioned a world where Sphinx moved beyond 1.x. Now that the unthinkable has happened, fix our version check to handle higher version numbers correctly. Signed-off-by: Jonathan Corbet [rebase for u-boot] Signed-off-by: Sean Anderson --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/conf.py b/doc/conf.py index 0772fb6f0c8..8bb27ad9e25 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -37,7 +37,7 @@ needs_sphinx = '1.3' extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kfigure'] # The name of the math extension changed on Sphinx 1.4 -if major == 1 and minor > 3: +if (major == 1 and minor > 3) or (major > 1): extensions.append("sphinx.ext.imgmath") else: extensions.append("sphinx.ext.pngmath") -- cgit v1.2.3 From ebfe611be91e0075c040588a30a9996519d30aa6 Mon Sep 17 00:00:00 2001 From: Kever Yang Date: Mon, 30 Mar 2020 11:56:24 +0800 Subject: mkimage: fit_image: Add option to make fit header align The image is usually stored in block device like emmc, SD card, make the offset of image data aligned to block(512 byte) can avoid data copy during boot process. eg. SPL boot from FIT image with external data: - SPL read the first block of FIT image, and then parse the header; - SPL read image data separately; - The first image offset is the base_offset which is the header size; - The second image offset is just after the first image; - If the offset of imge does not aligned, SPL will do memcpy; The header size is a ramdon number, which is very possible not aligned, so add '-B size'to specify the align size in hex for better performance. example usage: ./tools/mkimage -E -f u-boot.its -B 0x200 u-boot.itb Signed-off-by: Kever Yang Reviewed-by: Punit Agrawal Reviewed-by: Tom Rini --- doc/uImage.FIT/source_file_format.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc') diff --git a/doc/uImage.FIT/source_file_format.txt b/doc/uImage.FIT/source_file_format.txt index 18d2aedcb73..884a58456f7 100644 --- a/doc/uImage.FIT/source_file_format.txt +++ b/doc/uImage.FIT/source_file_format.txt @@ -304,6 +304,11 @@ Normal kernel FIT image has data embedded within FIT structure. U-Boot image for SPL boot has external data. Existence of 'data-offset' can be used to identify which format is used. +For FIT image with external data, it would be better to align each blob of data +to block(512 byte) for block device, so that we don't need to do the copy when +read the image data in SPL. Pass '-B 0x200' to mkimage to align the FIT +structure and data to 512 byte, other values available for other align size. + 9) Examples ----------- -- cgit v1.2.3 From ae2b3e851025587e02eecf11e08cec3503c46bdb Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 18 Apr 2020 02:16:34 +0200 Subject: doc: invalid doc link in rstFlatTable.py Remove an invalid documentation link in rstFlatTable.py. This synchronizes the file with Linux next-20200413. Signed-off-by: Heinrich Schuchardt --- doc/sphinx/rstFlatTable.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'doc') diff --git a/doc/sphinx/rstFlatTable.py b/doc/sphinx/rstFlatTable.py index f9a4b46dbe2..2019a55f6b1 100755 --- a/doc/sphinx/rstFlatTable.py +++ b/doc/sphinx/rstFlatTable.py @@ -53,8 +53,6 @@ from docutils.utils import SystemMessagePropagation # common globals # ============================================================================== -# The version numbering follows numbering of the specification -# (doc/books/kernel-doc-HOWTO). __version__ = '1.0' PY3 = sys.version_info[0] == 3 -- cgit v1.2.3