summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-04-17 10:12:18 -0600
committerTom Rini <[email protected]>2026-04-17 10:12:18 -0600
commit7decfc66197ab9651e8993582224377be3dd8fb5 (patch)
tree4ad2250c0ec35ebf9d862ca4ce807c3fd763cdf7 /doc
parentbc6c4ee8d4309af706002a8d8b6bb2871c07fca2 (diff)
parent98d1d3227e8d9513a2705e9fa4c8aa9d20d8eeac (diff)
Merge tag 'efi-2026-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2026-07-rc1 CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/29844 Documentation: * correct title of CONTRIBUTE.rst * Fix fdt resize argument in fdt_overlays.rst * api: bootcount: correct bootcount description * binman: Add Sphinx extension to auto-generate entry and bintool docs * binman: Remove pre-generated entries.rst and bintools.rst * j784s4_evm: Automate BAR address lookup for PCIe Boot UEFI: * efi_var_sf: Do not fail on blank SPI Flash * Allow disabling ANSI console queries via Kconfig * bootstd: efi: Handle prior-stage FDT in network path * event: Check return value from event_notify_null() * event: Introduce EVT_POST_PREBOOT event * fwu: Move boottime checks to EVT_POST_PREBOOT
Diffstat (limited to 'doc')
-rw-r--r--doc/.gitignore2
-rw-r--r--doc/CONTRIBUTE.rst4
-rw-r--r--doc/api/bootcount.rst2
-rw-r--r--doc/board/ti/j784s4_evm.rst16
-rw-r--r--doc/conf.py3
l---------doc/develop/package/bintools.rst1
l---------doc/develop/package/entries.rst1
-rw-r--r--doc/sphinx/binman_docs.py207
-rw-r--r--doc/usage/fdt_overlays.rst4
9 files changed, 225 insertions, 15 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
index 53752db253e..7eeafcbf9fd 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1 +1,3 @@
output
+develop/package/entries.rst
+develop/package/bintools.rst
diff --git a/doc/CONTRIBUTE.rst b/doc/CONTRIBUTE.rst
index 8ccb3a193da..a47dfdca221 100644
--- a/doc/CONTRIBUTE.rst
+++ b/doc/CONTRIBUTE.rst
@@ -1,8 +1,8 @@
.. SPDX-License-Identifier: GPL-2.0+
.. sectionauthor:: Peter Robinson <[email protected]>
-Overview
---------
+Contributing
+============
This document is a high level contributors overview setting overall expectations,
so people can get started quickly, the rest of the documentation goes into the
diff --git a/doc/api/bootcount.rst b/doc/api/bootcount.rst
index 968c679c3c6..f3c10bbe724 100644
--- a/doc/api/bootcount.rst
+++ b/doc/api/bootcount.rst
@@ -8,7 +8,7 @@ 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.
+when ``upgrade_available`` is non-zero, 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
diff --git a/doc/board/ti/j784s4_evm.rst b/doc/board/ti/j784s4_evm.rst
index fb767bedbf6..ec82228ab90 100644
--- a/doc/board/ti/j784s4_evm.rst
+++ b/doc/board/ti/j784s4_evm.rst
@@ -456,12 +456,12 @@ The following steps describe the process of booting J784S4-EVM over PCIe:
0000:01:00.1 Non-VGA unclassified device: Texas Instruments Device 0100
0000:01:00.2 Non-VGA unclassified device: Texas Instruments Device 0100
-4. Copy ``tiboot3.bin`` to the endpoint. Use ``lspci -vv`` to identify the BAR
- address:
+4. Copy ``tiboot3.bin`` to BAR1 of Physical Function Zero of the endpoint:
.. prompt:: bash
- sudo ./pcie_boot_util 0x4007100000 tiboot3.bin
+ tiboot3_bar_address="0x$(lspci -D -nnvv | awk '/^[0-9a-fA-F]{4}:/ {bdf=$1; ram=($0 ~ /RAM memory/ || $0 ~ /Memory controller/)} ram && /Region [1]+:/ {print bdf, $0}' | cut -d ' ' -f 6)"
+ sudo ./pcie_boot_util ${tiboot3_bar_address} tiboot3.bin
The sample program automatically writes the image start address to
``0x41CF3FE0`` and the magic word ``0xB17CEAD9`` to ``0x41CF3FE4``.
@@ -491,11 +491,12 @@ The following steps describe the process of booting J784S4-EVM over PCIe:
(with appropriate DOMAIN:BUS:DEVICE.FUNCTION corresponding to the Endpoint) to enable
the BAR.
-6. Copy ``tispl.bin`` to the new BAR address (use ``lspci -vv`` to find):
+6. Copy ``tispl.bin`` to BAR0 of Physical Function Zero of the endpoint:
.. prompt:: bash
- sudo ./pcie_boot_util 0x4000400000 tispl.bin
+ tispl_bar_address="0x$(lspci -D -nnvv | awk '/^[0-9a-fA-F]{4}:/ {bdf=$1; ram=($0 ~ /RAM memory/ || $0 ~ /Memory controller/)} ram && /Region [0]+:/ {print bdf, $0}' | head -n1 | cut -d ' ' -f 6)"
+ sudo ./pcie_boot_util ${tispl_bar_address} tispl.bin
7. After ``tispl.bin`` is processed, the PCIe link will go down again. Remove
and rescan the PCIe device:
@@ -505,11 +506,12 @@ The following steps describe the process of booting J784S4-EVM over PCIe:
echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/remove
echo 1 > /sys/bus/pci/devices/0000\:00\:00.0/rescan
-8. Copy ``u-boot.img``:
+8. Copy ``u-boot.img`` to BAR0 of Physical Function Zero of the endpoint:
.. prompt:: bash
- sudo ./pcie_boot_util 0x4000400000 u-boot.img
+ uboot_bar_address="0x$(lspci -D -nnvv | awk '/^[0-9a-fA-F]{4}:/ {bdf=$1; ram=($0 ~ /RAM memory/ || $0 ~ /Memory controller/)} ram && /Region [0]+:/ {print bdf, $0}' | head -n1 | cut -d ' ' -f 6)"
+ sudo ./pcie_boot_util ${uboot_bar_address} u-boot.img
9. After ``u-boot.img`` is successfully loaded, the boot process is complete
and endpoint should boot till U-Boot prompt.
diff --git a/doc/conf.py b/doc/conf.py
index bf60fe14315..0d56e4f7c3c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -50,7 +50,8 @@ extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include',
'kfigure', 'sphinx.ext.ifconfig', # 'automarkup',
'maintainers_include', 'sphinx.ext.autosectionlabel',
'kernel_abi', 'kernel_feat', 'sphinx-prompt',
- 'sphinx_reredirects', 'sphinx.ext.autodoc' ]
+ 'sphinx_reredirects', 'sphinx.ext.autodoc',
+ 'binman_docs' ]
#
# cdomain is badly broken in Sphinx 3+. Leaving it out generates *most*
diff --git a/doc/develop/package/bintools.rst b/doc/develop/package/bintools.rst
deleted file mode 120000
index 7ef3d75e935..00000000000
--- a/doc/develop/package/bintools.rst
+++ /dev/null
@@ -1 +0,0 @@
-../../../tools/binman/bintools.rst \ No newline at end of file
diff --git a/doc/develop/package/entries.rst b/doc/develop/package/entries.rst
deleted file mode 120000
index ecedcebaad4..00000000000
--- a/doc/develop/package/entries.rst
+++ /dev/null
@@ -1 +0,0 @@
-../../../tools/binman/entries.rst \ No newline at end of file
diff --git a/doc/sphinx/binman_docs.py b/doc/sphinx/binman_docs.py
new file mode 100644
index 00000000000..34d12f1b7d5
--- /dev/null
+++ b/doc/sphinx/binman_docs.py
@@ -0,0 +1,207 @@
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2026 Simon Glass <[email protected]>
+#
+"""Sphinx extension to auto-generate binman entry and bintool documentation.
+
+This parses etype and btool source files using the ast module to extract
+class docstrings, avoiding the need to import binman modules (which have
+dependencies like libfdt that may not be available in the doc-build
+environment).
+
+The generated files are written to doc/develop/package/ (alongside
+binman.rst) and included via toctree directives. They are .gitignore'd
+since they are always regenerated during the build.
+
+To use, add 'binman_docs' to the extensions list in conf.py.
+"""
+
+import ast
+import os
+
+
+def get_entry_docstring(source_file):
+ """Extract the Entry_ class docstring from an etype source file.
+
+ Some files contain helper classes before the Entry_ class, so we look
+ specifically for a class whose name starts with 'Entry_'.
+
+ Args:
+ source_file: Path to the source file
+
+ Returns:
+ The docstring of the Entry_ class, or None
+ """
+ with open(source_file) as inf:
+ tree = ast.parse(inf.read())
+ for node in ast.iter_child_nodes(tree):
+ if isinstance(node, ast.ClassDef) and node.name.startswith('Entry_'):
+ return ast.get_docstring(node, clean=False)
+ return None
+
+
+def get_bintool_docstring(source_file):
+ """Extract the Bintool class docstring from a btool source file.
+
+ Args:
+ source_file: Path to the source file
+
+ Returns:
+ The docstring of the Bintool class, or None
+ """
+ with open(source_file) as inf:
+ tree = ast.parse(inf.read())
+ for node in ast.iter_child_nodes(tree):
+ if isinstance(node, ast.ClassDef) and node.name.startswith('Bintool'):
+ return ast.get_docstring(node, clean=False)
+ return None
+
+
+def generate_entry_docs(srcdir):
+ """Generate entries.rst content from etype source files.
+
+ Args:
+ srcdir: Root of the U-Boot source tree
+
+ Returns:
+ String containing RST content
+ """
+ etype_dir = os.path.join(srcdir, 'tools', 'binman', 'etype')
+ modules = sorted([
+ os.path.splitext(f)[0] for f in os.listdir(etype_dir)
+ if f.endswith('.py') and not f.startswith('_') and f != '__init__.py'
+ ])
+
+ parts = ['''\
+Binman Entry Documentation
+==========================
+
+This file describes the entry types supported by binman. These entry types can
+be placed in an image one by one to build up a final firmware image. It is
+fairly easy to create new entry types. Just add a new file to the 'etype'
+directory. You can use the existing entries as examples.
+
+Note that some entries are subclasses of others, using and extending their
+features to produce new behaviours.
+
+
+''']
+
+ missing = []
+ for name in modules:
+ source = os.path.join(etype_dir, name + '.py')
+ docs = get_entry_docstring(source)
+ if docs:
+ lines = docs.splitlines()
+ first_line = lines[0]
+ rest = [line[4:] for line in lines[1:]]
+ hdr = 'Entry: %s: %s' % (name.replace('_', '-'), first_line)
+
+ ref_name = 'etype_%s' % name
+ parts.append('.. _%s:' % ref_name)
+ parts.append('')
+ parts.append(hdr)
+ parts.append('-' * len(hdr))
+ parts.append('\n'.join(rest))
+ parts.append('')
+ parts.append('')
+ else:
+ missing.append(name)
+
+ if missing:
+ raise ValueError('Documentation is missing for modules: %s' %
+ ', '.join(missing))
+
+ return '\n'.join(parts)
+
+
+def generate_bintool_docs(srcdir):
+ """Generate bintools.rst content from btool source files.
+
+ Args:
+ srcdir: Root of the U-Boot source tree
+
+ Returns:
+ String containing RST content
+ """
+ btool_dir = os.path.join(srcdir, 'tools', 'binman', 'btool')
+ fnames = [
+ f for f in os.listdir(btool_dir)
+ if f.endswith('.py') and not f.startswith('_') and f != '__init__.py'
+ ]
+
+ def tool_sort_name(fname):
+ name = os.path.splitext(fname)[0]
+ if name.startswith('btool_'):
+ name = name[6:]
+ return name
+
+ fnames.sort(key=tool_sort_name)
+
+ parts = ['''\
+.. SPDX-License-Identifier: GPL-2.0+
+
+Binman bintool Documentation
+============================
+
+This file describes the bintools (binary tools) supported by binman. Bintools
+are binman's name for external executables that it runs to generate or process
+binaries. It is fairly easy to create new bintools. Just add a new file to the
+'btool' directory. You can use existing bintools as examples.
+
+
+''']
+
+ missing = []
+ for fname in fnames:
+ name = os.path.splitext(fname)[0]
+ # Strip btool_ prefix used for modules that conflict with Python libs
+ if name.startswith('btool_'):
+ name = name[6:]
+ source = os.path.join(btool_dir, fname)
+ docs = get_bintool_docstring(source)
+ if docs:
+ lines = docs.splitlines()
+ first_line = lines[0]
+ rest = [line[4:] for line in lines[1:]]
+ hdr = 'Bintool: %s: %s' % (name, first_line)
+ parts.append(hdr)
+ parts.append('-' * len(hdr))
+ parts.append('\n'.join(rest))
+ parts.append('')
+ parts.append('')
+ else:
+ missing.append(name)
+
+ if missing:
+ raise ValueError('Documentation is missing for modules: %s' %
+ ', '.join(missing))
+
+ return '\n'.join(parts)
+
+
+def generate_docs(app):
+ """Generate binman documentation RST files.
+
+ Called by Sphinx during the builder-inited event, before any RST files
+ are read.
+
+ Args:
+ app: The Sphinx application object
+ """
+ srcdir = os.path.abspath(os.path.join(app.srcdir, '..'))
+ outdir = os.path.join(app.srcdir, 'develop', 'package')
+
+ entries_rst = os.path.join(outdir, 'entries.rst')
+ content = generate_entry_docs(srcdir)
+ with open(entries_rst, 'w') as outf:
+ outf.write(content)
+
+ bintools_rst = os.path.join(outdir, 'bintools.rst')
+ content = generate_bintool_docs(srcdir)
+ with open(bintools_rst, 'w') as outf:
+ outf.write(content)
+
+
+def setup(app):
+ app.connect('builder-inited', generate_docs)
+ return {'version': '1.0', 'parallel_read_safe': True}
diff --git a/doc/usage/fdt_overlays.rst b/doc/usage/fdt_overlays.rst
index 15ebd17ccb1..730cb85b39a 100644
--- a/doc/usage/fdt_overlays.rst
+++ b/doc/usage/fdt_overlays.rst
@@ -104,11 +104,11 @@ Manually Loading and Applying Overlays
=> fdt addr $fdtaddr
-4. Grow it enough so it can encompass all applied overlays
+4. Grow it enough so it can encompass all applied overlays (the argument in hex)
::
- => fdt resize 8192
+ => fdt resize 2000
5. You are now ready to apply the overlay.