diff mbox series

[v2] ref-manual/classes.rst: uboot-config: improve documentation

Message ID 20251022-improve-uboot-config-class-v2-1-914788ce5888@bootlin.com
State Under Review
Headers show
Series [v2] ref-manual/classes.rst: uboot-config: improve documentation | expand

Commit Message

Antonin Godard Oct. 22, 2025, 10:05 a.m. UTC
Improve the documentation of the uboot-config class. It was not
explaining any of its entry in UBOOT_CONFIG. Mention that using
UBOOT_CONFIG and UBOOT_MACHINE at the same time is not possible.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
Changes in v2:
- Suggestions from Quentin (thanks!):
  - Restructure uboot-config class in two parts.
  - Use "build configurations" to design UBOOT_CONFIG's flags (instead
    of "entry").
  - Rewordings and typos.
- Link to v1: https://lore.kernel.org/r/20251014-improve-uboot-config-class-v1-1-9163eea15557@bootlin.com
---
 documentation/ref-manual/classes.rst | 58 ++++++++++++++++++++++++++++++++----
 1 file changed, 52 insertions(+), 6 deletions(-)


---
base-commit: 8b85245490ae0b19a9c3880ec31e55b42e19d094
change-id: 20251014-improve-uboot-config-class-02b5923fa899

Best regards,
--  
Antonin Godard <antonin.godard@bootlin.com>
diff mbox series

Patch

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 662121ed9..1dc3c3b0f 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -3169,15 +3169,61 @@  variable using the "type" varflag. Here is an example::
 ``uboot-config``
 ================
 
-The :ref:`ref-classes-uboot-config` class provides support for U-Boot configuration for
-a machine. Specify the machine in your recipe as follows::
+The :ref:`ref-classes-uboot-config` class provides support for configuring one
+or more U-Boot build configurations.
 
-   UBOOT_CONFIG ??= <default>
-   UBOOT_CONFIG[foo] = "config,images,binary"
+There are two ways to configure the recipe for your machine:
 
-You can also specify the machine using this method::
+-  Using :term:`UBOOT_CONFIG` variable. For example::
 
-   UBOOT_MACHINE = "config"
+      UBOOT_CONFIG ??= "foo bar"
+      UBOOT_CONFIG[foo] = "config,images,binary"
+      UBOOT_CONFIG[bar] = "config2,images2,binary2"
+
+   In this example, all possible configurations are selected (``foo`` and
+   ``bar``), but it is also possible to build only ``foo`` or ``bar`` by
+   changing the value of :term:`UBOOT_CONFIG` to include either one or the
+   other.
+
+   Each build configuration is associated to a variable flag definition of
+   :term:`UBOOT_CONFIG`, that can take up to three comma-separated options
+   (``config,images,binary``):
+
+   -  ``config``: defconfig file selected for this build configuration.
+      These files are found in the source tree's ``configs`` folder of U-Boot.
+
+      *This option is mandatory.*
+
+   -  ``images``: image types to append to the :term:`IMAGE_FSTYPES` variable
+      for image generation for this build configuration.
+
+      This can allow building an extra image format that uses the binary
+      generated by this build configuration.
+
+      This option is not mandatory and can be left empty.
+
+   -  ``binary``: binary to select as the one to deploy in
+      :term:`DEPLOY_DIR_IMAGE`. The output of a U-Boot build may be more than
+      one binary, for example::
+
+         u-boot.bin
+         u-boot-with-spl.bin
+
+      Setting the ``binary`` value to ``u-boot-with-spl.bin`` will make this
+      binary the one deployed in :term:`DEPLOY_DIR_IMAGE`. It is renamed to
+      include the build configuration name in the process (``foo`` or ``bar`` in
+      the above example).
+
+      This option defaults to :term:`UBOOT_BINARY` if unset.
+
+-  Or, using the :term:`UBOOT_MACHINE` variable (and its companion variable
+   :term:`UBOOT_BINARY`). For example::
+
+      UBOOT_MACHINE = "config"
+      UBOOT_BINARY = "u-boot.bin"
+
+Using :term:`UBOOT_MACHINE` and :term:`UBOOT_CONFIG` at the same time is not
+possible.
 
 See the :term:`UBOOT_CONFIG` and :term:`UBOOT_MACHINE` variables for additional
 information.